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