#Packager: George Vlahavas pkgname=gui-ufw pkgver=22.04 pkgrel=1gv source=("https://github.com/costales/gufw/archive/refs/tags/$pkgver.tar.gz") docs=("authors" "install" "readme.md" "copying.gpl3") url=https://github.com/costales/gufw options=("noautodotnew") slackdesc=\ ( #|-----handy-ruler------------------------------------------------------| "gui-ufw (Linux Firewall frontend)" "gui-ufw, or gufw, is a graphical user interface for ufw, the" "Uncomplicated Firewall." ) build() { cd $startdir/src/gufw-$pkgver PYVER="$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')" python3 setup.py build # required so desktop, icon and translation files get installed export XDG_RUNTIME_DIR="$(mktemp -d --tmpdir gufw-build-XXXXXXXXX)" python3 setup.py install --prefix=/usr --root=$startdir/pkg # no need for the scripts in /usr/bin rm -rf $startdir/pkg/usr/bin # make the script executable... chmod 755 $startdir/pkg/usr/lib${LIBDIRSUFFIX}/python${PYVER}/site-packages/gufw/gufw.py # let's make a symlink for the python executable in /usr/sbin mkdir -p $startdir/pkg/usr/sbin ( cd $startdir/pkg/usr/sbin ln -sf ../lib${LIBDIRSUFFIX}/python${PYVER}/site-packages/gufw/gufw.py gufw ) # and now change the .desktop file to use gksu too sed -i "s/^Exec=.*/Exec=gksu gufw/" $startdir/pkg/usr/share/applications/gufw.desktop # it should really be under the System category sed -i "s/^Categories=.*/Categories=Application;System;/" $startdir/pkg/usr/share/applications/gufw.desktop # polkit stuff is not really needed since we're using gksu rm -rf $startdir/pkg/usr/share/polkit-1 }