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.

260 lines
9.5 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:=36190
  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. $(INSTALL_DIR) $(1)/etc/uci-defaults
  143. $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/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_transport-http_client:=+libgnurl
  158. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  159. DEPENDS_transport-http_server:=+libmicrohttpd
  160. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  161. PLUGIN_transport-wlan:=transport_wlan
  162. LIBEXEC_transport-wlan:=helper-transport-wlan
  163. DEPENDS_experiments:=+libglpk
  164. PLUGIN_experiments:=ats_mlp ats_ril
  165. DEPENDS_fs:=+gnunet-datastore +libextractor
  166. BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
  167. LIB_fs:=fs
  168. PLUGIN_fs:=block_fs
  169. LIBEXEC_fs:=helper-fs-publish service-fs
  170. CONF_fs:=fs
  171. DEPENDS_gns:=+gnunet-vpn
  172. USERID_gns:=gnunetdns=401:gnunetdns=401
  173. BIN_gns:=gns gns-import.sh namecache namestore resolver
  174. LIB_gns:=gns gnsrecord namecache namestore
  175. PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns
  176. LIBEXEC_gns:=dns2gns gns-proxy helper-dns namestore-fcfsd service-dns service-gns service-namecache service-namestore service-resolver
  177. CONF_gns:=dns gns namecache namestore resolver
  178. DEPENDS_datastore:=+gnunet-gns +libsqlite3
  179. BIN_datastore:=datastore
  180. LIB_datastore:=datastore
  181. PLUGIN_datastore:=datastore_heap
  182. LIBEXEC_datastore:=daemon-latency-logger service-datastore
  183. CONF_datastore:=datastore
  184. DEPENDS_mysql:=+gnunet-gns +gnunet-datastore +libmysqlclient
  185. LIB_mysql:=mysql
  186. PLUGIN_mysql:=datastore_mysql
  187. DEPENDS_pgsql:=+gnunet-gns +gnunet-datastore +libpq
  188. LIB_pgsql:=postgres
  189. PLUGIN_pgsql:=datacache_postgres datastore_postgres namecache_postgres namestore_postgres
  190. DEPENDS_sqlite:=+gnunet-gns +gnunet-datastore +libsqlite3
  191. PLUGIN_sqlite:=datacache_sqlite datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
  192. DEPENDS_transport-bluetooth:=+bluez-libs
  193. PLUGIN_transport-bluetooth:=transport_bluetooth
  194. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  195. DEPENDS_utils:=+certtool +openssl-util
  196. BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
  197. DEPENDS_vpn:=+kmod-tun
  198. BIN_vpn:=vpn
  199. LIB_vpn:=tun vpn
  200. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  201. CONF_vpn:=exit pt vpn
  202. $(eval $(call BuildPackage,gnunet))
  203. $(eval $(call BuildComponent,conversation,conversation component,))
  204. $(eval $(call BuildComponent,experiments,experimental components,))
  205. $(eval $(call BuildComponent,fs,file-sharing components,))
  206. $(eval $(call BuildComponent,gns,name resolution components,y))
  207. $(eval $(call BuildComponent,datastore,storage components,))
  208. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  209. $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
  210. $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
  211. $(eval $(call BuildComponent,transport-wlan,WLAN transport,))
  212. $(eval $(call BuildComponent,utils,administration utililties,))
  213. $(eval $(call BuildComponent,vpn,vpn components,y))
  214. $(eval $(call BuildComponent,mysql,mySQL datastore backend,))
  215. $(eval $(call BuildComponent,pgsql,PostgreSQL backends,))
  216. $(eval $(call BuildComponent,sqlite,libsqlite3 backends,y))