gnunet: fix things and use newer source version
authorDaniel Golle <redacted>
Sun, 31 May 2015 02:54:23 +0000 (04:54 +0200)
committerDaniel Golle <redacted>
Sun, 31 May 2015 05:14:25 +0000 (07:14 +0200)
 - use newer source version from SVN
 - made it detect gnurl
 - added init script
 - added gnunet user

Signed-off-by: Daniel Golle <redacted>
net/gnunet/Makefile
net/gnunet/files/gnunet.init [new file with mode: 0644]
net/gnunet/patches/012-work-around-bad-workarounds.patch [new file with mode: 0644]

index 3fc933d4ae160f64695a08082ea1fcbf667bf371..b2b45389edea8447a991e0d3cfe20776b5331c7b 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=35839
+PKG_SOURCE_VERSION:=35844
 PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
 PKG_RELEASE:=1
 
@@ -35,16 +35,23 @@ include $(INCLUDE_DIR)/package.mk
 
 CONFIGURE_ARGS+= \
        --disable-rpath \
-       --with-libunistring-prefix \
-       --without-postgresql \
-       --without-mysql
+       --with-extractor=$(STAGING_DIR)/usr \
+       --with-gnutls=$(STAGING_DIR)/usr \
+       --with-libgnurl=$(STAGING_DIR)/usr \
+       --with-libunistring-prefix=$(STAGING_DIR)/usr \
+       --with-ltdl \
+       --with-microhttpd=$(STAGING_DIR)/usr \
+       --without-mysql \
+       --without-postgresql
 
 define Package/gnunet
   SECTION:=net
   CATEGORY:=Network
   TITLE:=GNUnet peer-to-peer framework focusing on security
-  DEPENDS:=+libextractor +libidn +libmicrohttpd +libunistring +libgnutls +libsqlite3 +kmod-tun
+  DEPENDS:=+kmod-tun +libextractor +libgnurl +libgnutls +libidn \
+           +libmicrohttpd +libunistring +libsqlite3
   URL:=https://www.gnunet.org/
+  USERID:=gnunet=400:gnunet=400
 endef
 
 define Package/gnunet/description
