Makefile (15532B)
1 include $(TOPDIR)/rules.mk 2 3 PKG_NAME:=gnunet 4 PKG_SOURCE_VERSION:=f7ef810b99d2c47d5a07739ecb0be1667f32567f 5 PKG_MIRROR_HASH:=1f1fbccff28240ca8c1980b3f7c95ee413a2978f6a245838d7acaae19db3f586 6 7 PKG_VERSION:=0.10.2-git-20170313-$(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 --disable-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 \ 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 DEPENDS_hostlist:=+libmicrohttpd +libgnurl +ca-certificates 196 LIBEXEC_hostlist:=daemon-hostlist 197 CONF_hostlist:=hostlist 198 199 DEPENDS_transport-http_client:=+libgnurl +ca-certificates 200 PLUGIN_transport-http_client:=transport_http_client transport_https_client 201 202 DEPENDS_transport-http_server:=+libmicrohttpd 203 PLUGIN_transport-http_server:=transport_http_server transport_https_server 204 205 PLUGIN_transport-wlan:=transport_wlan 206 LIBEXEC_transport-wlan:=helper-transport-wlan 207 208 DEPENDS_experiments:=+libglpk 209 PLUGIN_experiments:=ats_mlp ats_ril 210 211 # BIN_dv:=dv 212 LIB_dv:=dv 213 PLUGIN_dv:=transport_dv 214 LIBEXEC_dv:=service-dv 215 CONF_dv:=dv 216 217 DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor 218 BIN_fs:=auto-share directory download fs publish unindex search 219 LIB_fs:=fs 220 PLUGIN_fs:=block_fs 221 LIBEXEC_fs:=helper-fs-publish service-fs 222 CONF_fs:=fs 223 224 DEPENDS_gns:=+gnunet-vpn +iptables-mod-extra 225 USERID_gns:=gnunet=958:gnunetdns=452 226 BIN_gns:=gns gns-import.sh namecache namestore resolver 227 LIB_gns:=gns gnsrecord namecache namestore 228 PLUGIN_gns:=block_dns block_gns gnsrecord_dns gnsrecord_gns gnsrecord_identity 229 LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster 230 CONF_gns:=dns gns namecache namestore resolver zonemaster 231 232 DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd 233 LIBEXEC_namestore-fcfsd:=namestore-fcfsd 234 235 DEPENDS_gns-proxy:=+gnunet-gns +libgnurl +libmicrohttpd 236 LIBEXEC_gns-proxy:=gns-proxy 237 238 DEPENDS_datastore:=+gnunet-gns 239 BIN_datastore:=datastore 240 LIB_datastore:=datastore 241 LIBEXEC_datastore:=service-datastore 242 CONF_datastore:=datastore 243 244 BIN_peerstore:=peerstore 245 LIB_peerstore:=peerstore 246 LIBEXEC_peerstore:=service-peerstore 247 CONF_peerstore:=peerstore 248 249 DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson 250 LIB_rest:=rest json jsonapi jsonapiutils 251 PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore 252 LIBEXEC_rest:=rest-server 253 CONF_rest:=rest 254 255 BIN_rps:=rps 256 LIB_rps:=rps 257 LIBEXEC_rps:=service-rps 258 CONF_rps:=rps 259 260 DEPENDS_social:=+gnunet-gns +libmicrohttpd +jansson 261 BIN_social:=identity-token multicast social 262 LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social 263 LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social 264 CONF_social:=consensus multicast psyc psycstore secretsharing social 265 266 PLUGIN_dhtcache-heap:=datacache_heap 267 CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite 268 269 DEPENDS_gns-flat:=+gnunet-gns 270 PLUGIN_gns-flat:=namecache_flat namestore_flat 271 272 DEPENDS_peerstore-flat:=+gnunet-peerstore 273 PLUGIN_peerstore-flat:=peerstore_flat 274 275 DEPENDS_fs-heap:=+gnunet-datastore 276 PLUGIN_fs-heap:=datastore_heap 277 CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite 278 279 DEPENDS_mysql:=+libmysqlclient 280 LIB_mysql:=mysql my 281 282 DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social 283 PLUGIN_social-mysql:=psycstore_mysql 284 CONFLICTS_social-mysql:=gnunet-social-sqlite 285 286 DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore 287 PLUGIN_fs-mysql:=datastore_mysql 288 CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite 289 290 DEPENDS_pgsql:=+libpq 291 LIB_pgsql:=postgres pq 292 293 DEPENDS_dhtcache-pgsql:=+gnunet-pgsql 294 PLUGIN_dhtcache-pgsql:=datacache_postgres 295 CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite 296 297 DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore 298 PLUGIN_fs-pgsql:=datastore_postgres 299 CONFLICTS_fs-pgsql:=gnunet-fs-sqlite 300 301 DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns 302 PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres 303 CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat 304 305 DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social 306 PLUGIN_social-pgsql:=psycstore_postgres 307 CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql 308 309 DEPENDS_sqlite:=+libsqlite3 310 LIB_sqlite:=sq 311 312 DEPENDS_gns-sqlite:=+gnunet-gns +gnunet-sqlite 313 PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite 314 CONFLICTS_gns-sqlite:=gnunet-gns-flat 315 316 DEPENDS_peerstore-sqlite:=+gnunet-peerstore +gnunet-sqlite 317 PLUGIN_peerstore-sqlite:=peerstore_sqlite 318 CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat 319 320 DEPENDS_dhtcache-sqlite:=+gnunet-sqlite 321 PLUGIN_dhtcache-sqlite:=datacache_sqlite 322 323 DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite 324 PLUGIN_fs-sqlite:=datastore_sqlite 325 326 DEPENDS_social-sqlite:=+gnunet-social +gnunet-sqlite 327 PLUGIN_social-sqlite:=psycstore_sqlite 328 329 DEPENDS_transport-bluetooth:=+bluez-libs 330 PLUGIN_transport-bluetooth:=transport_bluetooth 331 LIBEXEC_transport-bluetooth:=helper-transport-bluetooth 332 333 DEPENDS_utils:=+certtool +openssl-util 334 BIN_utils:=gns-proxy-setup-ca transport-certificate-creation 335 336 DEPENDS_vpn:=+kmod-tun +iptables +firewall 337 BIN_vpn:=vpn 338 LIB_vpn:=dnsstub tun vpn 339 LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn 340 CONF_vpn:=exit pt vpn 341 342 343 define Package/gnunet-gns/prerm 344 #!/bin/sh 345 346 uci -q batch <<EOF 347 del network.gnunetdns 348 del network.gndnsrtt 349 del network.gndnsrl 350 commit network 351 352 del firewall.gnunetdns 353 del firewall.gndnsrl 354 del firewall.gndnsrl2 355 commit firewall 356 EOF 357 endef 358 359 define Package/gnunet-vpn/prerm 360 #!/bin/sh 361 362 uci -q batch <<EOF 363 del network.gnunetvpn 364 del network.gnunetexit 365 commit network 366 del firewall.gnunetvpn 367 del firewall.gnunetexit 368 del firewall.gnexitfwd 369 commit firewall 370 EOF 371 endef 372 373 define PostInstFixSUIDPerms 374 define Package/$(1)/postinst 375 #!/bin/sh 376 [ -z "$IPKG_INSTROOT" ] || exit 0 377 [ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0 378 endef 379 endef 380 381 $(eval $(call PostInstFixSUIDPerms,gnunet)) 382 $(eval $(call PostInstFixSUIDPerms,gnunet-gns)) 383 $(eval $(call PostInstFixSUIDPerms,gnunet-transport-bluetooth)) 384 $(eval $(call PostInstFixSUIDPerms,gnunet-transport-wlan)) 385 $(eval $(call PostInstFixSUIDPerms,gnunet-vpn)) 386 387 $(eval $(call BuildPackage,gnunet)) 388 $(eval $(call BuildComponent,conversation,conversation component,)) 389 $(eval $(call BuildComponent,datastore,data storage components,)) 390 $(eval $(call BuildComponent,dv,distance-vector routing component,y)) 391 $(eval $(call BuildComponent,experiments,experimental components,)) 392 $(eval $(call BuildComponent,fs,file-sharing components,)) 393 $(eval $(call BuildComponent,gns,name resolution components,y)) 394 $(eval $(call BuildComponent,gns-proxy,gns-proxy component,)) 395 $(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y)) 396 $(eval $(call BuildComponent,peerstore,peerstore local persistency component,)) 397 $(eval $(call BuildComponent,rest,REST interface,)) 398 $(eval $(call BuildComponent,rps,RPS routing component,y)) 399 $(eval $(call BuildComponent,social,social components,)) 400 $(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,)) 401 $(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y)) 402 $(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,)) 403 $(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y)) 404 $(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,)) 405 $(eval $(call BuildComponent,mysql,mySQL backend,)) 406 $(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,)) 407 $(eval $(call BuildComponent,social-mysql,mySQL social plugins,)) 408 $(eval $(call BuildComponent,pgsql,PostgreSQL backend,)) 409 $(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,)) 410 $(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,)) 411 $(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,)) 412 $(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,)) 413 $(eval $(call BuildComponent,sqlite,libsqlite3 backend,)) 414 $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,)) 415 $(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,)) 416 $(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,)) 417 $(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,)) 418 $(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,)) 419 $(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,)) 420 $(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y)) 421 $(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,)) 422 $(eval $(call BuildComponent,transport-wlan,WLAN transport,y)) 423 $(eval $(call BuildComponent,utils,administration utililties,)) 424 $(eval $(call BuildComponent,vpn,vpn components,y))