# $Id: PKGBUILD 109992 2014-04-22 18:52:54Z guillaume $
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: fancris3 <fancris3 at gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=terminator
pkgver=0.97
pkgrel=2
pkgdesc='Terminal emulator that supports tabs and grids'
arch=('any')
url='http://gnometerminator.blogspot.fr/p/introduction.html'
license=('GPL2')
# Note: the package named 'vte3' is actually vte for GTK 3
# and terminator seems to require vte for GTK 2
depends=('vte' 'pygtk' 'xdg-utils' 'python2-notify' 'python2-keybinder2')
makedepends=('desktop-file-utils' 'gettext' 'intltool')
install=terminator.install
source=("http://launchpad.net/terminator/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz")
sha256sums=('9131847023fa22f11cf812f6ceff51b5d66d140b6518ad41d7fa8b0742bfd3f7')

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    # python2 fix
    for file in terminatorlib/{,plugins/}*.py; do
        sed -i 's_#!/usr/bin/python_#!/usr/bin/python2_' $file
        sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' $file
    done

    python2 setup.py build
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    python2 setup.py install --skip-build --root="${pkgdir}"

    rm -f "${pkgdir}/usr/share/icons/hicolor/icon-theme.cache"
}
