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