# $Id: PKGBUILD 108762 2014-04-02 21:59:41Z flexiondotorg $
# Maintainer : Martin Wimpress <code@flexion.org>

pkgname=gufw
pkgver=14.04.2
pkgrel=2
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.04/14.04/+download/gui-ufw-${pkgver}.tar.gz")
md5sums=('51950602cf058fe8a3858762e19c8624')
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}"
    python2 ./setup.py build install --root="${pkgdir}"
}
