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.

257 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:=36094
  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. $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
  140. $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
  141. endef
  142. define Build/InstallDev
  143. $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
  144. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
  145. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
  146. $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
  147. endef
  148. DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
  149. BIN_conversation:=conversation conversation-test
  150. LIB_conversation:=conversation microphone speaker
  151. PLUGIN_conversation:=gnsrecord_conversation
  152. LIBEXEC_conversation:=helper-audio-playback helper-audio-record
  153. CONF_conversation:=conversation
  154. DEPENDS_transport-http_client:=+libgnurl
  155. PLUGIN_transport-http_client:=transport_http_client transport_https_client
  156. DEPENDS_transport-http_server:=+libmicrohttpd
  157. PLUGIN_transport-http_server:=transport_http_server transport_https_server
  158. PLUGIN_transport-wifi:=transport_wlan
  159. LIBEXEC_transport-wifi:=helper-transport-wlan
  160. DEPENDS_experiments:=+libglpk
  161. PLUGIN_experiments:=ats_mlp ats_ril
  162. DEPENDS_fs:=+gnunet-datastore +libextractor
  163. BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
  164. LIB_fs:=fs
  165. PLUGIN_fs:=block_fs
  166. LIBEXEC_fs:=helper-fs-publish service-fs
  167. CONF_fs:=fs
  168. DEPENDS_gns:=+gnunet-vpn
  169. USERID_gns:=gnunetdns=401:gnunetdns=401
  170. BIN_gns:=gns gns-import.sh namecache namestore resolver
  171. LIB_gns:=gns gnsrecord namecache namestore
  172. PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns
  173. LIBEXEC_gns:=dns2gns gns-proxy helper-dns namestore-fcfsd service-dns service-gns service-namecache service-namestore service-resolver
  174. CONF_gns:=dns gns namecache namestore resolver
  175. DEPENDS_datastore:=+gnunet-gns +libsqlite3
  176. BIN_datastore:=datastore
  177. LIB_datastore:=datastore
  178. PLUGIN_datastore:=datastore_heap
  179. LIBEXEC_datastore:=daemon-latency-logger service-datastore
  180. CONF_datastore:=datastore
  181. DEPENDS_mysql:=+gnunet-gns +gnunet-datastore +libmysqlclient
  182. LIB_mysql:=mysql
  183. PLUGIN_mysql:=datastore_mysql
  184. DEPENDS_pgsql:=+gnunet-gns +gnunet-datastore +libpq
  185. LIB_pgsql:=postgres
  186. PLUGIN_pgsql:=datacache_postgres datastore_postgres namecache_postgres namestore_postgres
  187. DEPENDS_sqlite:=+gnunet-gns +gnunet-datastore +libsqlite3
  188. PLUGIN_sqlite:=datacache_sqlite datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
  189. DEPENDS_transport-bluetooth:=+bluez-libs
  190. PLUGIN_transport-bluetooth:=transport_bluetooth
  191. LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
  192. DEPENDS_utils:=+certtool +openssl-util
  193. BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
  194. DEPENDS_vpn:=+kmod-tun
  195. BIN_vpn:=vpn
  196. LIB_vpn:=tun vpn
  197. LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
  198. CONF_vpn:=exit pt vpn
  199. $(eval $(call BuildPackage,gnunet))
  200. $(eval $(call BuildComponent,conversation,conversation component,))
  201. $(eval $(call BuildComponent,experiments,experimental components,))
  202. $(eval $(call BuildComponent,fs,file-sharing components,))
  203. $(eval $(call BuildComponent,gns,name resolution components,y))
  204. $(eval $(call BuildComponent,datastore,storage components,))
  205. $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
  206. $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
  207. $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
  208. $(eval $(call BuildComponent,transport-wlan,WLAN transport,))
  209. $(eval $(call BuildComponent,utils,administration utililties,))
  210. $(eval $(call BuildComponent,vpn,vpn components,y))
  211. $(eval $(call BuildComponent,mysql,mySQL datastore backend,))
  212. $(eval $(call BuildComponent,pgsql,PostgreSQL backends,))
  213. $(eval $(call BuildComponent,sqlite,libsqlite3 backends,y))