mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-26 15:32:15 +08:00
45 lines
1.4 KiB
Bash
45 lines
1.4 KiB
Bash
pkgname=ufw
|
|
pkgver=0.34rc
|
|
_pkgver=0.34~rc
|
|
pkgrel=1
|
|
pkgdesc="Uncomplicated and easy to use CLI tool for managing a netfilter firewall"
|
|
arch=('x86_64')
|
|
url="https://launchpad.net/ufw"
|
|
license=('GPL3')
|
|
depends=('iptables' 'python3')
|
|
backup=('etc/ufw/before.rules'
|
|
'etc/ufw/before6.rules'
|
|
'etc/ufw/after.rules'
|
|
'etc/ufw/after6.rules'
|
|
'etc/ufw/ufw.conf'
|
|
'etc/ufw/user.rules'
|
|
'etc/ufw/sysctl.conf'
|
|
'etc/default/ufw'
|
|
'usr/lib/ufw/user.rules'
|
|
'usr/lib/ufw/user6.rules')
|
|
categories=('network')
|
|
source=("https://launchpad.net/ubuntu/+archive/primary/+files/ufw_${_pkgver}.orig.tar.gz"
|
|
"${pkgname}.service")
|
|
sha256sums=('9d2f2609fa7510fb19661feeb725e08c8c21f8e6597c5d8e7b5851272c1d7d5c'
|
|
'39ccb104137be8a8e47c66a9b23adec209acecc6ac0ab4f2ef5f84770937f86f')
|
|
|
|
package() {
|
|
cd "${srcdir}/${pkgname}-${_pkgver}"
|
|
|
|
sed -e 's|/lib|/usr/lib|' -i setup.py
|
|
python3 setup.py install --root="${pkgdir}"
|
|
|
|
# Install systemd unit
|
|
install -D -m644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
|
|
|
|
# Move ufw to /usr/bin
|
|
install -D -m755 "${pkgdir}/usr/sbin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
|
rm -rf "${pkgdir}/usr/sbin"
|
|
|
|
# Fix permissions
|
|
chmod 644 "${pkgdir}/etc/ufw"/*.rules "${pkgdir}/usr/lib/ufw"/*.rules
|
|
|
|
# Absolute paths are bad!
|
|
sed -e 's#/bin/echo#echo#g' -i "${pkgdir}/usr/lib/ufw/ufw-init-functions"
|
|
}
|