@@ -65,7 +72,9 @@ define Package/gnunet/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/*.so $(1)/usr/lib/gnunet
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/* $(1)/usr/lib/gnunet/libexec
        $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
-       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/* $(1)/usr/share/gnunet/config.d
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/* $(1)/usr/share/gnunet/config.d
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
 endef
 
 define Build/InstallDev
diff --git a/net/gnunet/files/gnunet.init b/net/gnunet/files/gnunet.init
new file mode 100644 (file)
index 0000000..baecd94
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=50
+STOP=10
+
+USE_PROCD=1
+PROG=/usr/bin/gnunet-arm
+CONFIGFILE=/var/run/gnunet/gnunet.conf
+
+start_service() {
+       if [ ! -e /var/run/gnunet ]; then
+               mkdir -p /var/run/gnunet
+               chmod 0750 /var/run/gnunet
+               chown gnunet:gnunet /var/run/gnunet
+               touch $CONFIGFILE
+               chown gnunet:gnunet $CONFIGFILE
+               chmod 0600 $CONFIGFILE
+       fi
+       procd_open_instance
+       procd_set_param user gnunet
+       procd_set_param command $PROG -c $CONFIGFILE -s -m
+       procd_set_param respawn
+       procd_close_instance
+}
+
+stop_service() {
+       procd_open_instance
+       procd_set_param user gnunet
+       procd_set_param command $PROG -c $CONFIGFILE -e
+       procd_close_instance
+}
diff --git a/net/gnunet/patches/012-work-around-bad-workarounds.patch b/net/gnunet/patches/012-work-around-bad-workarounds.patch
new file mode 100644 (file)
index 0000000..d487560
--- /dev/null
@@ -0,0 +1,104 @@
+Index: gnunet-0.10.1-svn35844/m4/libgnurl.m4
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/m4/libgnurl.m4
++++ gnunet-0.10.1-svn35844/m4/libgnurl.m4
+@@ -146,7 +146,7 @@ AC_DEFUN([LIBGNURL_CHECK_CONFIG],
+            _libgnurl_save_libs=$LIBS
+            LIBS="$LIBGNURL $LIBS"
+-           AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <curl/curl.h>],[
++           AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnurl/curl.h>],[
+ /* Try and use a few common options to force a failure if we are
+    missing symbols or can't link. */
+ int x;
+Index: gnunet-0.10.1-svn35844/src/gns/gnunet-gns-proxy.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/gns/gnunet-gns-proxy.c
++++ gnunet-0.10.1-svn35844/src/gns/gnunet-gns-proxy.c
+@@ -29,7 +29,7 @@
+  */
+ #include "platform.h"
+ #include <microhttpd.h>
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #include <gnutls/gnutls.h>
+ #include <gnutls/x509.h>
+ #include <gnutls/abstract.h>
+Index: gnunet-0.10.1-svn35844/src/gns/test_gns_proxy.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/gns/test_gns_proxy.c
++++ gnunet-0.10.1-svn35844/src/gns/test_gns_proxy.c
+@@ -24,7 +24,7 @@
+  * @author Martin Schanzenbach
+  */
+ #include "platform.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #include <microhttpd.h>
+ #include "gnunet_namestore_service.h"
+ #include "gnunet_gns_service.h"
+Index: gnunet-0.10.1-svn35844/src/hostlist/gnunet-daemon-hostlist_client.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/hostlist/gnunet-daemon-hostlist_client.c
++++ gnunet-0.10.1-svn35844/src/hostlist/gnunet-daemon-hostlist_client.c
+@@ -29,7 +29,7 @@
+ #include "gnunet_statistics_service.h"
+ #include "gnunet_transport_service.h"
+ #include "gnunet-daemon-hostlist.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ /**
+Index: gnunet-0.10.1-svn35844/src/pt/test_gns_vpn.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/pt/test_gns_vpn.c
++++ gnunet-0.10.1-svn35844/src/pt/test_gns_vpn.c
+@@ -24,7 +24,7 @@
+  * @author Martin Schanzenbach
+  */
+ #include "platform.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #include <microhttpd.h>
+ #include "gnunet_identity_service.h"
+ #include "gnunet_namestore_service.h"
+Index: gnunet-0.10.1-svn35844/src/pt/test_gnunet_vpn.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/pt/test_gnunet_vpn.c
++++ gnunet-0.10.1-svn35844/src/pt/test_gnunet_vpn.c
+@@ -24,7 +24,7 @@
+  * @author Christian Grothoff
+  */
+ #include "platform.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #include <microhttpd.h>
+ #include "gnunet_vpn_service.h"
+ #include "gnunet_testing_lib.h"
+Index: gnunet-0.10.1-svn35844/src/transport/plugin_transport_http.h
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/transport/plugin_transport_http.h
++++ gnunet-0.10.1-svn35844/src/transport/plugin_transport_http.h
+@@ -41,7 +41,7 @@
+ #include "gnunet_os_lib.h"
+ #include "gnunet_nat_lib.h"
+ #include "microhttpd.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #define DEBUG_HTTP GNUNET_EXTRA_LOGGING
+Index: gnunet-0.10.1-svn35844/src/transport/plugin_transport_http_client.c
+===================================================================
+--- gnunet-0.10.1-svn35844.orig/src/transport/plugin_transport_http_client.c
++++ gnunet-0.10.1-svn35844/src/transport/plugin_transport_http_client.c
+@@ -49,7 +49,7 @@
+ #include "gnunet_protocols.h"
+ #include "gnunet_transport_plugin.h"
+ #include "plugin_transport_http_common.h"
+-#include <curl/curl.h>
++#include <gnurl/curl.h>
+ #define LOG(kind,...) GNUNET_log_from(kind, PLUGIN_NAME, __VA_ARGS__)
git clone https://git.99rst.org/PROJECT