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.

234 lines
8.2 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:=35933
  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
  17. # - building and package mysql or postgresql storage backends
  18. # - package testing stuff
  19. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  20. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  21. PKG_SOURCE_URL:=https://gnunet.org/svn/gnunet/
  22. PKG_SOURCE_PROTO:=svn
  23. PKG_LICENSE:=GPL-3.0
  24. PKG_LICENSE_FILES:=COPYING
  25. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  26. PKG_BUILD_PARALLEL:=1
  27. PKG_FIXUP:=autoreconf
  28. PKG_INSTALL:=1
  29. include $(INCLUDE_DIR)/package.mk
  30. CONFIGURE_ARGS+= \
  31. --disable-rpath \
  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-ltdl \
  37. --with-microhttpd=$(STAGING_DIR)/usr \
  38. --without-mysql \
  39. --without-postgresql
  40. # ToDo: request upstream to provide --with-pulseaudio=...
  41. TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
  42. define Package/gnunet/Default
  43. SECTION:=net
  44. CATEGORY:=Network
  45. TITLE:=GNUnet
  46. URL:=https://www.gnunet.org/
  47. endef
  48. define Package/gnunet
  49. $(call Package/gnunet/Default)
  50. TITLE+= - a peer-to-peer framework focusing on security
  51. DEPENDS:=+ca-certificates +libgnurl +libgnutls +libidn +libltdl \
  52. +libmicrohttpd +libunistring +librt
  53. USERID:=gnunet=400:gnunet=400
  54. MENU:=1
  55. endef
  56. define Package/gnunet/description
  57. GNUnet is a peer-to-peer framework focusing on security. The first and
  58. primary application for GNUnet is anonymous file-sharing. GNUnet is
  59. currently developed by a worldwide group of independent free software
  60. developers. GNUnet is a GNU package (http://www.gnu.org/).
  61. This is an ALPHA release. There are known and significant bugs as
  62. well as many missing features in this release.
  63. This package provides the core components of GNUnet including the
  64. CADET routing engine, a DHT implementation and most transports as well
  65. as their helpers.
  66. endef
  67. define BuildComponent
  68. define Package/gnunet-$(1)
  69. $$(call Package/gnunet/Default)
  70. TITLE+= $(2)
  71. DEPENDS:=gnunet $(DEPENDS_$(1))
  72. $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
  73. $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
  74. endef
  75. define Package/gnunet-$(1)/install
  76. ( if [ "$(BIN_$(1))" ]; then \
  77. $(INSTALL_DIR) $$(1)/usr/bin ; \
  78. for bin in $(BIN_$(1)); do \
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
  80. done \
  81. fi )
  82. ( if [ "$(LIB_$(1))" ]; then \
  83. $(INSTALL_DIR) $$(1)/usr/lib ; \
  84. for lib in $(LIB_$(1)); do \
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
  86. done \
  87. fi )
  88. ( if [ "$(PLUGIN_$(1))" ]; then \
  89. $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
  90. for plug in $(PLUGIN_$(1)); do \
  91. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
  92. done \
  93. fi )
  94. ( if [ "$(LIBEXEC_$(1))" ]; then \
  95. $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
  96. for lex in $(LIBEXEC_$(1)); do \
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
  98. done \
  99. fi )
  100. ( if [ "$(CONF_$(1))" ]; then \
  101. $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
  102. for conf in $(CONF_$(1)); do \
  103. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
  104. done \
  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 core config ecc identity nat-server nse \
  113. peerinfo peerstore 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 cadet core datacache dht \
  117. dns dnsparser dnsstub fragmentation friends hello identity nat nse \
  118. peerinfo peerstore 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 datacache_heap \
  123. transport_http_client transport_http_server \
  124. transport_https_client transport_https_server \
  125. transport_tcp transport_udp transport_unix transport_wlan; do \
  126. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
  127. done )
  128. ( for lex in daemon-hostlist daemon-topology helper-nat-client \
  129. helper-nat-server service-arm service-ats service-cadet \
  130. service-core service-dht service-identity service-nse \
  131. service-peerinfo service-peerstore service-regex \
  132. service-revocation service-scalarproduct-alice \
  133. service-scalarproduct-bob service-set service-statistics \
  134. service-transport; do \
  135. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
  136. done )
  137. ( for conf in arm ats cadet core datacache dht hostlist identity \
  138. nat nse peerinfo peerstore regex revocation scalarproduct \
  139. set statistics topology transport util; do \
  140. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
  141. done )
  142. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/hellos/* $(1)/usr/share/gnunet/hellos
  143. $(INSTALL_DIR) $(1)/etc/init.d/
  144. $(INSTALL_BIN) ./files/gnunet.init $(1)/etc/init.d/gnunet
  145. endef
  146. define Build/InstallDev
  147. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  148. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  150. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  151. endef
  152. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  153. BIN_conversation:=conversation conversation-test
  154. LIB_conversation:=conversation microphone speaker
  155. PLUGIN_conversation:=gnsrecord_conversation
  156. LIBEXEC_conversation:=helper-audio-playback helper-audio-record
  157. CONF_conversation:=conversation
  158. DEPENDS_experiments:=+libglpk
  159. PLUGIN_experiments:=ats_mlp ats_ril
  160. DEPENDS_fs:=+gnunet-storage +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. LIB_EXEC_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_storage:=+gnunet-gns +libsqlite3
  174. BIN_storage:=datastore
  175. LIB_storage:=datastore
  176. PLUGIN_storage:=datacache_sqlite datastore_heap datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
  177. LIBEXEC_storage:=daemon-latency-logger service-datastore
  178. CONF_storage:=datastore
  179. DEPENDS_transport-bluetooth:=+bluez-libs
  180. PLUGIN_transport-bluetooth:=transport_bluetooth
  181. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  182. DEPENDS_utils:=+certtool +openssl-util
  183. BIN_utils:=config gns-import.sh gns-proxy-setup-ca transport-certificate-creation
  184. DEPENDS_vpn:=+kmod-tun
  185. LIB_vpn:=tun vpn
  186. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  187. CONF_vpn:=exit pt vpn
  188. $(eval $(call BuildPackage,gnunet))
  189. $(eval $(call BuildComponent,conversation,conversation component,))
  190. $(eval $(call BuildComponent,experiments,experimental components,))
  191. $(eval $(call BuildComponent,fs,file-sharing components,))
  192. $(eval $(call BuildComponent,gns,name resolution components,y))
  193. $(eval $(call BuildComponent,storage,storage components,))
  194. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  195. $(eval $(call BuildComponent,utils,administration utililties,))
  196. $(eval $(call BuildComponent,vpn,vpn components,y))