# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Michał Masłowski <mtjm@mtjm.eu>

pkgname=h-client
pkgver=0.0a0.dev134
pkgrel=1
epoch=1
pkgdesc="A client for an h-source server (such as https://www.h-node.org/)"
arch=('any')
url="https://savannah.nongnu.org/projects/h-client/"
license=('GPL3')
depends=('python2' 'python2-distribute' 'python2-pycurl' 'pygtk' 'pciutils' 'usbutils')
makedepends=('subversion')
options=(!emptydirs)
source=("svn+http://svn.savannah.nongnu.org/svn/${pkgname}/trunk/${pkgname}"
        'h-client-fix_test.patch')
sha256sums=('SKIP'
            'df842c88bb5bcf6a97db1e2ea813f7f968d9b2e8460a16a4359d62240eb44d1a')

prepare() {
  cd "$srcdir/${pkgname}"
  sed -i "s/dev/dev134/g" setup.cfg
  sed -i "s/tag_svn_revision = 1//g" setup.cfg
  sed -i "s/'h-node.org'/'https:\/\/h-node.org'/g" hclient/gtkclient.py
  patch -Np1 -i "$srcdir/h-client-fix_test.patch"
}

build() {
  cd "$srcdir/${pkgname}"
  make
}

check() {
  cd "$srcdir/${pkgname}"
  python2 setup.py test
}

package() {
  cd "$srcdir/${pkgname}"
  python2 setup.py install --root="$pkgdir/" --optimize=1
  make DESTDIR="$pkgdir" prefix=/usr install-data
}

# vim:set ts=2 sw=2 et:
