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.

429 lines
15 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=gnunet
  3. PKG_SOURCE_VERSION:=a3dace8401c482f18bddbad37da108433c1b08c7
  4. PKG_MIRROR_HASH:=00ab1eaed040e8479a38b9bfa2a59f029d6273cb2e275b637d1c501200bbbfd9
  5. PKG_VERSION:=0.10.2-git-20171108-$(PKG_SOURCE_VERSION)
  6. PKG_RELEASE:=1
  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:=GPL-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 BuildComponent
  62. PKG_CONFIG_DEPENDS+=CONFIG_PACKAGE_$(PKG_NAME)-$(1)
  63. define Package/gnunet-$(1)
  64. $$(call Package/gnunet/Default)
  65. TITLE+= $(2)
  66. DEPENDS:=gnunet $(DEPENDS_$(1))
  67. $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
  68. $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
  69. $(if $(CONFLICTS_$(1)),CONFLICTS:=$(CONFLICTS_$(1)))
  70. endef
  71. define Package/gnunet-$(1)/install
  72. ( if [ "$(BIN_$(1))" ]; then \
  73. $(INSTALL_DIR) $$(1)/usr/bin ; \
  74. for bin in $(BIN_$(1)); do \
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
  76. done \
  77. fi )
  78. ( if [ "$(LIB_$(1))" ]; then \
  79. $(INSTALL_DIR) $$(1)/usr/lib ; \
  80. for lib in $(LIB_$(1)); do \
  81. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
  82. done \
  83. fi )
  84. ( if [ "$(PLUGIN_$(1))" ]; then \
  85. $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
  86. for plug in $(PLUGIN_$(1)); do \
  87. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
  88. done \
  89. fi )
  90. ( if [ "$(LIBEXEC_$(1))" ]; then \
  91. $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
  92. for lex in $(LIBEXEC_$(1)); do \
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
  94. done \
  95. fi )
  96. ( if [ "$(CONF_$(1))" ]; then \
  97. $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
  98. for conf in $(CONF_$(1)); do \
  99. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
  100. done \
  101. fi )
  102. ( if [ -e ./files/gnunet-$(1).defaults ]; then \
  103. $(INSTALL_DIR) $$(1)/etc/uci-defaults ; \
  104. $(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \
  105. fi )
  106. endef
  107. $$(eval $$(call BuildPackage,gnunet-$(1)))
  108. endef
  109. define Package/gnunet/install
  110. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
  111. $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
  112. ( for bin in arm ats cadet core config ecc identity nat nat-auto nat-server nse \
  113. peerinfo revocation scalarproduct statistics transport uri; do \
  114. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
  115. done )
  116. ( for lib in arm ats block blockgroup cadet core datacache dht \
  117. dns dnsparser fragmentation friends hello identity natauto natnew nse \
  118. peerinfo regexblock regex revocation scalarproduct set \
  119. statistics transport util; do \
  120. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
  121. done )
  122. ( for plug in ats_proportional block_dht block_regex block_revocation \
  123. transport_tcp transport_udp transport_unix; do \
  124. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
  125. done )
  126. ( for lex in daemon-topology helper-nat-client \
  127. helper-nat-server service-arm service-ats service-cadet \
  128. service-core service-dht service-identity service-nat service-nat-auto \
  129. service-nse service-peerinfo service-regex \
  130. service-revocation service-scalarproduct-alice \
  131. service-scalarproduct-bob service-scalarproduct-ecc-alice \
  132. service-scalarproduct-ecc-bob service-set service-statistics \
  133. service-transport; do \
  134. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
  135. done )
  136. ( for conf in arm ats cadet core datacache dht identity identity-provider \
  137. nat nat-auto nse peerinfo regex revocation scalarproduct \
  138. set statistics topology transport util; do \
  139. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
  140. done )
  141. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
  142. $(INSTALL_DIR) $(1)/etc/init.d
  143. $(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
  144. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  145. $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
  146. $(INSTALL_DIR) $(1)/etc/uci-defaults
  147. $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/gnunet
  148. $(INSTALL_DIR) $(1)/lib/netifd/proto
  149. $(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto/gnunet.sh
  150. endef
  151. define Build/InstallDev
  152. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  153. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  154. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  155. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  156. endef
  157. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  158. BIN_conversation:=conversation conversation-test
  159. LIB_conversation:=conversation microphone speaker
  160. PLUGIN_conversation:=gnsrecord_conversation
  161. LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
  162. CONF_conversation:=conversation
  163. BIN_dht-cli:=dht-get dht-put dht-monitor
  164. PLUGIN_dht-cli:=block_test
  165. DEPENDS_hostlist:=+libmicrohttpd +libgnurl +ca-certificates
  166. LIBEXEC_hostlist:=daemon-hostlist
  167. CONF_hostlist:=hostlist
  168. DEPENDS_transport-http_client:=+libgnurl +ca-certificates
  169. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  170. DEPENDS_transport-http_server:=+libmicrohttpd
  171. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  172. PLUGIN_transport-wlan:=transport_wlan
  173. LIBEXEC_transport-wlan:=helper-transport-wlan
  174. DEPENDS_experiments:=+libglpk
  175. PLUGIN_experiments:=ats_mlp ats_ril
  176. # BIN_dv:=dv
  177. LIB_dv:=dv
  178. PLUGIN_dv:=transport_dv
  179. LIBEXEC_dv:=service-dv
  180. CONF_dv:=dv
  181. DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor
  182. BIN_fs:=auto-share directory download fs publish unindex search
  183. LIB_fs:=fs
  184. PLUGIN_fs:=block_fs
  185. LIBEXEC_fs:=helper-fs-publish service-fs
  186. CONF_fs:=fs
  187. DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
  188. USERID_gns:=gnunet=958:gnunetdns=452
  189. BIN_gns:=gns gns-import.sh namecache namestore resolver
  190. LIB_gns:=gns gnsrecord namecache namestore
  191. PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity
  192. LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
  193. CONF_gns:=dns gns namecache namestore resolver zonemaster
  194. DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd
  195. LIBEXEC_namestore-fcfsd:=namestore-fcfsd
  196. DEPENDS_gns-proxy:=+gnunet-gns +libgnurl +libmicrohttpd
  197. LIBEXEC_gns-proxy:=gns-proxy
  198. DEPENDS_datastore:=+gnunet-gns
  199. BIN_datastore:=datastore
  200. LIB_datastore:=datastore
  201. LIBEXEC_datastore:=service-datastore
  202. CONF_datastore:=datastore
  203. BIN_peerstore:=peerstore
  204. LIB_peerstore:=peerstore
  205. LIBEXEC_peerstore:=service-peerstore
  206. CONF_peerstore:=peerstore
  207. DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson
  208. LIB_rest:=rest json jsonapi jsonapiutils
  209. PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore
  210. LIBEXEC_rest:=rest-server
  211. CONF_rest:=rest
  212. BIN_rps:=rps
  213. LIB_rps:=rps
  214. LIBEXEC_rps:=service-rps
  215. CONF_rps:=rps
  216. DEPENDS_social:=+gnunet-gns +libmicrohttpd +jansson
  217. BIN_social:=identity-token multicast social
  218. LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social
  219. LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social
  220. CONF_social:=consensus multicast psyc psycstore secretsharing social
  221. PLUGINS_social:=block_consensus
  222. PLUGIN_dhtcache-heap:=datacache_heap
  223. CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
  224. DEPENDS_gns-flat:=+gnunet-gns
  225. PLUGIN_gns-flat:=namecache_flat namestore_flat
  226. DEPENDS_peerstore-flat:=+gnunet-peerstore
  227. PLUGIN_peerstore-flat:=peerstore_flat
  228. DEPENDS_fs-heap:=+gnunet-datastore
  229. PLUGIN_fs-heap:=datastore_heap
  230. CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
  231. DEPENDS_mysql:=+libmysqlclient
  232. LIB_mysql:=mysql my
  233. DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social
  234. PLUGIN_social-mysql:=psycstore_mysql
  235. CONFLICTS_social-mysql:=gnunet-social-sqlite
  236. DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
  237. PLUGIN_fs-mysql:=datastore_mysql
  238. CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
  239. DEPENDS_pgsql:=+libpq
  240. LIB_pgsql:=pq
  241. DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
  242. PLUGIN_dhtcache-pgsql:=datacache_postgres
  243. CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
  244. DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
  245. PLUGIN_fs-pgsql:=datastore_postgres
  246. CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
  247. DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
  248. PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
  249. CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
  250. DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
  251. PLUGIN_social-pgsql:=psycstore_postgres
  252. CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
  253. DEPENDS_sqlite:=+libsqlite3
  254. LIB_sqlite:=sq
  255. DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
  256. PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
  257. CONFLICTS_gns-sqlite:=gnunet-gns-flat
  258. DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite
  259. PLUGIN_peerstore-sqlite:=peerstore_sqlite
  260. CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
  261. DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
  262. PLUGIN_dhtcache-sqlite:=datacache_sqlite
  263. DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
  264. PLUGIN_fs-sqlite:=datastore_sqlite
  265. DEPENDS_social-sqlite:=+gnunet-social +gnunet-sqlite
  266. PLUGIN_social-sqlite:=psycstore_sqlite
  267. DEPENDS_transport-bluetooth:=+bluez-libs
  268. PLUGIN_transport-bluetooth:=transport_bluetooth
  269. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  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,datastore,data storage components,))
  317. $(eval $(call BuildComponent,dht-cli,DHT command line clients,))
  318. # $(eval $(call BuildComponent,dv,distance-vector routing component,y))
  319. $(eval $(call BuildComponent,experiments,experimental components,))
  320. $(eval $(call BuildComponent,fs,file-sharing components,))
  321. $(eval $(call BuildComponent,gns,name resolution components,y))
  322. $(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
  323. $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
  324. $(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
  325. $(eval $(call BuildComponent,rest,REST interface,))
  326. $(eval $(call BuildComponent,rps,RPS routing component,y))
  327. $(eval $(call BuildComponent,social,social components,))
  328. $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
  329. $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
  330. $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
  331. $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
  332. $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
  333. $(eval $(call BuildComponent,mysql,mySQL backend,))
  334. $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
  335. $(eval $(call BuildComponent,social-mysql,mySQL social 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,social-pgsql,PostgreSQL social plugin,))
  341. $(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
  342. $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
  343. $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
  344. $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
  345. $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
  346. $(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,))
  347. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  348. $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
  349. $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
  350. $(eval $(call BuildComponent,transport-wlan,WLAN transport,y))
  351. $(eval $(call BuildComponent,utils,administration utililties,))
  352. $(eval $(call BuildComponent,vpn,vpn components,y))