You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

428 lines
15 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gnunet
  3. PKG_VERSION:=0.11.6
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=@GNU/gnunet
  7. PKG_HASH:=f8a07063b1e0890a1386fed2313a967f58f5495c075a25725aba200469c857bf
  8. PKG_LICENSE:=AGPL-3.0
  9. PKG_LICENSE_FILES:=COPYING
  10. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  11. PKG_CPE_ID:=cpe:/a:gnunet:gnunet
  12. PKG_BUILD_PARALLEL:=1
  13. PKG_FIXUP:=gettext-version
  14. PKG_INSTALL:=1
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/nls.mk
  17. CONFIGURE_ARGS+= \
  18. --with-libiconv-prefix="$(ICONV_PREFIX)" \
  19. --with-libintl-prefix="$(INTL_PREFIX)" \
  20. --with-ltdl \
  21. $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
  22. $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
  23. $(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
  24. --enable-testing \
  25. --disable-testruns \
  26. --disable-documentation \
  27. --enable-experimental \
  28. --with-extractor=$(STAGING_DIR)/usr \
  29. --with-gnutls=$(STAGING_DIR)/usr \
  30. --with-libgnurl=$(STAGING_DIR)/usr \
  31. --with-libunistring-prefix=$(STAGING_DIR)/usr \
  32. --with-microhttpd=$(STAGING_DIR)/usr
  33. # ToDo: request upstream to provide --with-pulseaudio=...
  34. TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
  35. define Package/gnunet/Default
  36. SECTION:=net
  37. CATEGORY:=Network
  38. TITLE:=GNUnet
  39. URL:=https://www.gnunet.org/
  40. endef
  41. define Package/gnunet
  42. $(call Package/gnunet/Default)
  43. TITLE+= - a peer-to-peer framework focusing on security
  44. DEPENDS:=+libatomic +libgcrypt +libgpg-error +libidn2 +libltdl +libunistring \
  45. +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
  46. USERID:=gnunet=958:gnunet=958
  47. MENU:=1
  48. endef
  49. define Package/gnunet/description
  50. GNUnet is a peer-to-peer framework focusing on security. The first and
  51. primary application for GNUnet is anonymous file-sharing. GNUnet is
  52. currently developed by a worldwide group of independent free software
  53. developers. GNUnet is a GNU package (http://www.gnu.org/).
  54. This is an ALPHA release. There are known and significant bugs as
  55. well as many missing features in this release.
  56. This package provides the core components of GNUnet including the
  57. CADET routing engine, a DHT implementation and basic transports as
  58. well as their helpers.
  59. endef
  60. define BuildComponent
  61. PKG_CONFIG_DEPENDS+=CONFIG_PACKAGE_$(PKG_NAME)-$(1)
  62. define Package/gnunet-$(1)
  63. $$(call Package/gnunet/Default)
  64. TITLE+= $(2)
  65. DEPENDS:=gnunet $(DEPENDS_$(1))
  66. $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
  67. $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
  68. $(if $(CONFLICTS_$(1)),CONFLICTS:=$(CONFLICTS_$(1)))
  69. endef
  70. define Package/gnunet-$(1)/install
  71. ( if [ "$(BIN_$(1))" ]; then \
  72. $(INSTALL_DIR) $$(1)/usr/bin ; \
  73. for bin in $(BIN_$(1)); do \
  74. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
  75. done \
  76. fi )
  77. ( if [ "$(LIB_$(1))" ]; then \
  78. $(INSTALL_DIR) $$(1)/usr/lib ; \
  79. for lib in $(LIB_$(1)); do \
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
  81. done \
  82. fi )
  83. ( if [ "$(PLUGIN_$(1))" ]; then \
  84. $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
  85. for plug in $(PLUGIN_$(1)); do \
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
  87. done \
  88. fi )
  89. ( if [ "$(LIBEXEC_$(1))" ]; then \
  90. $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
  91. for lex in $(LIBEXEC_$(1)); do \
  92. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
  93. done \
  94. fi )
  95. ( if [ "$(CONF_$(1))" ]; then \
  96. $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
  97. for conf in $(CONF_$(1)); do \
  98. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
  99. done \
  100. fi )
  101. ( if [ -e ./files/gnunet-$(1).defaults ]; then \
  102. $(INSTALL_DIR) $$(1)/etc/uci-defaults ; \
  103. $(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \
  104. fi )
  105. endef
  106. $$(eval $$(call BuildPackage,gnunet-$(1)))
  107. endef
  108. define Package/gnunet/install
  109. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
  110. $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
  111. ( for bin in arm ats ats-new cadet core config ecc identity nat nat-auto nat-server nse \
  112. peerinfo peerstore revocation scalarproduct scrypt statistics transport uri; do \
  113. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
  114. done )
  115. ( for lib in arm ats atsapplication atstransport block blockgroup cadet \
  116. core datacache dht dns dnsparser fragmentation friends hello \
  117. identity natauto natnew nse nt peerinfo peerstore regexblock regex revocation \
  118. scalarproduct set statistics transport transportaddress transportapplication \
  119. transportcommunicator transportcore transportmonitor util; do \
  120. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
  121. done )
  122. ( for plug in ats_proportional ats2_simple block_dht block_regex block_revocation transport_unix; do \
  123. $(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
  124. done )
  125. ( for lex in daemon-topology helper-nat-client \
  126. helper-nat-server service-arm service-ats service-ats-new service-cadet \
  127. service-core service-dht service-identity service-nat service-nat-auto \
  128. service-nse service-peerinfo service-peerstore service-regex \
  129. service-revocation service-scalarproduct-alice \
  130. service-scalarproduct-bob service-scalarproduct-ecc-alice \
  131. service-scalarproduct-ecc-bob service-set service-statistics \
  132. service-transport timeout; do \
  133. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
  134. done )
  135. ( for conf in arm ats cadet communicator-unix core datacache dht identity \
  136. identity-provider nat nat-auto nse peerinfo peerstore regex revocation \
  137. scalarproduct set statistics topology transport util; do \
  138. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
  139. done )
  140. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
  141. $(INSTALL_DIR) $(1)/etc/init.d
  142. $(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
  143. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  144. $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
  145. $(INSTALL_DIR) $(1)/etc/uci-defaults
  146. $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/gnunet
  147. $(INSTALL_DIR) $(1)/lib/netifd/proto
  148. $(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto/gnunet.sh
  149. endef
  150. define Build/InstallDev
  151. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  152. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  153. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  154. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  155. endef
  156. BIN_auction:=auction-create auction-info auction-join
  157. LIBEXEC_auction:=service-auction
  158. CONF_auction:=auction
  159. DEPENDS_auction:=+gnunet-reclaim +jansson
  160. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  161. BIN_conversation:=conversation conversation-test
  162. LIB_conversation:=conversation microphone speaker
  163. PLUGIN_conversation:=gnsrecord_conversation
  164. LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
  165. CONF_conversation:=conversation
  166. BIN_dht-cli:=dht-get dht-put dht-monitor
  167. PLUGIN_dht-cli:=block_test
  168. DEPENDS_curl:=+libgnurl +jansson
  169. LIB_curl:=curl
  170. DEPENDS_hostlist:=+libmicrohttpd-ssl +gnunet-curl +ca-certificates
  171. LIBEXEC_hostlist:=daemon-hostlist
  172. CONF_hostlist:=hostlist
  173. DEPENDS_transport-bluetooth:=+bluez-libs
  174. PLUGIN_transport-bluetooth:=transport_bluetooth
  175. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  176. DEPENDS_transport-http_client:=+gnunet-curl +ca-certificates
  177. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  178. DEPENDS_transport-http_server:=+libmicrohttpd-ssl
  179. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  180. PLUGIN_transport-tcp:=transport_tcp
  181. PLUGIN_transport-udp:=transport_udp
  182. PLUGIN_transport-wlan:=transport_wlan
  183. LIBEXEC_transport-wlan:=helper-transport-wlan
  184. DEPENDS_experiments:=+libglpk
  185. PLUGIN_experiments:=ats_mlp ats_ril
  186. # BIN_dv:=dv
  187. LIB_dv:=dv
  188. PLUGIN_dv:=transport_dv
  189. LIBEXEC_dv:=service-dv
  190. CONF_dv:=dv
  191. DEPENDS_fs:=+gnunet-datastore +libextractor
  192. BIN_fs:=auto-share directory download fs publish unindex search
  193. LIB_fs:=fs
  194. PLUGIN_fs:=block_fs
  195. LIBEXEC_fs:=helper-fs-publish service-fs
  196. CONF_fs:=fs
  197. DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
  198. USERID_gns:=gnunet=958:gnunetdns=452
  199. BIN_gns:=gns gns-import.sh namecache namestore resolver zoneimport
  200. LIB_gns:=gns gnsrecord namecache namestore
  201. PLUGIN_gns:=block_dns block_gns gnsrecord_conversation gnsrecord_dns gnsrecord_gns
  202. LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
  203. CONF_gns:=dns gns namecache namestore resolver zonemaster
  204. DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd-ssl
  205. LIBEXEC_namestore-fcfsd:=namestore-fcfsd
  206. DEPENDS_gns-proxy:=+gnunet-gns +gnunet-curl +libmicrohttpd-ssl
  207. LIBEXEC_gns-proxy:=gns-proxy
  208. DEPENDS_datastore:=+gnunet-gns
  209. BIN_datastore:=datastore
  210. LIB_datastore:=datastore
  211. LIBEXEC_datastore:=service-datastore
  212. CONF_datastore:=datastore
  213. DEPENDS_reclaim:=+gnunet-gns +gnunet-sqlite +libpbc +libgabe
  214. BIN_reclaim:=credential reclaim
  215. LIB_reclaim:=consensus credential abe reclaim reclaimattribute secretsharing
  216. LIBEXEC_reclaim:=service-consensus service-credential service-reclaim service-secretsharing
  217. CONF_reclaim:=consensus credential reclaim secretsharing
  218. PLUGIN_reclaim:=block_consensus gnsrecord_credential gnsrecord_reclaim reclaim_attribute_gnuid
  219. DEPENDS_rest:=+gnunet-gns +gnunet-reclaim +libmicrohttpd-ssl +jansson
  220. LIB_rest:=rest json
  221. PLUGIN_rest:=rest_copying rest_gns rest_identity rest_namestore rest_peerinfo rest_openid_connect rest_reclaim
  222. LIBEXEC_rest:=rest-server
  223. CONF_rest:=rest
  224. BIN_rps:=rps
  225. LIB_rps:=rps
  226. LIBEXEC_rps:=service-rps
  227. CONF_rps:=rps
  228. PLUGIN_dhtcache-heap:=datacache_heap
  229. CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
  230. DEPENDS_gns-flat:=+gnunet-gns
  231. PLUGIN_gns-flat:=namecache_flat namestore_flat
  232. PLUGIN_peerstore-flat:=peerstore_flat
  233. DEPENDS_fs-heap:=+gnunet-datastore
  234. PLUGIN_fs-heap:=datastore_heap
  235. CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
  236. DEPENDS_mysql:=+libmysqlclient
  237. LIB_mysql:=mysql my
  238. DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
  239. PLUGIN_fs-mysql:=datastore_mysql
  240. CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
  241. DEPENDS_pgsql:=+libpq
  242. LIB_pgsql:=pq
  243. DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
  244. PLUGIN_dhtcache-pgsql:=datacache_postgres
  245. CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
  246. DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
  247. PLUGIN_fs-pgsql:=datastore_postgres
  248. CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
  249. DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
  250. PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
  251. CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
  252. DEPENDS_sqlite:=+libsqlite3
  253. LIB_sqlite:=sq
  254. DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
  255. PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
  256. CONFLICTS_gns-sqlite:=gnunet-gns-flat
  257. DEPENDS_peerstore-sqlite:=+gnunet-sqlite
  258. PLUGIN_peerstore-sqlite:=peerstore_sqlite
  259. CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
  260. DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
  261. PLUGIN_dhtcache-sqlite:=datacache_sqlite
  262. DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
  263. PLUGIN_fs-sqlite:=datastore_sqlite
  264. DEPENDS_utils:=+certtool +openssl-util
  265. BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
  266. DEPENDS_vpn:=+kmod-tun +iptables +firewall
  267. BIN_vpn:=vpn
  268. LIB_vpn:=dnsstub tun vpn
  269. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  270. CONF_vpn:=exit pt vpn
  271. define Package/gnunet-gns/prerm
  272. #!/bin/sh
  273. uci -q batch <<EOF
  274. del network.gnunetdns
  275. del network.gndnsrtt
  276. del network.gndnsrl
  277. commit network
  278. del firewall.gnunetdns
  279. del firewall.gndnsrl
  280. del firewall.gndnsrl2
  281. commit firewall
  282. EOF
  283. endef
  284. define Package/gnunet-vpn/prerm
  285. #!/bin/sh
  286. uci -q batch <<EOF
  287. del network.gnunetvpn
  288. del network.gnunetexit
  289. commit network
  290. del firewall.gnunetvpn
  291. del firewall.gnunetexit
  292. del firewall.gnexitfwd
  293. commit firewall
  294. EOF
  295. endef
  296. define PostInstFixSUIDPerms
  297. define Package/$(1)/postinst
  298. #!/bin/sh
  299. [ -z "$IPKG_INSTROOT" ] || exit 0
  300. [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0
  301. endef
  302. endef
  303. $(eval $(call PostInstFixSUIDPerms,gnunet))
  304. $(eval $(call PostInstFixSUIDPerms,gnunet-gns))
  305. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-bluetooth))
  306. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-wlan))
  307. $(eval $(call PostInstFixSUIDPerms,gnunet-vpn))
  308. $(eval $(call BuildPackage,gnunet))
  309. $(eval $(call BuildComponent,auction,auction components,))
  310. $(eval $(call BuildComponent,conversation,conversation component,))
  311. $(eval $(call BuildComponent,curl,cURL wrapper component,))
  312. $(eval $(call BuildComponent,datastore,data storage components,))
  313. $(eval $(call BuildComponent,dht-cli,DHT command line clients,))
  314. # $(eval $(call BuildComponent,dv,distance-vector routing component,y))
  315. $(eval $(call BuildComponent,experiments,experimental components,))
  316. $(eval $(call BuildComponent,fs,file-sharing components,))
  317. $(eval $(call BuildComponent,gns,name resolution components,y))
  318. $(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
  319. $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
  320. $(eval $(call BuildComponent,reclaim,reclaim identity-provider subsystem,))
  321. $(eval $(call BuildComponent,rest,REST interface,))
  322. $(eval $(call BuildComponent,rps,RPS routing component,y))
  323. $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
  324. $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
  325. $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
  326. $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
  327. $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
  328. $(eval $(call BuildComponent,mysql,mySQL backend,))
  329. $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
  330. $(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
  331. $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
  332. $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
  333. $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
  334. $(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
  335. $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
  336. $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
  337. $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
  338. $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
  339. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  340. $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
  341. $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
  342. $(eval $(call BuildComponent,transport-tcp,TCP transport,y))
  343. $(eval $(call BuildComponent,transport-udp,UDP transport,y))
  344. $(eval $(call BuildComponent,transport-wlan,WLAN transport,y))
  345. $(eval $(call BuildComponent,utils,administration utililties,))
  346. $(eval $(call BuildComponent,vpn,vpn components,y))