[skip-ci] ufw: update to 0.36

This commit is contained in:
Jeff Huang 2018-12-25 04:09:16 +01:00
parent 63c1f5ece1
commit dce61cce60
3 changed files with 20 additions and 27 deletions

View File

@ -1,6 +1,6 @@
pkgname=ufw
pkgver=0.35
pkgrel=2
pkgver=0.36
pkgrel=1
pkgdesc="Uncomplicated and easy to use CLI tool for managing a netfilter firewall"
arch=('x86_64')
url="https://launchpad.net/ufw"
@ -17,26 +17,29 @@ backup=('etc/ufw/before.rules'
'etc/ufw/user.rules'
'etc/ufw/user6.rules')
categories=('network')
install=${pkgname}.install
source=("https://launchpad.net/ufw/${pkgver}/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"
"${pkgname}.service")
sha256sums=('662f865bc83bf8aa1a40a6fe578bc2ce796ff60a1be2c1103def7db1b91f8509'
'39ccb104137be8a8e47c66a9b23adec209acecc6ac0ab4f2ef5f84770937f86f')
sha256sums=('754b22ae5edff0273460ac9f57509c3938187e0cf4fb9692c6a02833fff33cfc'
'fdface6f4690e4748fbbd5661c02e1967a8750fdb23581d35516174017a3fe39')
prepare() {
cd "$pkgname-$pkgver"
# FS#28769 - move from /lib to /usr/lib
sed -i -e 's|/lib|/usr/lib|' \
-e 's|sbin|bin|g' setup.py
# FS#35458, FS#54110 - correct iptables location
sed -i -e 's|sbin|bin|g' setup.py
sed -i -e 's|sbin|bin|g' src/util.py
}
package() {
cd "$pkgname-$pkgver"
# Move from /lib to /usr/lib
sed -i -e 's|/lib|/usr/lib|' \
-e 's|sbin|bin|g' setup.py
python3 setup.py install --root="$pkgdir"
rm -rf ${pkgdir}/usr/lib/python3.6/site-packages/ufw/__pycache__
# Correct iptables location
sed -i -e 's|sbin|bin|g' "$pkgdir/usr/lib/python3.6/site-packages/ufw/"*
install -Dm644 "$srcdir/ufw.service" "$pkgdir/usr/lib/systemd/system/ufw.service"
chmod 644 "$pkgdir/etc/ufw/"*.rules
}

View File

@ -1,13 +0,0 @@
post_upgrade() {
if [ "$(vercmp $2 0.35-1)" -lt 0 ]; then
echo ">>>"
echo ">>> IMPORTANT UFW UPGRADE NOTICE"
echo ">>> ----------------------------"
echo ">>> Version 0.35 has moved several config files."
echo ">>> You may need to copy your versions of the files"
echo ">>> to the new location."
echo ">>> /usr/lib/ufw/user.rules.pacsave -> /etc/ufw/user.rules"
echo ">>> /usr/lib/ufw/user6.rules.pacsave -> /etc/ufw/user6.rules"
echo ">>>"
fi
}

View File

@ -1,13 +1,16 @@
[Unit]
Description=CLI Netfilter Manager
DefaultDependencies=no
Before=network.target
After=systemd-sysctl.service
Before=sysinit.target
ConditionPathExists=|/etc/ufw/ufw.conf
ConditionDirectoryNotEmpty=|/usr/lib/ufw
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/ufw/ufw-init start
ExecStop=/usr/lib/ufw/ufw-init stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target