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