View | Details | Raw Unified | Return to bug 230316 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 230316