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.

437 lines
15 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gnunet
  3. PKG_VERSION:=0.11.0
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=@GNU/gnunet
  7. PKG_HASH:=b7477a3c3b0d5e8a013685dc208cfb4ccee4145f8668faa8eb5b382af36c7e9a
  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. $(INSTALL_BIN) $(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 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 regexblock regex revocation \
  117. scalarproduct set statistics transport transportaddress \
  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 block_dht block_regex block_revocation transport_unix; do \
  122. $(INSTALL_BIN) $(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-cadet \
  126. service-core service-dht service-identity service-nat service-nat-auto \
  127. service-nse service-peerinfo 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 core datacache dht identity identity-provider \
  135. nat nat-auto nse peerinfo regex revocation scalarproduct \
  136. 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. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  156. BIN_conversation:=conversation conversation-test
  157. LIB_conversation:=conversation microphone speaker
  158. PLUGIN_conversation:=gnsrecord_conversation
  159. LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
  160. CONF_conversation:=conversation
  161. BIN_dht-cli:=dht-get dht-put dht-monitor
  162. PLUGIN_dht-cli:=block_test
  163. DEPENDS_curl:=+libgnurl +jansson
  164. LIB_curl:=curl
  165. DEPENDS_hostlist:=+libmicrohttpd-ssl +gnunet-curl +ca-certificates
  166. LIBEXEC_hostlist:=daemon-hostlist
  167. CONF_hostlist:=hostlist
  168. DEPENDS_transport-bluetooth:=+bluez-libs
  169. PLUGIN_transport-bluetooth:=transport_bluetooth
  170. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  171. DEPENDS_transport-http_client:=+gnunet-curl +ca-certificates
  172. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  173. DEPENDS_transport-http_server:=+libmicrohttpd-ssl
  174. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  175. PLUGIN_transport-tcp:=transport_tcp
  176. PLUGIN_transport-udp:=transport_udp
  177. PLUGIN_transport-wlan:=transport_wlan
  178. LIBEXEC_transport-wlan:=helper-transport-wlan
  179. PLUGIN_transport-xt:=transport_xt
  180. PLUGIN_transport-xu:=transport_xu
  181. DEPENDS_experiments:=+libglpk
  182. PLUGIN_experiments:=ats_mlp ats_ril
  183. # BIN_dv:=dv
  184. LIB_dv:=dv
  185. PLUGIN_dv:=transport_dv
  186. LIBEXEC_dv:=service-dv
  187. CONF_dv:=dv
  188. DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor
  189. BIN_fs:=auto-share directory download fs publish unindex search
  190. LIB_fs:=fs
  191. PLUGIN_fs:=block_fs
  192. LIBEXEC_fs:=helper-fs-publish service-fs
  193. CONF_fs:=fs
  194. DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
  195. USERID_gns:=gnunet=958:gnunetdns=452
  196. BIN_gns:=gns gns-import.sh namecache namestore resolver zoneimport
  197. LIB_gns:=gns gnsrecord namecache namestore
  198. PLUGIN_gns:=block_dns block_gns gnsrecord_conversation gnsrecord_dns gnsrecord_gns
  199. LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
  200. CONF_gns:=dns gns namecache namestore resolver zonemaster
  201. DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd-ssl
  202. LIBEXEC_namestore-fcfsd:=namestore-fcfsd
  203. DEPENDS_gns-proxy:=+gnunet-gns +gnunet-curl +libmicrohttpd-ssl
  204. LIBEXEC_gns-proxy:=gns-proxy
  205. DEPENDS_datastore:=+gnunet-gns
  206. BIN_datastore:=datastore
  207. LIB_datastore:=datastore
  208. LIBEXEC_datastore:=service-datastore
  209. CONF_datastore:=datastore
  210. BIN_peerstore:=peerstore
  211. LIB_peerstore:=peerstore
  212. LIBEXEC_peerstore:=service-peerstore
  213. CONF_peerstore:=peerstore
  214. DEPENDS_auction:=+gnunet-reclaim
  215. BIN_auction:=auction-create auction-info auction-join
  216. LIBEXEC_auction:=service-auction
  217. CONF_auction:=auction
  218. DEPENDS_reclaim:=+gnunet-gns +gnunet-sqlite +libpbc +libgabe
  219. BIN_reclaim:=credential reclaim
  220. LIB_reclaim:=consensus credential abe reclaim reclaimattribute secretsharing
  221. LIBEXEC_reclaim:=service-consensus service-credential service-reclaim service-secretsharing
  222. CONF_reclaim:=consensus reclaim secretsharing
  223. PLUGIN_reclaim:=block_consensus gnsrecord_credential gnsrecord_reclaim reclaim_attribute_gnuid reclaim_sqlite
  224. DEPENDS_rest:=+gnunet-gns +gnunet-reclaim +libmicrohttpd-ssl +jansson
  225. LIB_rest:=rest json
  226. PLUGIN_rest:=rest_copying rest_gns rest_identity rest_namestore rest_peerinfo rest_openid_connect rest_reclaim
  227. LIBEXEC_rest:=rest-server
  228. CONF_rest:=rest
  229. BIN_rps:=rps
  230. LIB_rps:=rps
  231. LIBEXEC_rps:=service-rps
  232. CONF_rps:=rps
  233. PLUGIN_dhtcache-heap:=datacache_heap
  234. CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
  235. DEPENDS_gns-flat:=+gnunet-gns
  236. PLUGIN_gns-flat:=namecache_flat namestore_heap
  237. DEPENDS_peerstore-flat:=+gnunet-peerstore
  238. PLUGIN_peerstore-flat:=peerstore_flat
  239. DEPENDS_fs-heap:=+gnunet-datastore
  240. PLUGIN_fs-heap:=datastore_heap
  241. CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
  242. DEPENDS_mysql:=+libmysqlclient
  243. LIB_mysql:=mysql my
  244. DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
  245. PLUGIN_fs-mysql:=datastore_mysql
  246. CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
  247. DEPENDS_pgsql:=+libpq
  248. LIB_pgsql:=pq
  249. DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
  250. PLUGIN_dhtcache-pgsql:=datacache_postgres
  251. CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
  252. DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
  253. PLUGIN_fs-pgsql:=datastore_postgres
  254. CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
  255. DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
  256. PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
  257. CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
  258. DEPENDS_sqlite:=+libsqlite3
  259. LIB_sqlite:=sq
  260. DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
  261. PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
  262. CONFLICTS_gns-sqlite:=gnunet-gns-flat
  263. DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite
  264. PLUGIN_peerstore-sqlite:=peerstore_sqlite
  265. CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
  266. DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
  267. PLUGIN_dhtcache-sqlite:=datacache_sqlite
  268. DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
  269. PLUGIN_fs-sqlite:=datastore_sqlite
  270. DEPENDS_utils:=+certtool +openssl-util
  271. BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
  272. DEPENDS_vpn:=+kmod-tun +iptables +firewall
  273. BIN_vpn:=vpn
  274. LIB_vpn:=dnsstub tun vpn
  275. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  276. CONF_vpn:=exit pt vpn
  277. define Package/gnunet-gns/prerm
  278. #!/bin/sh
  279. uci -q batch <<EOF
  280. del network.gnunetdns
  281. del network.gndnsrtt
  282. del network.gndnsrl
  283. commit network
  284. del firewall.gnunetdns
  285. del firewall.gndnsrl
  286. del firewall.gndnsrl2
  287. commit firewall
  288. EOF
  289. endef
  290. define Package/gnunet-vpn/prerm
  291. #!/bin/sh
  292. uci -q batch <<EOF
  293. del network.gnunetvpn
  294. del network.gnunetexit
  295. commit network
  296. del firewall.gnunetvpn
  297. del firewall.gnunetexit
  298. del firewall.gnexitfwd
  299. commit firewall
  300. EOF
  301. endef
  302. define PostInstFixSUIDPerms
  303. define Package/$(1)/postinst
  304. #!/bin/sh
  305. [ -z "$IPKG_INSTROOT" ] || exit 0
  306. [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0
  307. endef
  308. endef
  309. $(eval $(call PostInstFixSUIDPerms,gnunet))
  310. $(eval $(call PostInstFixSUIDPerms,gnunet-gns))
  311. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-bluetooth))
  312. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-wlan))
  313. $(eval $(call PostInstFixSUIDPerms,gnunet-vpn))
  314. $(eval $(call BuildPackage,gnunet))
  315. $(eval $(call BuildComponent,conversation,conversation component,))
  316. $(eval $(call BuildComponent,curl,cURL wrapper component,))
  317. $(eval $(call BuildComponent,datastore,data storage components,))
  318. $(eval $(call BuildComponent,dht-cli,DHT command line clients,))
  319. # $(eval $(call BuildComponent,dv,distance-vector routing component,y))
  320. $(eval $(call BuildComponent,experiments,experimental components,))
  321. $(eval $(call BuildComponent,fs,file-sharing components,))
  322. $(eval $(call BuildComponent,gns,name resolution components,y))
  323. $(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
  324. $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
  325. $(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
  326. $(eval $(call BuildComponent,reclaim,reclaim identity-provider subsystem,))
  327. $(eval $(call BuildComponent,rest,REST interface,))
  328. $(eval $(call BuildComponent,rps,RPS routing component,y))
  329. $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
  330. $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
  331. $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
  332. $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
  333. $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
  334. $(eval $(call BuildComponent,mysql,mySQL backend,))
  335. $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
  336. $(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
  337. $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
  338. $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
  339. $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
  340. $(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
  341. $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
  342. $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
  343. $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
  344. $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
  345. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  346. $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
  347. $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
  348. $(eval $(call BuildComponent,transport-tcp,TCP transport,y))
  349. $(eval $(call BuildComponent,transport-udp,UDP transport,y))
  350. $(eval $(call BuildComponent,transport-wlan,WLAN transport,y))
  351. $(eval $(call BuildComponent,transport-xt,xt transport,))
  352. $(eval $(call BuildComponent,transport-xu,xu transport,))
  353. $(eval $(call BuildComponent,utils,administration utililties,))
  354. $(eval $(call BuildComponent,vpn,vpn components,y))