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.

436 lines
16 KiB

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