gnunet: update to version 0.16.2

Sync GNUnet package with master branch.
This is a new major release. It breaks protocol compatibility with the
0.15.x versions. Please be aware that Git master is thus henceforth
(and has been for a while) INCOMPATIBLE with the 0.15.x GNUnet network,
and interactions between old and new peers will result in issues.
0.15.x peers will be able to communicate with Git master or 0.16.x
peers, but some services - in particular GNS - will not be compatible.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commits
 deafd6cf3f gnunet: update to v0.14.1
 746bb95552 gnunet: update to version 0.15.3
 23b5b516ae gnunet: fix compilation with big endian
 c3c6a2ff1d gnunet: several improvements
 23f722f905 gnunet: packaging fixes
 2f8e696189 gnunet: update to 0.16.1
 f951f61005 gnunet: improve init script
 033744ac59 gnunet: update to 0.16.2
 65f5f850f3 gnunet: work-around sysupgrade restore missing file ownerships
)
This commit is contained in:
Daniel Golle 2021-04-22 00:00:08 +01:00
parent a62591148b
commit add708f030
No known key found for this signature in database
GPG Key ID: 5A8F39C31C3217CA
9 changed files with 130 additions and 89 deletions

View File

@ -2,11 +2,11 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gnunet
PKG_VERSION:=0.13.3
PKG_RELEASE:=4
PKG_VERSION:=0.16.2
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/gnunet
PKG_HASH:=318e06c4134d1a8ce3b4385d82b11316eaaeb9a4dbc5d4b646453dfc53199296
PKG_HASH:=b5858833836509b71d5c0d9bdc11fd1beeeaba5a75be4bbd93581a4d13e0f49a
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
@ -17,27 +17,32 @@ PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=gettext-version
PKG_INSTALL:=1
# despite configure fails if sqlite3 isn't detected
PKG_BUILD_DEPENDS:=sqlite3
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
# always pass --with-sqlite3 as configure fails when trying --without-sqlite3
CONFIGURE_ARGS+= \
--with-libiconv-prefix="$(ICONV_PREFIX)" \
--with-libintl-prefix="$(INTL_PREFIX)" \
--with-ltdl \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-mysql),--with-mysql="$(STAGING_DIR)/usr",--without-mysql) \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-pgsql),--with-postgresql="$(STAGING_DIR)/usr/bin/pg_config",--without-postgresql) \
$(if $(CONFIG_PACKAGE_libsqlite3),--with-sqlite="$(STAGING_DIR)/usr",--without-sqlite) \
--enable-testing \
--with-sqlite3="$(STAGING_DIR)/usr" \
--disable-testruns \
--disable-documentation \
--enable-experimental \
--with-extractor=$(STAGING_DIR)/usr \
--with-gnutls=$(STAGING_DIR)/usr \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-transport-bluetooth),--with-libbluetooth="$(STAGING_DIR)/usr",--without-libbluetooth) \
$(if $(CONFIG_PACKAGE_$(PKG_NAME)-transport-bluetooth),--with-bluetooth="$(STAGING_DIR)/usr",--without-bluetooth) \
--with-libgnurl=$(STAGING_DIR)/usr \
--with-libogg=$(STAGING_DIR)/usr \
--with-libopus=$(STAGING_DIR)/usr \
--with-libpulse=$(STAGING_DIR)/usr \
--with-ogg=$(STAGING_DIR)/usr \
--with-opus=$(STAGING_DIR)/usr \
--with-pabc=$(STAGING_DIR)/usr \
--with-png=$(STAGING_DIR)/usr \
--with-pulse=$(STAGING_DIR)/usr \
--with-libunistring-prefix=$(STAGING_DIR)/usr \
--with-microhttpd=$(STAGING_DIR)/usr
@ -151,24 +156,24 @@ define Package/gnunet/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
done )
( for plug in ats_proportional block_dht block_regex block_revocation transport_unix; do \
( for plug in ats_proportional block_dht block_regex block_revocation dhtu_gnunet dhtu_ip transport_unix; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
done )
( for lex in daemon-topology helper-nat-client \
( for lex in communicator-unix daemon-topology helper-nat-client \
helper-nat-server service-arm service-ats service-ats-new service-cadet \
service-core service-dht service-identity service-nat service-nat-auto \
service-nse service-peerinfo service-peerstore service-regex \
service-revocation service-scalarproduct-alice \
service-scalarproduct-bob service-scalarproduct-ecc-alice \
service-scalarproduct-ecc-bob service-set service-seti service-setu service-statistics \
service-transport timeout; do \
service-tng service-transport timeout; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
done )
( for conf in arm ats cadet communicator-unix core datacache dht identity \
( for conf in arm ats cadet communicator-unix core datacache dht dhtu identity \
nat nat-auto nse peerinfo peerstore regex revocation \
scalarproduct set seti setu statistics topology transport util; do \
scalarproduct set seti setu statistics tlds topology transport util; do \
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/gnunet/config.d/$$$$conf.conf $(1)/usr/share/gnunet/config.d ; \
done )
@ -219,6 +224,9 @@ DEPENDS_hostlist:=+libmicrohttpd-ssl +gnunet-curl +ca-certificates
LIBEXEC_hostlist:=daemon-hostlist
CONF_hostlist:=hostlist
LIBEXEC_communicator-udp:=communicator-udp
LIBEXEC_communicator-tcp:=communicator-tcp
DEPENDS_transport-bluetooth:=+bluez-libs
PLUGIN_transport-bluetooth:=transport_bluetooth
LIBEXEC_transport-bluetooth:=helper-transport-bluetooth
@ -256,11 +264,11 @@ USERID_gns:=:gnunetdns=452
BIN_gns:=gns gns-import.sh namecache namestore resolver zoneimport
LIB_gns:=gns gnsrecord namecache namestore
PLUGIN_gns:=block_dns block_gns gnsrecord_conversation gnsrecord_dns gnsrecord_gns
LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster
LIBEXEC_gns:=dns2gns helper-dns service-dns service-gns service-namecache service-namestore service-resolver service-zonemaster service-zonemaster-monitor
CONF_gns:=dns gns namecache namestore resolver zonemaster
FILE_MODES_gns:=/usr/lib/gnunet/libexec/gnunet-helper-dns:root:gnunetdns:4750 /usr/lib/gnunet/libexec/gnunet-service-dns:gnunet:gnunetdns:2750
DEPENDS_namestore-fcfsd:=+gnunet-gns +libmicrohttpd-ssl
DEPENDS_namestore-fcfsd:=+gnunet-rest +libmicrohttpd-ssl
LIBEXEC_namestore-fcfsd:=namestore-fcfsd
DEPENDS_gns-proxy:=+gnunet-gns +gnunet-curl +libmicrohttpd-ssl +PACKAGE_libgnutls-dane:libgnutls-dane
@ -272,16 +280,21 @@ LIB_datastore:=datastore
LIBEXEC_datastore:=service-datastore
CONF_datastore:=datastore
BIN_messenger:=messenger
LIB_messenger:=messenger
LIBEXEC_messenger:=service-messenger
CONF_messenger:=messenger
PLUGIN_messenger:=gnsrecord_messenger
DEPENDS_reclaim:=+gnunet-gns +gnunet-sqlite +libpbc +libgabe +jansson
BIN_reclaim:=reclaim
BIN_reclaim:=did reclaim
LIB_reclaim:=consensus abe reclaim reclaimattribute secretsharing
LIBEXEC_reclaim:=service-consensus service-reclaim service-secretsharing
CONF_reclaim:=consensus reclaim secretsharing
PLUGIN_reclaim:=block_consensus gnsrecord_reclaim reclaim_credential_jwt reclaim_attribute_basic
DEPENDS_rest:=+gnunet-gns +gnunet-reclaim +libmicrohttpd-ssl +jansson
LIB_rest:=rest json
LIB_rest:=rest json gnsrecordjson
PLUGIN_rest:=rest_config rest_copying rest_gns rest_identity rest_namestore rest_peerinfo rest_openid_connect rest_reclaim
LIBEXEC_rest:=rest-server
CONF_rest:=rest
@ -311,8 +324,9 @@ DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
PLUGIN_fs-mysql:=datastore_mysql
CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
DEPENDS_pgsql:=+libpq
DEPENDS_pgsql:=+libpq +pgsql-server
LIB_pgsql:=pq
# USERID_pgsql:=gnunet=958::postgres=5432
DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
PLUGIN_dhtcache-pgsql:=datacache_postgres
@ -326,7 +340,6 @@ DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
DEPENDS_sqlite:=+libsqlite3
LIB_sqlite:=sq
@ -410,6 +423,7 @@ $(eval $(call BuildComponent,fs,file-sharing components,))
$(eval $(call BuildComponent,gns,name resolution components,y))
$(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
$(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
$(eval $(call BuildComponent,messenger,group chat messenger,))
$(eval $(call BuildComponent,reclaim,reclaim identity-provider subsystem,))
$(eval $(call BuildComponent,rest,REST interface,))
$(eval $(call BuildComponent,rps,RPS routing component,y))
@ -429,6 +443,8 @@ $(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
$(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
$(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
$(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
$(eval $(call BuildComponent,communicator-tcp,tng transport TCP communicator,y))
$(eval $(call BuildComponent,communicator-udp,tng transport UDP communicator,y))
$(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
$(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
$(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))

View File

@ -4,5 +4,7 @@ uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config
uci -q batch <<EOF
set gnunet.dhtcache.DATABASE=postgres
set gnunet.datacache_postgres=gnunet-config
set gnunet.datacache_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
commit gnunet
EOF

View File

@ -4,5 +4,7 @@ uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config
uci -q batch <<EOF
set gnunet.datastore.DATABASE=postgres
set gnunet.datastore_postgres=gnunet-config
set gnunet.datastore_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
commit gnunet
EOF

View File

@ -4,9 +4,9 @@ uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
uci -q batch <<EOF
del gnunet.namestore_heap
set gnunet.namestore_heap=gnunet-config
set gnunet.namestore_heap.FILENAME=/etc/gnunet/namestore.flat
del gnunet.namestore_flat
set gnunet.namestore_flat=gnunet-config
set gnunet.namestore_flat.FILENAME=/etc/gnunet/namestore.flat
set gnunet.namestore.DATABASE=flat
del gnunet.namecache_flat
set gnunet.namecache_flat=gnunet-config

View File

@ -6,5 +6,9 @@ uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
uci -q batch <<EOF
set gnunet.namestore.DATABASE=postgres
set gnunet.namecache.DATABASE=postgres
set gnunet.namestore_postgres=gnunet-config
set gnunet.namestore_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
set gnunet.namecache_postgres=gnunet-config
set gnunet.namecache_postgres.CONFIG=postgres://gnunet@%2Ftmp%2Frun%2Fpostgresql/gnunet
commit gnunet
EOF

View File

@ -13,44 +13,41 @@ CONFIGFILE=$GNUNET_HOME/gnunet.conf
extra_command "restart_transport" "Restart transport"
prepare_config() {
local had_exit_service=0;
local had_exit_service=0
if [ ! -e "$GNUNET_HOME" ]; then
mkdir -p $GNUNET_HOME
chown gnunet:gnunet $GNUNET_HOME
chmod 0750 $GNUNET_HOME
mkdir -m 0750 -p "$GNUNET_HOME"
chown gnunet:gnunet "$GNUNET_HOME"
fi
touch $CONFIGFILE
chown gnunet:gnunet $CONFIGFILE
chmod 0640 $CONFIGFILE
gnunet-config -c $CONFIGFILE -w -s PATHS -o GNUNET_HOME -V $GNUNET_HOME
touch "$CONFIGFILE"
chown gnunet:gnunet "$CONFIGFILE"
chmod 0640 "$CONFIGFILE"
gnunet-config -c "$CONFIGFILE" -s PATHS -o GNUNET_HOME -V "$GNUNET_HOME"
# minimal persistency in /etc/gnunet
[ ! -d /etc/gnunet ] && {
mkdir -p /etc/gnunet
chown gnunet:gnunet /etc/gnunet
}
[ ! -d /etc/gnunet ] && mkdir -m 0750 -p /etc/gnunet
chown -R gnunet:gnunet /etc/gnunet
# defaults paths for persistent files
gnunet-config -c $CONFIGFILE -w -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet
gnunet-config -c $CONFIGFILE -w -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc
gnunet-config -c $CONFIGFILE -w -s identity -o EGODIR -V /etc/gnunet/identity/egos
gnunet-config -c $CONFIGFILE -w -s revocation -o DATABASE -V /etc/gnunet/revocation.dat
gnunet-config -c $CONFIGFILE -w -s nse -o PROOFFILE -V /etc/gnunet/proof.dat
gnunet-config -c "$CONFIGFILE" -s PATHS -o GNUNET_CONFIG_HOME -V /etc/gnunet
gnunet-config -c "$CONFIGFILE" -s PEER -o PRIVATE_KEY -V /etc/gnunet/private_key.ecc
gnunet-config -c "$CONFIGFILE" -s identity -o EGODIR -V /etc/gnunet/identity/egos
gnunet-config -c "$CONFIGFILE" -s revocation -o DATABASE -V /etc/gnunet/revocation.dat
gnunet-config -c "$CONFIGFILE" -s nse -o PROOFFILE -V /etc/gnunet/proof.dat
# enable all installed transport plugins
transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS)
transport_plugins=$(gnunet-config -c "$CONFIGFILE" -s transport -o PLUGINS)
for transplug in /usr/lib/gnunet/libgnunet_plugin_transport_*.so; do
transplug=$( echo $transplug |
sed -ne 's!^.*_transport_\(.*\)\.so$!\1!p' )
[ -n "$( echo $transport_plugins | grep $transplug )" ] ||
transplug="$( echo "$transplug" |
sed -ne 's!^.*_transport_\(.*\)\.so$!\1!p' )"
echo "$transport_plugins" | grep -q "$transplug" ||
transport_plugins="$transport_plugins $transplug"
done
gnunet-config -c $CONFIGFILE -w -s transport -o PLUGINS -V "$transport_plugins"
gnunet-config -c "$CONFIGFILE" -s transport -o PLUGINS -V "$transport_plugins"
# do not touch sysctl, iptables and routing
gnunet-config -c $CONFIGFILE -w -s dns -o SKIP_ROUTING_SETUP -V YES
gnunet-config -c $CONFIGFILE -w -s exit -o EXIT_IFNAME -V ''
gnunet-config -c "$CONFIGFILE" -s dns -o SKIP_ROUTING_SETUP -V YES
gnunet-config -c "$CONFIGFILE" -s exit -o EXIT_IFNAME -V ''
# apply config from UCI
_gnunet_section=""
@ -71,19 +68,19 @@ prepare_config() {
# $2 value
local __OPT="$1"
local __VAL="$2"
gnunet-config -c $CONFIGFILE -w -s ${_gnunet_section} -o ${__OPT} -V "${__VAL}"
gnunet-config -c "$CONFIGFILE" -s "${_gnunet_section}" -o "${__OPT}" -V "${__VAL}"
}
config_load gnunet
[ "$had_exit_service" -eq 1 ] && gnunet-config -c $CONFIGFILE -w -s exit -o FORCESTART -V YES
[ "$had_exit_service" -eq 1 ] && gnunet-config -c "$CONFIGFILE" -s exit -o FORCESTART -V YES
return 0
}
restart_transport() {
gnunet-arm -c $CONFIGFILE -k transport
gnunet-arm -c $CONFIGFILE -i transport
gnunet-arm -c "$CONFIGFILE" -k transport
gnunet-arm -c "$CONFIGFILE" -i transport
}
start_service() {
@ -93,8 +90,8 @@ start_service() {
procd_set_param user gnunet
# procd_set_param env GNUNET_LOG="dht;;;;info"
procd_set_param stderr 1
procd_set_param command $PROG -c $CONFIGFILE
[ "$LOGFILE" ] && procd_append_param command -l $LOGFILE
procd_set_param command "$PROG" -c "$CONFIGFILE"
[ "$LOGFILE" ] && procd_append_param command -l "$LOGFILE"
procd_set_param respawn
procd_close_instance
}

View File

@ -0,0 +1,18 @@
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -150,7 +150,6 @@ enum GNUNET_GenericReturnValue
* Endian operations
*/
-#if __BYTE_ORDER == __LITTLE_ENDIAN
#ifdef HAVE_BYTESWAP_H
#define BYTE_SWAP_16(x) bswap_16 (x)
#define BYTE_SWAP_32(x) bswap_32 (x)
@@ -170,6 +169,7 @@ enum GNUNET_GenericReturnValue
56))
#endif
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define GNUNET_htobe16(x) BYTE_SWAP_16 (x)
#define GNUNET_htole16(x) (x)
#define GNUNET_be16toh(x) BYTE_SWAP_16 (x)

View File

@ -1,36 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -813,10 +813,12 @@ AC_ARG_WITH(libpulse,
LDFLAGS="-L$with_libpulse/lib $LDFLAGS"
CPPFLAGS="-I$with_libpulse/include $CPPFLAGS"
AC_CHECK_HEADERS(pulse/simple.h,
- AC_CHECK_LIB([pulse],
- [pa_stream_peek],
- EXT_LIB_PATH="-L$with_libpulse/lib $EXT_LIB_PATH"
- pulse=1))
+ AC_CHECK_DECL([pa_stream_peek],
+ [pulse=1],
+ [],
+ [[
+ #include <pulse/stream.h>
+ ]]))
])
],
[AC_MSG_RESULT([--with-libpulse not specified])
@@ -856,10 +858,12 @@ AC_ARG_WITH(libopus,
LDFLAGS="-L$with_libopus/lib $LDFLAGS"
CPPFLAGS="-I$with_libopus/include $CPPFLAGS"
AC_CHECK_HEADERS(opus/opus.h,
- AC_CHECK_LIB([opus],
- [OPUS_SET_GAIN],
- EXT_LIB_PATH="-L$with_libopus/lib $EXT_LIB_PATH"
- opus=1))
+ AC_CHECK_DECL([OPUS_SET_GAIN],
+ [opus=1],
+ [],
+ [[
+ #include <opus/opus.h>
+ ]]))
])
],
[AC_MSG_RESULT([--with-libopus not specified])

View File

@ -0,0 +1,38 @@
--- a/configure.ac
+++ b/configure.ac
@@ -981,33 +981,13 @@ AC_ARG_WITH([mysql],
AC_CHECK_LIB([mysqlclient], [mysql_init],
[AC_CHECK_HEADERS([mysql/mysql.h],
[MYSQL_LDFLAGS="-L$MYSQL_LIBDIR"
- mysql=true],
+ mysql=true
+ mysql8=true],
[mysql=false])],
[mysql=false])])
AC_SUBST(MYSQL_LDFLAGS)
AC_SUBST(MYSQL_CPPFLAGS)
-# additional version checks for mysql
-AS_IF([test "x$mysql" = "xtrue"],
- [AC_MSG_CHECKING([for mysql version])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[include <mysql/mysql_version.h>]],
- [[#if (MYSQL_VERSION_ID < 40100)
-#error required at least version 4.1
-#endif]])],
- [mysql=true],
- [mysql=false])
- AS_IF([test "x$mysql" = "xfalse"],
- [AC_MSG_RESULT([< 4.1])
- AC_MSG_RESULT([mysql version >= 4.1 required. Will not use MySQL])])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [[#include <mysql/mysql_version.h>]],
- [[#if (MYSQL_VERSION_ID < 80000)
-#error needs at least version 8.0
-#endif]])],
- [mysql8=true],
- [mysql8=false])])
-
AS_IF([test "x$mysql" = "xtrue"],
[AS_IF([test "x$mysql8" = "xfalse"],
[AC_MSG_RESULT([between 4.1 and 8.0])],