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.

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