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.

424 lines
15 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gnunet
  3. PKG_VERSION:=0.11.8
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=@GNU/gnunet
  7. PKG_HASH:=d21f1b7a5e0c3e1ddf062c87a302db9abb43574bb7bf8c9e8f233b5d0e6675fe
  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. define Package/gnunet/Default
  38. SECTION:=net
  39. CATEGORY:=Network
  40. TITLE:=GNUnet
  41. URL:=https://www.gnunet.org/
  42. endef
  43. define Package/gnunet
  44. $(call Package/gnunet/Default)
  45. TITLE+= - a peer-to-peer framework focusing on security
  46. DEPENDS:=+libatomic +libgcrypt +libgpg-error +libidn2 +libltdl +libunistring \
  47. +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
  48. USERID:=gnunet=958:gnunet=958
  49. MENU:=1
  50. endef
  51. define Package/gnunet/description
  52. GNUnet is a peer-to-peer framework focusing on security. The first and
  53. primary application for GNUnet is anonymous file-sharing. GNUnet is
  54. currently developed by a worldwide group of independent free software
  55. developers. GNUnet is a GNU package (http://www.gnu.org/).
  56. This is an ALPHA release. There are known and significant bugs as
  57. well as many missing features in this release.
  58. This package provides the core components of GNUnet including the
  59. CADET routing engine, a DHT implementation and basic transports as
  60. well as their helpers.
  61. endef
  62. define BuildComponent
  63. PKG_CONFIG_DEPENDS+=CONFIG_PACKAGE_$(PKG_NAME)-$(1)
  64. define Package/gnunet-$(1)
  65. $$(call Package/gnunet/Default)
  66. TITLE+= $(2)
  67. DEPENDS:=gnunet $(DEPENDS_$(1))
  68. $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
  69. $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
  70. $(if $(CONFLICTS_$(1)),CONFLICTS:=$(CONFLICTS_$(1)))
  71. endef
  72. define Package/gnunet-$(1)/install
  73. ( if [ "$(BIN_$(1))" ]; then \
  74. $(INSTALL_DIR) $$(1)/usr/bin ; \
  75. for bin in $(BIN_$(1)); do \
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
  77. done \
  78. fi )
  79. ( if [ "$(LIB_$(1))" ]; then \
  80. $(INSTALL_DIR) $$(1)/usr/lib ; \
  81. for lib in $(LIB_$(1)); do \
  82. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
  83. done \
  84. fi )
  85. ( if [ "$(PLUGIN_$(1))" ]; then \
  86. $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
  87. for plug in $(PLUGIN_$(1)); do \
  88. $(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
  89. done \
  90. fi )
  91. ( if [ "$(LIBEXEC_$(1))" ]; then \
  92. $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
  93. for lex in $(LIBEXEC_$(1)); do \
  94. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
  95. done \
  96. fi )
  97. ( if [ "$(CONF_$(1))" ]; then \
  98. $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
  99. for conf in $(CONF_$(1)); do \
  100. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
  101. done \
  102. fi )
  103. ( if [ -e ./files/gnunet-$(1).defaults ]; then \
  104. $(INSTALL_DIR) $$(1)/etc/uci-defaults ; \
  105. $(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \
  106. fi )
  107. endef
  108. $$(eval $$(call BuildPackage,gnunet-$(1)))
  109. endef
  110. define Package/gnunet/install
  111. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
  112. $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
  113. ( for bin in arm ats ats-new cadet core config ecc identity nat nat-auto nat-server nse \
  114. peerinfo peerstore revocation scalarproduct scrypt statistics transport uri; do \
  115. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
  116. done )
  117. ( for lib in arm ats atsapplication atstransport block blockgroup cadet \
  118. core datacache dht dns dnsparser fragmentation friends hello \
  119. identity natauto natnew nse nt peerinfo peerstore regexblock regex revocation \
  120. scalarproduct set statistics transport transportaddress transportapplication \
  121. transportcommunicator transportcore transportmonitor util; do \
  122. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
  123. done )
  124. ( for plug in ats_proportional ats2_simple block_dht block_regex block_revocation transport_unix; do \
  125. $(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
  126. done )
  127. ( for lex in daemon-topology helper-nat-client \
  128. helper-nat-server service-arm service-ats service-ats-new service-cadet \
  129. service-core service-dht service-identity service-nat service-nat-auto \
  130. service-nse service-peerinfo service-peerstore service-regex \
  131. service-revocation service-scalarproduct-alice \
  132. service-scalarproduct-bob service-scalarproduct-ecc-alice \
  133. service-scalarproduct-ecc-bob service-set service-statistics \
  134. service-transport timeout; do \
  135. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
  136. done )
  137. ( for conf in arm ats cadet communicator-unix core datacache dht identity \
  138. identity-provider nat nat-auto nse peerinfo peerstore regex revocation \
  139. scalarproduct set statistics topology transport util; do \
  140. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
  141. done )
  142. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
  143. $(INSTALL_DIR) $(1)/etc/init.d
  144. $(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
  145. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  146. $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
  147. $(INSTALL_DIR) $(1)/etc/uci-defaults
  148. $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/gnunet
  149. $(INSTALL_DIR) $(1)/lib/netifd/proto
  150. $(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto/gnunet.sh
  151. endef
  152. define Build/InstallDev
  153. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  155. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  156. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  157. endef
  158. BIN_auction:=auction-create auction-info auction-join
  159. LIBEXEC_auction:=service-auction
  160. CONF_auction:=auction
  161. DEPENDS_auction:=+gnunet-reclaim +jansson
  162. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  163. BIN_conversation:=conversation conversation-test
  164. LIB_conversation:=conversation microphone speaker
  165. PLUGIN_conversation:=gnsrecord_conversation
  166. LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
  167. CONF_conversation:=conversation
  168. BIN_dht-cli:=dht-get dht-put dht-monitor
  169. PLUGIN_dht-cli:=block_test
  170. DEPENDS_curl:=+libgnurl +jansson
  171. LIB_curl:=curl
  172. DEPENDS_hostlist:=+libmicrohttpd-ssl +gnunet-curl +ca-certificates
  173. LIBEXEC_hostlist:=daemon-hostlist
  174. CONF_hostlist:=hostlist
  175. DEPENDS_transport-bluetooth:=+bluez-libs
  176. PLUGIN_transport-bluetooth:=transport_bluetooth
  177. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  178. DEPENDS_transport-http_client:=+gnunet-curl +ca-certificates
  179. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  180. DEPENDS_transport-http_server:=+libmicrohttpd-ssl
  181. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  182. PLUGIN_transport-tcp:=transport_tcp
  183. PLUGIN_transport-udp:=transport_udp
  184. PLUGIN_transport-wlan:=transport_wlan
  185. LIBEXEC_transport-wlan:=helper-transport-wlan
  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,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))