From 58fd03f656f94a9c29da35cbf6781e1f37a2fa99 Mon Sep 17 00:00:00 2001 From: TBK Date: Mon, 15 Apr 2019 17:15:12 +0200 Subject: testing/ufw: upgrade to 0.36 - Modernize APKBUILD - Add openrc subpkg - Add bash-completion sugpkg --- testing/ufw/APKBUILD | 51 +++++++++++++++++++++++++----------------- testing/ufw/fix-lib_path.patch | 11 +++++++++ testing/ufw/ufw.initd | 2 +- 3 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 testing/ufw/fix-lib_path.patch (limited to 'testing/ufw') diff --git a/testing/ufw/APKBUILD b/testing/ufw/APKBUILD index 7126524a0b..34184698ae 100644 --- a/testing/ufw/APKBUILD +++ b/testing/ufw/APKBUILD @@ -1,33 +1,42 @@ # Contributor: Danilo Falcão # Contributor: Bartłomiej Piotrowski # Maintainer: - pkgname=ufw -pkgver=0.35 -pkgrel=1 -pkgdesc='Uncomplicated CLI tool managing a netfilter firewall' -url='https://launchpad.net/ufw' -arch='noarch' +pkgver=0.36 +pkgrel=0 +pkgdesc="Uncomplicated CLI tool managing a netfilter firewall" +url="https://launchpad.net/ufw" +arch="noarch" license="GPL-3.0-or-later" -depends="iptables ip6tables python2" -makedepends='' -subpackages="$pkgname-doc" +options="!check" # 3 tests fails +depends="iptables ip6tables python3" +subpackages="$pkgname-doc $pkgname-openrc $pkgname-bash-completion:bashcomp:noarch" source="https://launchpad.net/$pkgname/$(echo $pkgver|cut -c1-4)/$pkgver/+download/$pkgname-$pkgver.tar.gz - $pkgname.initd" + $pkgname.initd + fix-lib_path.patch + " + +check() { + sh run_tests.sh +} package() { - cd "$srcdir"/$pkgname-$pkgver + python3 setup.py install --root="$pkgdir" + + install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + chmod 644 "$pkgdir"/etc/ufw/*.rules +} - sed -e 's|/lib|/usr/lib|' -i setup.py || return 1 - python2 setup.py install --root="$pkgdir" +bashcomp() { + depends="" + pkgdesc="Bash completions for $pkgname" + install_if="$pkgname=$pkgver-r$pkgrel bash-completion" - install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname || return 1 - chmod 644 "$pkgdir"/etc/ufw/*.rules || return 1 + mkdir -p "$subpkgdir"/usr/share/bash-completion/completions + install -m 644 "$builddir"/shell-completion/bash \ + "$subpkgdir"/usr/share/bash-completion/completions/ufw } -md5sums="b7cd2dd4e4e98e46df125fee06edff92 ufw-0.35.tar.gz -7bf1a3dee43b294bda8f2025e04164ce ufw.initd" -sha256sums="662f865bc83bf8aa1a40a6fe578bc2ce796ff60a1be2c1103def7db1b91f8509 ufw-0.35.tar.gz -fe2a2b85c22b86fdefb28b9114f8cdca1f49d3fc1745b508addc873dccbd6e5e ufw.initd" -sha512sums="b36c82559910634505648f717d19eb5a0cb1ce739a804359087e74c966869d0375c4ed5811954b32d2b5b51866f6ae1bec62a4a464f226b2eecc56b096f303fc ufw-0.35.tar.gz -cd7165270b3eb38472f9fc8aec15b0c578c0a88f8e5d6bf285fdb62b32958826182f60fda897a60f551e360c0efa1091a8d442f8ba87e7080cfa63cc7b2cdca7 ufw.initd" +sha512sums="b32d7f79f43c203149c48b090ee0d063df78fcf654344ee11066a7363e799a62b046758ffe02b8bd15121545ac2a6b61df21fe56f8b810319fe4dd562cbdadb3 ufw-0.36.tar.gz +b0405525a22bfa70f656ec3685a0aa509645d52771465a3fc068e789cd4bbf86e8409cb4021200794729dcba3c10c99d5c2ba06ae91eca9e3b942a407525e6d5 ufw.initd +86b29ff76f6d858cacdf677be5e08daad0b203a27b65ea40da69e11a97d66d93bd60690ee2563b26d8e6b1e89e7fc72d76ebb15dff9e5a38080cb9a799e96f16 fix-lib_path.patch" diff --git a/testing/ufw/fix-lib_path.patch b/testing/ufw/fix-lib_path.patch new file mode 100644 index 0000000000..aff9826989 --- /dev/null +++ b/testing/ufw/fix-lib_path.patch @@ -0,0 +1,11 @@ +--- a/setup.py ++++ b/setup.py +@@ -55,7 +55,7 @@ + return + + real_confdir = os.path.join('/etc') +- real_statedir = os.path.join('/lib', 'ufw') ++ real_statedir = os.path.join('/usr/lib', 'ufw') + real_prefix = self.prefix + if self.home != None: + real_confdir = self.home + real_confdir diff --git a/testing/ufw/ufw.initd b/testing/ufw/ufw.initd index eea4fb7c66..0438058996 100644 --- a/testing/ufw/ufw.initd +++ b/testing/ufw/ufw.initd @@ -1,4 +1,4 @@ -#!/sbin/runscript +#!/sbin/openrc-run # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-firewall/ufw/files/ufw-2.initd,v 1.1 2011/07/24 11:18:22 pva Exp $ -- cgit v1.2.3