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.

427 lines
15 KiB

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