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_SOURCE_VERSION:=e29410cee115f099f093605692ec94614fbbe6d9
  4. PKG_MIRROR_HASH:=b397c73c6cb8da852d2198469d04a8e0f6e61dcd0adead24634e7c57e2c952af
  5. PKG_VERSION:=0.10.2-git-20170624-$(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. --disable-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 \
  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. DEPENDS_hostlist:=+libmicrohttpd +libgnurl +ca-certificates
  165. LIBEXEC_hostlist:=daemon-hostlist
  166. CONF_hostlist:=hostlist
  167. DEPENDS_transport-http_client:=+libgnurl +ca-certificates
  168. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  169. DEPENDS_transport-http_server:=+libmicrohttpd
  170. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  171. PLUGIN_transport-wlan:=transport_wlan
  172. LIBEXEC_transport-wlan:=helper-transport-wlan
  173. DEPENDS_experiments:=+libglpk
  174. PLUGIN_experiments:=ats_mlp ats_ril
  175. # BIN_dv:=dv
  176. LIB_dv:=dv
  177. PLUGIN_dv:=transport_dv
  178. LIBEXEC_dv:=service-dv
  179. CONF_dv:=dv
  180. DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor
  181. BIN_fs:=auto-share directory download fs publish unindex search
  182. LIB_fs:=fs
  183. PLUGIN_fs:=block_fs
  184. LIBEXEC_fs:=helper-fs-publish service-fs
  185. CONF_fs:=fs
  186. DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
  187. USERID_gns:=gnunet=958:gnunetdns=452
  188. BIN_gns:=gns gns-import.sh namecache namestore resolver
  189. LIB_gns:=gns gnsrecord namecache namestore
  190. PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity
  191. LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
  192. CONF_gns:=dns gns namecache namestore resolver zonemaster
  193. DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd
  194. LIBEXEC_namestore-fcfsd:=namestore-fcfsd
  195. DEPENDS_gns-proxy:=+gnunet-gns +libgnurl +libmicrohttpd
  196. LIBEXEC_gns-proxy:=gns-proxy
  197. DEPENDS_datastore:=+gnunet-gns
  198. BIN_datastore:=datastore
  199. LIB_datastore:=datastore
  200. LIBEXEC_datastore:=service-datastore
  201. CONF_datastore:=datastore
  202. BIN_peerstore:=peerstore
  203. LIB_peerstore:=peerstore
  204. LIBEXEC_peerstore:=service-peerstore
  205. CONF_peerstore:=peerstore
  206. DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson
  207. LIB_rest:=rest json jsonapi jsonapiutils
  208. PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore
  209. LIBEXEC_rest:=rest-server
  210. CONF_rest:=rest
  211. BIN_rps:=rps
  212. LIB_rps:=rps
  213. LIBEXEC_rps:=service-rps
  214. CONF_rps:=rps
  215. DEPENDS_social:=+gnunet-gns +libmicrohttpd +jansson
  216. BIN_social:=identity-token multicast social
  217. LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social
  218. LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social
  219. CONF_social:=consensus multicast psyc psycstore secretsharing social
  220. PLUGIN_dhtcache-heap:=datacache_heap
  221. CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
  222. DEPENDS_gns-flat:=+gnunet-gns
  223. PLUGIN_gns-flat:=namecache_flat namestore_flat
  224. DEPENDS_peerstore-flat:=+gnunet-peerstore
  225. PLUGIN_peerstore-flat:=peerstore_flat
  226. DEPENDS_fs-heap:=+gnunet-datastore
  227. PLUGIN_fs-heap:=datastore_heap
  228. CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
  229. DEPENDS_mysql:=+libmysqlclient
  230. LIB_mysql:=mysql my
  231. DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social
  232. PLUGIN_social-mysql:=psycstore_mysql
  233. CONFLICTS_social-mysql:=gnunet-social-sqlite
  234. DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
  235. PLUGIN_fs-mysql:=datastore_mysql
  236. CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
  237. DEPENDS_pgsql:=+libpq
  238. LIB_pgsql:=pq
  239. DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
  240. PLUGIN_dhtcache-pgsql:=datacache_postgres
  241. CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
  242. DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
  243. PLUGIN_fs-pgsql:=datastore_postgres
  244. CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
  245. DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
  246. PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
  247. CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
  248. DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
  249. PLUGIN_social-pgsql:=psycstore_postgres
  250. CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
  251. DEPENDS_sqlite:=+libsqlite3
  252. LIB_sqlite:=sq
  253. DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
  254. PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
  255. CONFLICTS_gns-sqlite:=gnunet-gns-flat
  256. DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite
  257. PLUGIN_peerstore-sqlite:=peerstore_sqlite
  258. CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
  259. DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
  260. PLUGIN_dhtcache-sqlite:=datacache_sqlite
  261. DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
  262. PLUGIN_fs-sqlite:=datastore_sqlite
  263. DEPENDS_social-sqlite:=+gnunet-social +gnunet-sqlite
  264. PLUGIN_social-sqlite:=psycstore_sqlite
  265. DEPENDS_transport-bluetooth:=+bluez-libs
  266. PLUGIN_transport-bluetooth:=transport_bluetooth
  267. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  268. DEPENDS_utils:=+certtool +openssl-util
  269. BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
  270. DEPENDS_vpn:=+kmod-tun +iptables +firewall
  271. BIN_vpn:=vpn
  272. LIB_vpn:=dnsstub tun vpn
  273. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  274. CONF_vpn:=exit pt vpn
  275. define Package/gnunet-gns/prerm
  276. #!/bin/sh
  277. uci -q batch <<EOF
  278. del network.gnunetdns
  279. del network.gndnsrtt
  280. del network.gndnsrl
  281. commit network
  282. del firewall.gnunetdns
  283. del firewall.gndnsrl
  284. del firewall.gndnsrl2
  285. commit firewall
  286. EOF
  287. endef
  288. define Package/gnunet-vpn/prerm
  289. #!/bin/sh
  290. uci -q batch <<EOF
  291. del network.gnunetvpn
  292. del network.gnunetexit
  293. commit network
  294. del firewall.gnunetvpn
  295. del firewall.gnunetexit
  296. del firewall.gnexitfwd
  297. commit firewall
  298. EOF
  299. endef
  300. define PostInstFixSUIDPerms
  301. define Package/$(1)/postinst
  302. #!/bin/sh
  303. [ -z "$IPKG_INSTROOT" ] || exit 0
  304. [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0
  305. endef
  306. endef
  307. $(eval $(call PostInstFixSUIDPerms,gnunet))
  308. $(eval $(call PostInstFixSUIDPerms,gnunet-gns))
  309. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-bluetooth))
  310. $(eval $(call PostInstFixSUIDPerms,gnunet-transport-wlan))
  311. $(eval $(call PostInstFixSUIDPerms,gnunet-vpn))
  312. $(eval $(call BuildPackage,gnunet))
  313. $(eval $(call BuildComponent,conversation,conversation 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,experiments,experimental components,))
  318. $(eval $(call BuildComponent,fs,file-sharing components,))
  319. $(eval $(call BuildComponent,gns,name resolution components,y))
  320. $(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
  321. $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
  322. $(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
  323. $(eval $(call BuildComponent,rest,REST interface,))
  324. $(eval $(call BuildComponent,rps,RPS routing component,y))
  325. $(eval $(call BuildComponent,social,social components,))
  326. $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
  327. $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
  328. $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
  329. $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
  330. $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
  331. $(eval $(call BuildComponent,mysql,mySQL backend,))
  332. $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
  333. $(eval $(call BuildComponent,social-mysql,mySQL social plugins,))
  334. $(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
  335. $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
  336. $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
  337. $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
  338. $(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
  339. $(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
  340. $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
  341. $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
  342. $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
  343. $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
  344. $(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,))
  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-wlan,WLAN transport,y))
  349. $(eval $(call BuildComponent,utils,administration utililties,))
  350. $(eval $(call BuildComponent,vpn,vpn components,y))