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.

247 lines
9.1 KiB

  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=gnunet
  9. PKG_SOURCE_VERSION:=36019
  10. PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
  11. PKG_RELEASE:=1
  12. # ToDo:
  13. # - break-out transports
  14. # -> get rid of microhttpd and gnurl dependency for gns and vpn
  15. # requires upstream to split config files
  16. # - break-out {peer,name,data}store for each backend
  17. # - package testing stuff
  18. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  19. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  20. PKG_SOURCE_URL:=https://gnunet.org/svn/gnunet/
  21. PKG_SOURCE_PROTO:=svn
  22. PKG_LICENSE:=GPL-3.0
  23. PKG_LICENSE_FILES:=COPYING
  24. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  25. PKG_BUILD_PARALLEL:=1
  26. PKG_FIXUP:=autoreconf
  27. PKG_INSTALL:=1
  28. include $(INCLUDE_DIR)/package.mk
  29. CONFIGURE_ARGS+= \
  30. --with-ltdl \
  31. $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
  32. $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
  33. $(if $(CONFIG_PACKAGE_$(PKG_NAME)-sqlite),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
  34. --with-extractor=$(STAGING_DIR)/usr \
  35. --with-gnutls=$(STAGING_DIR)/usr \
  36. --with-libgnurl=$(STAGING_DIR)/usr \
  37. --with-libunistring-prefix=$(STAGING_DIR)/usr \
  38. --with-microhttpd=$(STAGING_DIR)/usr
  39. # ToDo: request upstream to provide --with-pulseaudio=...
  40. TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
  41. define Package/gnunet/Default
  42. SECTION:=net
  43. CATEGORY:=Network
  44. TITLE:=GNUnet
  45. URL:=https://www.gnunet.org/
  46. endef
  47. define Package/gnunet
  48. $(call Package/gnunet/Default)
  49. TITLE+= - a peer-to-peer framework focusing on security
  50. DEPENDS:=+ca-certificates +libgnurl +libgnutls +libidn +libltdl \
  51. +libmicrohttpd +libunistring +librt
  52. USERID:=gnunet=400:gnunet=400
  53. MENU:=1
  54. endef
  55. define Package/gnunet/description
  56. GNUnet is a peer-to-peer framework focusing on security. The first and
  57. primary application for GNUnet is anonymous file-sharing. GNUnet is
  58. currently developed by a worldwide group of independent free software
  59. developers. GNUnet is a GNU package (http://www.gnu.org/).
  60. This is an ALPHA release. There are known and significant bugs as
  61. well as many missing features in this release.
  62. This package provides the core components of GNUnet including the
  63. CADET routing engine, a DHT implementation and most transports as well
  64. as their helpers.
  65. endef
  66. define BuildComponent
  67. define Package/gnunet-$(1)
  68. $$(call Package/gnunet/Default)
  69. TITLE+= $(2)
  70. DEPENDS:=gnunet $(DEPENDS_$(1))
  71. $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
  72. $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
  73. endef
  74. define Package/gnunet-$(1)/install
  75. ( if [ "$(BIN_$(1))" ]; then \
  76. $(INSTALL_DIR) $$(1)/usr/bin ; \
  77. for bin in $(BIN_$(1)); do \
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
  79. done \
  80. fi )
  81. ( if [ "$(LIB_$(1))" ]; then \
  82. $(INSTALL_DIR) $$(1)/usr/lib ; \
  83. for lib in $(LIB_$(1)); do \
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
  85. done \
  86. fi )
  87. ( if [ "$(PLUGIN_$(1))" ]; then \
  88. $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
  89. for plug in $(PLUGIN_$(1)); do \
  90. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
  91. done \
  92. fi )
  93. ( if [ "$(LIBEXEC_$(1))" ]; then \
  94. $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
  95. for lex in $(LIBEXEC_$(1)); do \
  96. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
  97. done \
  98. fi )
  99. ( if [ "$(CONF_$(1))" ]; then \
  100. $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
  101. for conf in $(CONF_$(1)); do \
  102. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
  103. done \
  104. fi )
  105. endef
  106. $$(eval $$(call BuildPackage,gnunet-$(1)))
  107. endef
  108. define Package/gnunet/install
  109. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
  110. $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
  111. ( for bin in arm ats core config ecc identity nat-server nse \
  112. peerinfo peerstore revocation scalarproduct statistics transport uri; do \
  113. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
  114. done )
  115. ( for lib in arm ats block cadet core datacache dht \
  116. dns dnsparser dnsstub fragmentation friends hello identity nat nse \
  117. peerinfo peerstore regexblock regex revocation scalarproduct set \
  118. statistics transport util; do \
  119. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
  120. done )
  121. ( for plug in ats_proportional block_dht block_regex datacache_heap \
  122. transport_http_client transport_http_server \
  123. transport_https_client transport_https_server \
  124. transport_tcp transport_udp transport_unix transport_wlan; do \
  125. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
  126. done )
  127. ( for lex in daemon-hostlist daemon-topology helper-nat-client \
  128. helper-nat-server service-arm service-ats service-cadet \
  129. service-core service-dht service-identity service-nse \
  130. service-peerinfo service-peerstore service-regex \
  131. service-revocation service-scalarproduct-alice \
  132. service-scalarproduct-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 hostlist identity \
  137. nat nse peerinfo peerstore 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. endef
  145. define Build/InstallDev
  146. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  147. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  148. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  149. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  150. endef
  151. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  152. BIN_conversation:=conversation conversation-test
  153. LIB_conversation:=conversation microphone speaker
  154. PLUGIN_conversation:=gnsrecord_conversation
  155. LIBEXEC_conversation:=helper-audio-playback helper-audio-record
  156. CONF_conversation:=conversation
  157. DEPENDS_experiments:=+libglpk
  158. PLUGIN_experiments:=ats_mlp ats_ril
  159. DEPENDS_fs:=+gnunet-datastore +libextractor
  160. BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
  161. LIB_fs:=fs
  162. PLUGIN_fs:=block_fs
  163. LIB_EXEC_fs:=helper-fs-publish service-fs
  164. CONF_fs:=fs
  165. DEPENDS_gns:=+gnunet-vpn
  166. USERID_gns:=gnunetdns=401:gnunetdns=401
  167. BIN_gns:=gns gns-import.sh namecache namestore resolver
  168. LIB_gns:=gns gnsrecord namecache namestore
  169. PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns
  170. LIBEXEC_gns:=dns2gns gns-proxy helper-dns namestore-fcfsd service-dns service-gns service-namecache service-namestore service-resolver
  171. CONF_gns:=dns gns namecache namestore resolver
  172. DEPENDS_datastore:=+gnunet-gns +libsqlite3
  173. BIN_datastore:=datastore
  174. LIB_datastore:=datastore
  175. PLUGIN_datastore:=datacache_sqlite datastore_heap datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
  176. LIBEXEC_datastore:=daemon-latency-logger service-datastore
  177. CONF_datastore:=datastore
  178. DEPENDS_mysql:=+gnunet-gns +gnunet-datastore +libmysqlclient
  179. LIB_mysql:=mysql
  180. PLUGIN_mysql:=datastore_mysql
  181. DEPENDS_pgsql:=+gnunet-gns +gnunet-datastore +libpq
  182. LIB_pgsql:=postgres
  183. PLUGIN_pgsql:=datacache_postgres datastore_postgres namecache_postgres namestore_postgres
  184. DEPENDS_sqlite:=+gnunet-gns +gnunet-datastore +libsqlite3
  185. PLUGIN_sqlite:=datacache_sqlite datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
  186. DEPENDS_transport-bluetooth:=+bluez-libs
  187. PLUGIN_transport-bluetooth:=transport_bluetooth
  188. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  189. DEPENDS_utils:=+certtool +openssl-util
  190. BIN_utils:=config gns-import.sh gns-proxy-setup-ca transport-certificate-creation
  191. DEPENDS_vpn:=+kmod-tun
  192. LIB_vpn:=tun vpn
  193. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  194. CONF_vpn:=exit pt vpn
  195. $(eval $(call BuildPackage,gnunet))
  196. $(eval $(call BuildComponent,conversation,conversation component,))
  197. $(eval $(call BuildComponent,experiments,experimental components,))
  198. $(eval $(call BuildComponent,fs,file-sharing components,))
  199. $(eval $(call BuildComponent,gns,name resolution components,y))
  200. $(eval $(call BuildComponent,datastore,storage components,))
  201. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  202. $(eval $(call BuildComponent,utils,administration utililties,))
  203. $(eval $(call BuildComponent,vpn,vpn components,y))
  204. $(eval $(call BuildComponent,mysql,mySQL datastore backend,))
  205. $(eval $(call BuildComponent,pgsql,PostgreSQL backends,))
  206. $(eval $(call BuildComponent,sqlite,libsqlite3 backends,y))