Merge pull request #4962 from diizzyy/patch-96
[feed/packages.git] / net / gnunet / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=gnunet
4 PKG_SOURCE_VERSION:=664aca2d29b15dd75967d2bb0298caf750993b6f
5 PKG_MIRROR_HASH:=d3fd9f9275e3173b392ea3d151130fae9fb507986c5bd6a369303e0e1e0ab6d6
6
7 PKG_VERSION:=0.10.2-git-20171004-$(PKG_SOURCE_VERSION)
8 PKG_RELEASE:=1
9
10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
11 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
12 PKG_SOURCE_URL:=https://gnunet.org/git/gnunet.git
13 PKG_SOURCE_PROTO:=git
14
15 PKG_LICENSE:=GPL-3.0
16 PKG_LICENSE_FILES:=COPYING
17 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
18
19 PKG_BUILD_PARALLEL:=1
20 PKG_FIXUP:=gettext-version
21 PKG_INSTALL:=1
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/nls.mk
25
26 CONFIGURE_ARGS+= \
27 --with-libiconv-prefix="$(ICONV_PREFIX)" \
28 --with-libintl-prefix="$(INTL_PREFIX)" \
29 --with-ltdl \
30 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
31 $(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
32 $(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
33 --enable-testing \
34 --disable-testruns \
35 --enable-experimental \
36 --with-extractor=$(STAGING_DIR)/usr \
37 --with-gnutls=$(STAGING_DIR)/usr \
38 --with-libgnurl=$(STAGING_DIR)/usr \
39 --with-libunistring-prefix=$(STAGING_DIR)/usr \
40 --with-microhttpd=$(STAGING_DIR)/usr
41
42 # ToDo: request upstream to provide --with-pulseaudio=...
43 TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib/pulseaudio
44
45 define Package/gnunet/Default
46 SECTION:=net
47 CATEGORY:=Network
48 TITLE:=GNUnet
49 URL:=https://www.gnunet.org/
50 endef
51
52 define Package/gnunet
53 $(call Package/gnunet/Default)
54 TITLE+= - a peer-to-peer framework focusing on security
55 DEPENDS:=+libgcrypt +libgpg-error +libidn +libltdl +libunistring +librt +zlib \
56 $(ICONV_DEPENDS) $(INTL_DEPENDS)
57 USERID:=gnunet=958:gnunet=958
58 MENU:=1
59 endef
60
61 define Package/gnunet/description
62 GNUnet is a peer-to-peer framework focusing on security. The first and
63 primary application for GNUnet is anonymous file-sharing. GNUnet is
64 currently developed by a worldwide group of independent free software
65 developers. GNUnet is a GNU package (http://www.gnu.org/).
66
67 This is an ALPHA release. There are known and significant bugs as
68 well as many missing features in this release.
69
70 This package provides the core components of GNUnet including the
71 CADET routing engine, a DHT implementation and basic transports as
72 well as their helpers.
73 endef
74
75 define BuildComponent
76 PKG_CONFIG_DEPENDS+=CONFIG_PACKAGE_$(PKG_NAME)-$(1)
77
78 define Package/gnunet-$(1)
79 $$(call Package/gnunet/Default)
80 TITLE+= $(2)
81 DEPENDS:=gnunet $(DEPENDS_$(1))
82 $(if $(3),DEFAULT:=y if PACKAGE_gnunet)
83 $(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
84 $(if $(CONFLICTS_$(1)),CONFLICTS:=$(CONFLICTS_$(1)))
85 endef
86
87 define Package/gnunet-$(1)/install
88 ( if [ "$(BIN_$(1))" ]; then \
89 $(INSTALL_DIR) $$(1)/usr/bin ; \
90 for bin in $(BIN_$(1)); do \
91 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$$$$$bin $$(1)/usr/bin/ ; \
92 done \
93 fi )
94
95 ( if [ "$(LIB_$(1))" ]; then \
96 $(INSTALL_DIR) $$(1)/usr/lib ; \
97 for lib in $(LIB_$(1)); do \
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$$$$$lib.so* $$(1)/usr/lib/ ; \
99 done \
100 fi )
101
102 ( if [ "$(PLUGIN_$(1))" ]; then \
103 $(INSTALL_DIR) $$(1)/usr/lib/gnunet ; \
104 for plug in $(PLUGIN_$(1)); do \
105 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$$$$$plug*.so $$(1)/usr/lib/gnunet ; \
106 done \
107 fi )
108
109 ( if [ "$(LIBEXEC_$(1))" ]; then \
110 $(INSTALL_DIR) $$(1)/usr/lib/gnunet/libexec ; \
111 for lex in $(LIBEXEC_$(1)); do \
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$$$$$lex $$(1)/usr/lib/gnunet/libexec ; \
113 done \
114 fi )
115
116 ( if [ "$(CONF_$(1))" ]; then \
117 $(INSTALL_DIR) $$(1)/usr/share/gnunet/config.d ; \
118 for conf in $(CONF_$(1)); do \
119 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$$$$$conf.conf $$(1)/usr/share/gnunet/config.d ; \
120 done \
121 fi )
122
123 ( if [ -e ./files/gnunet-$(1).defaults ]; then \
124 $(INSTALL_DIR) $$(1)/etc/uci-defaults ; \
125 $(INSTALL_BIN) ./files/gnunet-$(1).defaults $$(1)/etc/uci-defaults/gnunet-$(1) ; \
126 fi )
127 endef
128
129 $$(eval $$(call BuildPackage,gnunet-$(1)))
130 endef
131
132 define Package/gnunet/install
133 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
134 $(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
135
136 ( for bin in arm ats cadet core config ecc identity nat nat-auto nat-server nse \
137 peerinfo revocation scalarproduct statistics transport uri; do \
138 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
139 done )
140
141 ( for lib in arm ats block blockgroup cadet core datacache dht \
142 dns dnsparser fragmentation friends hello identity natauto natnew nse \
143 peerinfo regexblock regex revocation scalarproduct set \
144 statistics transport util; do \
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
146 done )
147
148 ( for plug in ats_proportional block_dht block_regex block_revocation \
149 transport_tcp transport_udp transport_unix; do \
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
151 done )
152
153 ( for lex in daemon-topology helper-nat-client \
154 helper-nat-server service-arm service-ats service-cadet \
155 service-core service-dht service-identity service-nat service-nat-auto \
156 service-nse service-peerinfo service-regex \
157 service-revocation service-scalarproduct-alice \
158 service-scalarproduct-bob service-scalarproduct-ecc-alice \
159 service-scalarproduct-ecc-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 identity identity-provider \
165 nat nat-auto nse peerinfo 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 $(INSTALL_DIR) $(1)/lib/upgrade/keep.d
174 $(INSTALL_DATA) ./files/gnunet.upgrade $(1)/lib/upgrade/keep.d/gnunet
175 $(INSTALL_DIR) $(1)/etc/uci-defaults
176 $(INSTALL_BIN) ./files/gnunet.defaults $(1)/etc/uci-defaults/gnunet
177 $(INSTALL_DIR) $(1)/lib/netifd/proto
178 $(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto/gnunet.sh
179 endef
180
181 define Build/InstallDev
182 $(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
183 $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
184 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
185 $(CP) $(PKG_INSTALL_DIR)/usr/include/gnunet/*.h $(1)/usr/include/gnunet
186 endef
187
188 DEPENDS_conversation:=+gnunet-gns +libgst1app +libgst1audio +libgstreamer1 +glib2 +pulseaudio-daemon +libopus +libogg
189 BIN_conversation:=conversation conversation-test
190 LIB_conversation:=conversation microphone speaker
191 PLUGIN_conversation:=gnsrecord_conversation
192 LIBEXEC_conversation:=helper-audio-playback helper-audio-record service-conversation
193 CONF_conversation:=conversation
194
195 BIN_dht-cli:=dht-get dht-put dht-monitor
196 PLUGIN_dht-cli:=block_test
197
198 DEPENDS_hostlist:=+libmicrohttpd +libgnurl +ca-certificates
199 LIBEXEC_hostlist:=daemon-hostlist
200 CONF_hostlist:=hostlist
201
202 DEPENDS_transport-http_client:=+libgnurl +ca-certificates
203 PLUGIN_transport-http_client:=transport_http_client transport_https_client
204
205 DEPENDS_transport-http_server:=+libmicrohttpd
206 PLUGIN_transport-http_server:=transport_http_server transport_https_server
207
208 PLUGIN_transport-wlan:=transport_wlan
209 LIBEXEC_transport-wlan:=helper-transport-wlan
210
211 DEPENDS_experiments:=+libglpk
212 PLUGIN_experiments:=ats_mlp ats_ril
213
214 # BIN_dv:=dv
215 LIB_dv:=dv
216 PLUGIN_dv:=transport_dv
217 LIBEXEC_dv:=service-dv
218 CONF_dv:=dv
219
220 DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor
221 BIN_fs:=auto-share directory download fs publish unindex search
222 LIB_fs:=fs
223 PLUGIN_fs:=block_fs
224 LIBEXEC_fs:=helper-fs-publish service-fs
225 CONF_fs:=fs
226
227 DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra
228 USERID_gns:=gnunet=958:gnunetdns=452
229 BIN_gns:=gns gns-import.sh namecache namestore resolver
230 LIB_gns:=gns gnsrecord namecache namestore
231 PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity
232 LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
233 CONF_gns:=dns gns namecache namestore resolver zonemaster
234
235 DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd
236 LIBEXEC_namestore-fcfsd:=namestore-fcfsd
237
238 DEPENDS_gns-proxy:=+gnunet-gns +libgnurl +libmicrohttpd
239 LIBEXEC_gns-proxy:=gns-proxy
240
241 DEPENDS_datastore:=+gnunet-gns
242 BIN_datastore:=datastore
243 LIB_datastore:=datastore
244 LIBEXEC_datastore:=service-datastore
245 CONF_datastore:=datastore
246
247 BIN_peerstore:=peerstore
248 LIB_peerstore:=peerstore
249 LIBEXEC_peerstore:=service-peerstore
250 CONF_peerstore:=peerstore
251
252 DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson
253 LIB_rest:=rest json jsonapi jsonapiutils
254 PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore
255 LIBEXEC_rest:=rest-server
256 CONF_rest:=rest
257
258 BIN_rps:=rps
259 LIB_rps:=rps
260 LIBEXEC_rps:=service-rps
261 CONF_rps:=rps
262
263 DEPENDS_social:=+gnunet-gns +libmicrohttpd +jansson
264 BIN_social:=identity-token multicast social
265 LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social
266 LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social
267 CONF_social:=consensus multicast psyc psycstore secretsharing social
268 PLUGINS_social:=block_consensus
269
270 PLUGIN_dhtcache-heap:=datacache_heap
271 CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
272
273 DEPENDS_gns-flat:=+gnunet-gns
274 PLUGIN_gns-flat:=namecache_flat namestore_flat
275
276 DEPENDS_peerstore-flat:=+gnunet-peerstore
277 PLUGIN_peerstore-flat:=peerstore_flat
278
279 DEPENDS_fs-heap:=+gnunet-datastore
280 PLUGIN_fs-heap:=datastore_heap
281 CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
282
283 DEPENDS_mysql:=+libmysqlclient
284 LIB_mysql:=mysql my
285
286 DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social
287 PLUGIN_social-mysql:=psycstore_mysql
288 CONFLICTS_social-mysql:=gnunet-social-sqlite
289
290 DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
291 PLUGIN_fs-mysql:=datastore_mysql
292 CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
293
294 DEPENDS_pgsql:=+libpq
295 LIB_pgsql:=pq
296
297 DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
298 PLUGIN_dhtcache-pgsql:=datacache_postgres
299 CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
300
301 DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
302 PLUGIN_fs-pgsql:=datastore_postgres
303 CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
304
305 DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
306 PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
307 CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
308
309 DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
310 PLUGIN_social-pgsql:=psycstore_postgres
311 CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
312
313 DEPENDS_sqlite:=+libsqlite3
314 LIB_sqlite:=sq
315
316 DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite
317 PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
318 CONFLICTS_gns-sqlite:=gnunet-gns-flat
319
320 DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite
321 PLUGIN_peerstore-sqlite:=peerstore_sqlite
322 CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
323
324 DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
325 PLUGIN_dhtcache-sqlite:=datacache_sqlite
326
327 DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
328 PLUGIN_fs-sqlite:=datastore_sqlite
329
330 DEPENDS_social-sqlite:=+gnunet-social +gnunet-sqlite
331 PLUGIN_social-sqlite:=psycstore_sqlite
332
333 DEPENDS_transport-bluetooth:=+bluez-libs
334 PLUGIN_transport-bluetooth:=transport_bluetooth
335 LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
336
337 DEPENDS_utils:=+certtool +openssl-util
338 BIN_utils:=gns-proxy-setup-ca transport-certificate-creation
339
340 DEPENDS_vpn:=+kmod-tun +iptables +firewall
341 BIN_vpn:=vpn
342 LIB_vpn:=dnsstub tun vpn
343 LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
344 CONF_vpn:=exit pt vpn
345
346
347 define Package/gnunet-gns/prerm
348 #!/bin/sh
349
350 uci -q batch <<EOF
351 del network.gnunetdns
352 del network.gndnsrtt
353 del network.gndnsrl
354 commit network
355
356 del firewall.gnunetdns
357 del firewall.gndnsrl
358 del firewall.gndnsrl2
359 commit firewall
360 EOF
361 endef
362
363 define Package/gnunet-vpn/prerm
364 #!/bin/sh
365
366 uci -q batch <<EOF
367 del network.gnunetvpn
368 del network.gnunetexit
369 commit network
370 del firewall.gnunetvpn
371 del firewall.gnunetexit
372 del firewall.gnexitfwd
373 commit firewall
374 EOF
375 endef
376
377 define PostInstFixSUIDPerms
378 define Package/$(1)/postinst
379 #!/bin/sh
380 [ -z "$IPKG_INSTROOT" ] || exit 0
381 [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0
382 endef
383 endef
384
385 $(eval $(call PostInstFixSUIDPerms,gnunet))
386 $(eval $(call PostInstFixSUIDPerms,gnunet-gns))
387 $(eval $(call PostInstFixSUIDPerms,gnunet-transport-bluetooth))
388 $(eval $(call PostInstFixSUIDPerms,gnunet-transport-wlan))
389 $(eval $(call PostInstFixSUIDPerms,gnunet-vpn))
390
391 $(eval $(call BuildPackage,gnunet))
392 $(eval $(call BuildComponent,conversation,conversation component,))
393 $(eval $(call BuildComponent,datastore,data storage components,))
394 $(eval $(call BuildComponent,dht-cli,DHT command line clients,))
395 # $(eval $(call BuildComponent,dv,distance-vector routing component,y))
396 $(eval $(call BuildComponent,experiments,experimental components,))
397 $(eval $(call BuildComponent,fs,file-sharing components,))
398 $(eval $(call BuildComponent,gns,name resolution components,y))
399 $(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
400 $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
401 $(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
402 $(eval $(call BuildComponent,rest,REST interface,))
403 $(eval $(call BuildComponent,rps,RPS routing component,y))
404 $(eval $(call BuildComponent,social,social components,))
405 $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
406 $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
407 $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
408 $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
409 $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
410 $(eval $(call BuildComponent,mysql,mySQL backend,))
411 $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
412 $(eval $(call BuildComponent,social-mysql,mySQL social plugins,))
413 $(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
414 $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
415 $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
416 $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
417 $(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
418 $(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
419 $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
420 $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
421 $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
422 $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
423 $(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,))
424 $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
425 $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
426 $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
427 $(eval $(call BuildComponent,transport-wlan,WLAN transport,y))
428 $(eval $(call BuildComponent,utils,administration utililties,))
429 $(eval $(call BuildComponent,vpn,vpn components,y))