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.

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