# $Id: PKGBUILD 369167 2018-08-06 08:09:48Z foutrelis $
# Maintainer: Alad Wenter <alad@mailbox.org>
# Contributor: willemw <willemw12@gmail.com>
# Contributor: Anntoin Wilkinson <anntoin gmail com>

pkgbase=python-i3-py
pkgname=('python-i3-py' 'python2-i3-py')
pkgver=0.6.5
# https://github.com/ziberna/i3-py/issues/22
_commit=27f88a616e9ecc340e7d041d3d00782f8a1964c1
pkgrel=6
pkgdesc="tools for i3 users and developers"
arch=('any')
url='https://github.com/ziberna/i3-py'
license=('GPL3' 'custom:WTFPL2')
makedepends=('git' 'python' 'python2')
source=("$pkgbase::git+https://github.com/ziberna/i3-py#commit=$_commit"
        'LICENSE::http://www.wtfpl.net/txt/copying/')
md5sums=('SKIP'
         '8365d07beeb5f39d87e846dca3ae7b64')

prepare() {
    cp -a "$pkgbase" "$pkgbase"-python2
}

build() {
    cd "$pkgbase"
    python setup.py build

    cd ../"$pkgbase"-python2
    python2 setup.py build
}

package_python-i3-py() {
    depends=('python' 'i3-wm')

    cd "$pkgbase"
    python setup.py install --root="$pkgdir/" --optimize=1

    install -Dm644 "$srcdir"/LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
    install -Dm644 examples/*.py -t "$pkgdir"/usr/share/"$pkgname"/examples
}

package_python2-i3-py() {
    depends=('python2' 'i3-wm')

    cd "$pkgbase"-python2
    python2 setup.py install --root="$pkgdir/" --optimize=1

    install -Dm644 "$srcdir"/LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
    install -Dm644 examples/*.py -t "$pkgdir"/usr/share/"$pkgname"/examples
}

# vim: set et sw=4 sts=4 ft=sh:
