From ec78709681261eaddedbed6484dd95849f180f92 Mon Sep 17 00:00:00 2001 From: xrs Date: Thu, 16 Jan 2020 17:11:58 +0100 Subject: [PATCH] add new versions of alpine packages (not yet in alpine repo) --- contrib/packages/alpine/gnunet-gtk/APKBUILD | 4 +- contrib/packages/alpine/gnunet/APKBUILD | 17 +-- .../alpine/gnunet/gnunet-gns-proxy.initd | 107 ++++++++++++++++++ .../alpine/gnunet/gnunet.post-install | 28 ----- contrib/packages/alpine/gnurl/APKBUILD | 13 ++- 5 files changed, 128 insertions(+), 41 deletions(-) create mode 100644 contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd diff --git a/contrib/packages/alpine/gnunet-gtk/APKBUILD b/contrib/packages/alpine/gnunet-gtk/APKBUILD index c1963e0a9..463d2b698 100644 --- a/contrib/packages/alpine/gnunet-gtk/APKBUILD +++ b/contrib/packages/alpine/gnunet-gtk/APKBUILD @@ -5,7 +5,7 @@ pkgver=0.11.7 pkgrel=0 pkgdesc="Graphical user interface for GNUnet" url="https://gnunet.org" -arch="all" +arch="all !ppc64le" license="GPL-3.0-only" makedepends="gnunet-dev gtk+3.0-dev glade-dev" subpackages="$pkgname-dev $pkgname-doc" @@ -26,7 +26,7 @@ build() { } check() { - make DESTDIR="$pkgdir" check + make check } package() { diff --git a/contrib/packages/alpine/gnunet/APKBUILD b/contrib/packages/alpine/gnunet/APKBUILD index b8dd66958..eeccc2047 100644 --- a/contrib/packages/alpine/gnunet/APKBUILD +++ b/contrib/packages/alpine/gnunet/APKBUILD @@ -5,15 +5,16 @@ pkgver=0.12.0 pkgrel=0 pkgdesc="A framework for secure and privacy enhancing peer-to-peer networking" url="https://gnunet.org" -arch="all" +arch="all !ppc64le" license="AGPL-3.0-only" depends="gnutls-utils bash which iptables coreutils" depends_dev="libgpg-error-dev libgcrypt-dev nettle-dev unbound-dev gnutls-dev gnurl-dev libmicrohttpd-dev openssl-dev libunistring-dev libidn2-dev - nss-dev sqlite-dev zlib-dev miniupnpc-dev gmp-dev gettext openjpeg-dev" + nss-dev sqlite-dev zlib-dev miniupnpc-dev gmp-dev gettext openjpeg-dev + jansson-dev" makedepends="$depends_dev autoconf automake libtool gettext-dev python3 texlive texinfo" -install="$pkgname.pre-install $pkgname.post-install $pkgname.pre-deinstall" +install="$pkgname.pre-install $pkgname.post-install" pkgusers="gnunet" pkggroups="gnunet gnunetdns" subpackages="$pkgname-dev $pkgname-doc $pkgname-lang" @@ -23,7 +24,7 @@ source="https://mirrors.ocf.berkeley.edu/gnu/gnunet/gnunet-$pkgver.tar.gz gnunet-user.conf gnunet-system-services.initd gnunet-user-services.initd - gnunet.xsession + gnunet-gns-proxy.initd " build() { @@ -69,8 +70,8 @@ package() { $pkgdir/etc/init.d/$pkgname-system-services install -m755 -D $srcdir/$pkgname-user-services.initd \ $pkgdir/etc/init.d/$pkgname-user-services - install -m755 -D $srcdir/$pkgname.xsession \ - $pkgdir/etc/X11/xinit/xinitrc.d/80-$pkgname-user-services + install -m755 -D $srcdir/$pkgname-gns-proxy.initd \ + $pkgdir/etc/init.d/$pkgname-gns-proxy } dev() { @@ -82,9 +83,9 @@ dev() { $pkgdir/usr/bin/gnunet-config } -#sha512sums="3f066f72486fccd247045495e1072c3680f12109bfceae782a52892824639e2990e34054bfeebcc58bb8778069bfd8a9c1feba19e2d726f12b6128fc27004759 gnunet-0.11.8.tar.gz +sha512sums="42d778eb1a7847d84255581657c1d71d12bda54f4d33e60b7a389c498d9c830b0501fe4a83725f3aa452f88875a96d5856171a686c8738f5d4ee3de06860a079 gnunet-0.12.0.tar.gz a0f55413ed2c6edd6746a751d92ddac95ba70f20eefb07330817870d749456448f44bba95d245911a00f6078e0c2ac626004e3b764be5e5e049c00626c4c5ac0 gnunet-system.conf b21112ff16aee771332aa9c33f55b0c7f46fe0266053543241e3efbe25dba56482c0e11112a192eefe59f1c74d2af5d7071b6a4e1e875cfc7e9d55b5fe8a0a33 gnunet-user.conf 96ab78bb48d5fb10f0b34336ad05e73b543c4362c73436ef20b3bb83dff214e997acf38a2ea493b1901bdc37c8877d83cdaebd73a0e50831e2f23413c8edda76 gnunet-system-services.initd 3dc88aaedc3886c0795bdb4c8e259125232ba10f2bc762216c341bb3240ef0855cba968799ba121304463a65e73ed0f62dec03759a2be478ec4ac086361b49ba gnunet-user-services.initd -4fe1ed80cbaa4c140805bde2629fdb32b97f3273281ae7277c8988b4e490605652cdb9975fc1178169426f2279597c55f6e6b75b52315a426d78a1fedbb08401 gnunet.xsession" +19c9bb3fde1fe36dd53a6181ec0f08a00ed2871bca026832983cbbe6550e258c9f3166923f2b6715fc9edb5eb0dae38d2f497f54c8ba74fdb7c483608450fa4b gnunet-gns-proxy.initd" diff --git a/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd new file mode 100644 index 000000000..3c5a22ee2 --- /dev/null +++ b/contrib/packages/alpine/gnunet/gnunet-gns-proxy.initd @@ -0,0 +1,107 @@ +#!/sbin/openrc-run +# Contributor: xrs +# Maintainer: xrs + +name="gnunet-gns-proxy" +description="GNUnet GNS proxy for name resolution in Firefox/Chromium" +command_background="yes" +pidfile="/run/${SVCNAME}.pid" +users=`awk -F ':' '$3>=1000 && $3<2000 {print $1}' /etc/passwd` + +depend() { + need gnunet-user-services +} + +start() { + # Enable GNS proxy for existant users. + for user in $users; do + # Create/Renew GNS certificate authority (CA) per user. + su $user -c "gnunet-gns-proxy-setup-ca" + + # Customize gnunet.conf + port=$((8000+$(id -u $user))) + gnunet-config -c /home/$user/.config/gnunet.conf \ + --rewrite \ + --section=gns-proxy \ + --option=IMMEDIATE_START \ + --value=YES + gnunet-config -c /home/$user/.config/gnunet.conf \ + --rewrite \ + --section=gns-proxy \ + --option=OPTIONS \ + --value="-p $port" + + # Start gns-proxy + if test -z "`ps|grep $user|grep gnunet-gns-proxy`" > /dev/null 2>&1 + then + su $user -c "gnunet-arm \ + -c /home/$user/.config/gnunet.conf -i gns-proxy" + fi + + # Firefox + if [ ! -d /home/$user/.mozilla/firefox/*.default ];then + timeout 3s firefox --headless # dirty: create profile if not existent + fi + for ffprofile in /home/$user/.mozilla/firefox/*.*/; do + js=$ffprofile/user.js + if [ -f $js ]; then + sed -i '/Preferences for using the GNU Name System/d' $js + sed -i '/network.proxy.socks/d' $js + sed -i '/network.proxy.socks_port/d' $js + sed -i '/network.proxy.socks_remote_dns/d' $js + sed -i '/network.proxy.type/d' $js + fi + echo "// Preferences for using the GNU Name System" >> $js + echo "user_pref(\"network.proxy.socks\", \"localhost\");" >> $js + echo "user_pref(\"network.proxy.socks_port\", $port);" >> $js + echo "user_pref(\"network.proxy.socks_remote_dns\", true);" >> $js + echo "user_pref(\"network.proxy.type\", 1);" >> $js + done + + # Chromium + profile=/home/$user/.profile + if [ -f $profile ]; then + sed -i '/CHROMIUM_USER_FLAGS/d' $profile + fi + echo "export CHROMIUM_USER_FLAGS=--proxy-server=socks5://localhost:$port" \ + >> $profile + done +} + +stop() { + for user in $users; do + # Stop gns-proxy + if test "`ps|grep $user|grep gnunet-gns-proxy`" > /dev/null 2>&1 + then + su $user -c "gnunet-arm \ + -c /home/$user/.config/gnunet.conf -k gns-proxy" + fi + + # Disable gns-proxy in config + gnunet-config -c /home/$user/.config/gnunet.conf \ + --rewrite \ + --section=gns-proxy \ + --option=IMMEDIATE_START \ + --value=NO + + # Reset proxy preferences + for ffprofile in /home/$user/.mozilla/firefox/*.*/; do + for file in user.js prefs.js; do + js=$ffprofile/$file + if [ -f $js ]; then + sed -i '/Preferences for using the GNU Name System/d' $js + sed -i '/network.proxy.socks/d' $js + sed -i '/network.proxy.socks_port/d' $js + sed -i '/network.proxy.socks_remote_dns/d' $js + sed -i '/network.proxy.type/d' $js + fi + done + done + + # Chromium + profile=/home/$user/.profile + if [ -f $profile ]; then + sed -i '/CHROMIUM_USER_FLAGS/d' $profile + fi + done +} diff --git a/contrib/packages/alpine/gnunet/gnunet.post-install b/contrib/packages/alpine/gnunet/gnunet.post-install index f7c19b26f..da4763919 100644 --- a/contrib/packages/alpine/gnunet/gnunet.post-install +++ b/contrib/packages/alpine/gnunet/gnunet.post-install @@ -9,32 +9,4 @@ for user in $users; do /home/$user/.config/gnunet.conf done -# Enable GNS proxy for users, if desired. -echo "Use GNU Name System in Firefox/Chromium by default? [y,N]" -read -r yn -case $yn in -y|Y ) - # Enable GNS proxy for existant users. - for user in $users; do - port=$((8000+$(id -u $user))) - gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ - --section=gns-proxy \ - --option=IMMEDIATE_START \ - --value=YES - gnunet-config -c /home/$user/.config/gnunet.conf \ - --rewrite \ - --section=gns-proxy \ - --option=OPTIONS \ - --value="-p $port" - done - - # Enable GNS proxy for future users. - echo "[gns-proxy]" >> /etc/skel/.config/gnunet.conf - echo "IMMEDIATE_START = YES" >> /etc/skel/.config/gnunet.conf - ;; -* ) - ;; -esac - exit 0 diff --git a/contrib/packages/alpine/gnurl/APKBUILD b/contrib/packages/alpine/gnurl/APKBUILD index 52373f1bc..c73cf5360 100644 --- a/contrib/packages/alpine/gnurl/APKBUILD +++ b/contrib/packages/alpine/gnurl/APKBUILD @@ -1,3 +1,4 @@ +# Contributor: Jakub Jirutka # Contributor: xrs # Maintainer: xrs pkgname=gnurl @@ -7,7 +8,6 @@ pkgdesc="curl with only HTTP/HTTPS support and GnuTLS" url="https://gnunet.org/en/gnurl.html" arch="all" license="MIT" -#depends="ca-certificates gnutls libidn2 zlib" depends="ca-certificates" depends_dev="gnutls-dev libidn2-dev zlib-dev" makedepends="$depends_dev autoconf automake libtool perl pkgconf python3" @@ -42,7 +42,6 @@ build() { --without-winssl \ --without-darwinssl \ --disable-sspi \ - --disable-ntlm-wb \ --disable-ldap \ --disable-rtsp \ --disable-dict \ @@ -55,7 +54,15 @@ build() { --disable-file \ --disable-ftp \ --disable-smb \ - --disable-ares + --disable-ntlm-wb \ + --with-libz \ + --without-ca-fallback \ + --without-gssapi \ + --disable-valgrind \ + --without-ngtcp2 \ + --without-nghttp2 \ + --without-nghttp3 \ + --without-quiche make } -- 2.25.1