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.

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