# $Id: PKGBUILD 113905 2014-07-01 09:18:17Z flexiondotorg $
# Maintainer : Martin Wimpress <code@flexion.org>

pkgname=gufw
pkgver=14.10.0
pkgrel=1
pkgdesc="An uncomplicated way to manage your Linux firewall."
arch=('any')
url="http://gufw.org"
license=('GPL3')
depends=('gnome-icon-theme-symbolic' 'gtk3' 'polkit' 'python2-gobject'
         'python2-netifaces' 'ufw' 'webkitgtk')
optdepends=('polkit-gnome: run from the menu in GNOME shell/flashback'
            'lxpolkit: run from the menu in LXDE'
            'mate-polkit: run from the menu in MATE')
makedepends=('intltool' 'python2-distutils-extra')
source=("https://launchpad.net/gui-ufw/gufw-14.10/14.10/+download/gui-ufw-${pkgver}.tar.gz")
sha1sums=('3c140e3591e4c05b04118416eb2f9181fe4c6971')
install=${pkgname}.install

prepare() {
    cd "${srcdir}/gui-ufw-${pkgver}"
    sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/env python2|" \
           -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
              $(find . -name '*.py')
    sed -i "s|python ${LOCATIONS[${i}]}|python2 ${LOCATIONS[${i}]}|" bin/gufw
    sed -i "s|python ${LOCATIONS[${i}]}|python2 ${LOCATIONS[${i}]}|" bin/gufw-pkexec
}

package(){
    cd "${srcdir}/gui-ufw-${pkgver}"
    export XDG_RUNTIME_DIR="/tmp/${pkgname}"
    python2 ./setup.py install --root="${pkgdir}"
}
