--- www/kiwix-tools/Makefile (nonexistent) +++ www/kiwix-tools/Makefile (working copy) @@ -0,0 +1,27 @@ +# $FreeBSD$ + +PORTNAME= kiwix-tools +DISTVERSION= 0.6.0 +CATEGORIES= www + +MAINTAINER= int19h@gmail.com +COMMENT= Command-line Kiwix tools + +LICENSE= GPLv3+ +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libkiwix.so:devel/kiwix-lib \ + libmicrohttpd.so:www/libmicrohttpd \ + libctpp2.so:textproc/ctpp2 \ + libzim.so:devel/libzim + +USES= meson pkgconfig +USE_GITHUB= yes +GH_ACCOUNT= kiwix +USE_RC_SUBR= kiwix_serve + +post-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/share/kiwix + ${INSTALL_DATA} files/library.xml ${STAGEDIR}${PREFIX}/share/kiwix + +.include --- www/kiwix-tools/distinfo (nonexistent) +++ www/kiwix-tools/distinfo (working copy) @@ -0,0 +1,3 @@ +TIMESTAMP = 1533258280 +SHA256 (kiwix-kiwix-tools-0.6.0_GH0.tar.gz) = 0907b21937d64bf89950c50ea8a8d396cf88bb8db76cc51f4fdcbdedbbd71cc2 +SIZE (kiwix-kiwix-tools-0.6.0_GH0.tar.gz) = 222360 --- www/kiwix-tools/files/kiwix_serve.in (nonexistent) +++ www/kiwix-tools/files/kiwix_serve.in (working copy) @@ -0,0 +1,35 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: kiwix_serve +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# kiwix_serve_enable (bool): Set to NO by default. +# Set it to YES to enable kiwix_serve. +# kiwix_serve_port (int): Port on which the daemon will handle HTTP +# requests. Set to 80 by default. +# kiwix_serve_library (path): XML file listing ZIM files for the daemon +# to serve. Use kiwix-manage to create one, +# and to add ZIM files to it. Set to +# %%PREFIX%%/share/kiwix/library.xml by default. + +. /etc/rc.subr + +name=kiwix_serve +rcvar=kiwix_serve_enable + +load_rc_config $name + +: ${kiwix_serve_enable:=NO} +: ${kiwix_serve_port=80} +: ${kiwix_serve_library="%%PREFIX%%/share/kiwix/library.xml"} + +command=%%PREFIX%%/bin/kiwix-serve +command_args="--daemon --port $kiwix_serve_port --library $kiwix_serve_library" + +run_rc_command "$1" --- www/kiwix-tools/files/library.xml (nonexistent) +++ www/kiwix-tools/files/library.xml (working copy) @@ -0,0 +1,4 @@ + + + + --- www/kiwix-tools/files/patch-src_server_kiwix-serve.cpp (nonexistent) +++ www/kiwix-tools/files/patch-src_server_kiwix-serve.cpp (working copy) @@ -0,0 +1,19 @@ +--- src/server/kiwix-serve.cpp.orig 2018-06-15 17:29:59 UTC ++++ src/server/kiwix-serve.cpp +@@ -79,6 +79,7 @@ extern "C" { + #include + #include + #include ++#include + #include + #endif + +@@ -130,7 +131,7 @@ get_from_humanReadableBookId(const std:: + static std::string getMimeTypeForFile(const std::string& filename) + { + std::string mimeType = "text/plain"; +- unsigned int pos = filename.find_last_of("."); ++ std::size_t pos = filename.find_last_of("."); + + if (pos != std::string::npos) { + std::string extension = filename.substr(pos + 1); --- www/kiwix-tools/files/patch-src_server_request__context.cpp (nonexistent) +++ www/kiwix-tools/files/patch-src_server_request__context.cpp (working copy) @@ -0,0 +1,10 @@ +--- src/server/request_context.cpp.orig 2018-06-15 17:29:59 UTC ++++ src/server/request_context.cpp +@@ -30,7 +30,6 @@ RequestContext::RequestContext(struct MH + const std::string& _url, + const std::string& method, + const std::string& version) : +- connection(connection), + full_url(_url), + url(_url), + valid_url(true), --- www/kiwix-tools/files/patch-src_server_request__context.h (nonexistent) +++ www/kiwix-tools/files/patch-src_server_request__context.h (working copy) @@ -0,0 +1,18 @@ +--- src/server/request_context.h.orig 2018-06-15 17:29:59 UTC ++++ src/server/request_context.h +@@ -23,6 +23,7 @@ + #define REQUEST_CONTEXT_H + + #include ++#include + #include + #include + +@@ -84,7 +85,6 @@ class RequestContext { + int httpResponseCode; + + private: +- struct MHD_Connection* connection; + std::string full_url; + std::string url; + bool valid_url; --- www/kiwix-tools/pkg-descr (nonexistent) +++ www/kiwix-tools/pkg-descr (working copy) @@ -0,0 +1,7 @@ +Kiwix is an offline reader for web content archived in ZIM format. It is +particularly tailored towards Wikipedia and other wikis. + +This package contains command-line Kiwix tools: a local HTTP server to serve +content, and a set of tools to manage ZIM files. + +WWW: http://www.kiwix.org/ --- www/kiwix-tools/pkg-plist (nonexistent) +++ www/kiwix-tools/pkg-plist (working copy) @@ -0,0 +1,9 @@ +bin/kiwix-manage +bin/kiwix-read +bin/kiwix-search +bin/kiwix-serve +man/fr/man1/kiwix-manage.1.gz +man/fr/man1/kiwix-serve.1.gz +man/man1/kiwix-manage.1.gz +man/man1/kiwix-serve.1.gz +share/kiwix/library.xml