From ca3dfcfec29b4919073efb2fbc0962cf4841259d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 28 Apr 2016 03:04:55 +0200 Subject: [PATCH] gnunet: use uci-defaults and further break core into components Signed-off-by: Daniel Golle --- net/gnunet/Makefile | 141 +++++++----------------- net/gnunet/files/gnunet-dns.fw | 7 -- net/gnunet/files/gnunet-flat.defaults | 13 +++ net/gnunet/files/gnunet-gns.defaults | 50 +++++++++ net/gnunet/files/gnunet-sqlite.defaults | 16 +++ net/gnunet/files/gnunet-vpn.defaults | 34 ++++++ net/gnunet/files/gnunet.init | 3 +- 7 files changed, 152 insertions(+), 112 deletions(-) delete mode 100755 net/gnunet/files/gnunet-dns.fw create mode 100644 net/gnunet/files/gnunet-flat.defaults create mode 100644 net/gnunet/files/gnunet-gns.defaults create mode 100644 net/gnunet/files/gnunet-sqlite.defaults create mode 100644 net/gnunet/files/gnunet-vpn.defaults diff --git a/net/gnunet/Makefile b/net/gnunet/Makefile index 93d40930c..7f6117a76 100644 --- a/net/gnunet/Makefile +++ b/net/gnunet/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gnunet PKG_SOURCE_VERSION:=37051 PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION) -PKG_RELEASE:=2 +PKG_RELEASE:=3 # ToDo: # - break-out {peer,name,data}store for each backend @@ -59,8 +59,9 @@ endef define Package/gnunet $(call Package/gnunet/Default) TITLE+= - a peer-to-peer framework focusing on security - DEPENDS:=+ca-certificates +libgnurl +libgnutls +libidn +libltdl \ - +libmicrohttpd +libunistring +librt $(ICONV_DEPENDS) $(INTL_DEPENDS) + DEPENDS:=+ca-certificates +libgcrypt +libgpg-error +libgnurl \ + +libgnutls +libidn +libltdl +libunistring +librt \ + $(ICONV_DEPENDS) $(INTL_DEPENDS) USERID:=gnunet=400:gnunet=400 MENU:=1 endef @@ -123,6 +124,11 @@ define BuildComponent $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \ done \ fi ) + + ( if [ -e ./files/gnunet-$(1).defaults ]; then \ + $(INSTALL_DIR) $$(1)/etc/uci-defaults ; \ + $(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \ + fi ) endef $$(eval $$(call BuildPackage,gnunet-$(1))) @@ -149,7 +155,7 @@ define Package/gnunet/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \ done ) - ( for lex in daemon-hostlist daemon-topology helper-nat-client \ + ( for lex in daemon-topology helper-nat-client \ helper-nat-server service-arm service-ats service-cadet \ service-core service-dht service-identity service-nse \ service-peerinfo service-regex \ @@ -160,7 +166,7 @@ define Package/gnunet/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \ done ) - ( for conf in arm ats cadet core datacache dht hostlist identity \ + ( for conf in arm ats cadet core datacache dht identity \ nat nse peerinfo regex revocation scalarproduct \ set statistics topology transport util; do \ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \ @@ -173,7 +179,6 @@ define Package/gnunet/install $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/gnunet - $(INSTALL_BIN) ./files/gnunet-dns.fw $(1)/usr/lib/gnunet/libexec/gnunet-dns.fw $(INSTALL_DIR) $(1)/lib/netifd/proto $(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto endef @@ -196,6 +201,10 @@ PLUGIN_conversation:=gnsrecord_conversation LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation CONF_conversation:=conversation +DEPENDS_hostlist:=+libmicrohttpd +LIBEXEC_hostlist:=daemon-hostlist +CONF_hostlist:=hostlist + DEPENDS_transport-http_client:=+libgnurl PLUGIN_transport-http_client:=transport_http_client transport_https_client @@ -227,9 +236,15 @@ USERID_gns:=gnunet=400:gnunetdns=401 BIN_gns:=gns gns-import.sh namecache namestore resolver LIB_gns:=gns gnsrecord namecache namestore PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns -LIBEXEC_gns:=dns2gns gns-proxy helper-dns namestore-fcfsd service-dns service-gns service-namecache service-namestore service-resolver +LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver CONF_gns:=dns gns namecache namestore resolver +DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd +LIBEXEC_namestore-fcfsd:=namestore-fcfsd + +DEPENDS_gns-proxy:=+gnunet-gns +libmicrohttpd +LIBEXEC_gns-proxy:=gns-proxy + DEPENDS_datastore:=+gnunet-gns +libsqlite3 BIN_datastore:=datastore LIB_datastore:=datastore @@ -253,7 +268,7 @@ DEPENDS_pgsql:=+gnunet-gns +gnunet-datastore +libpq LIB_pgsql:=postgres pq PLUGIN_pgsql:=datacache_postgres datastore_postgres namecache_postgres namestore_postgres -DEPENDS_rest:=+gnunet-gns +gnunet-social +jansson +DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson LIB_rest:=rest PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore LIBEXEC_rest:=rest-server @@ -264,7 +279,7 @@ LIB_rps:=rps LIBEXEC_rps:=service-rps CONF_rps:=rps -DEPENDS_social:=+gnunet-sqlite +jansson +DEPENDS_social:=+gnunet-sqlite +libmicrohttpd +jansson BIN_social:=identity-token multicast LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social PLUGIN_social:=psycstore_sqlite @@ -281,59 +296,12 @@ LIBEXEC_transport-bluetooth:=helper-transport-bluetooth DEPENDS_utils:=+certtool +openssl-util BIN_utils:=gns-proxy-setup-ca transport-certificate-creation scrypt -DEPENDS_vpn:=+kmod-tun +iptables +DEPENDS_vpn:=+kmod-tun +iptables +firewall BIN_vpn:=vpn LIB_vpn:=tun vpn LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn CONF_vpn:=exit pt vpn -define PostInstFixSUIDPerms - define Package/$(1)/postinst - #!/bin/sh - [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix - endef -endef - -define Package/gnunet-gns/postinst -#!/bin/sh - -[ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix - -uci -q batch </dev/null 2>/dev/null || exit 0 - -iptables -t mangle -I OUTPUT 1 -p udp -m owner --gid-owner gnunetdns --dport 53 -j ACCEPT -iptables -t mangle -I OUTPUT 2 -p udp --dport 53 -j MARK --set-mark 136708149 - diff --git a/net/gnunet/files/gnunet-flat.defaults b/net/gnunet/files/gnunet-flat.defaults new file mode 100644 index 000000000..e00a7e376 --- /dev/null +++ b/net/gnunet/files/gnunet-flat.defaults @@ -0,0 +1,13 @@ +#!/bin/sh + +uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config +uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config + +uci -q batch <