# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Florian Loitsch <archlinux@florian.loitsch.com>

pkgbase=miniupnpc
pkgname=(miniupnpc python-miniupnpc)
pkgver=2.3.0
pkgrel=1
pkgdesc='Small UPnP client library/tool to access Internet Gateway Devices'
url='https://miniupnp.tuxfamily.org/'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('BSD')
makedepends=('sh' 'glibc' 'lsb-release' 'python' 'python-setuptools')
source=(http://miniupnp.free.fr/files/miniupnpc-${pkgver}.tar.gz{,.sig})
sha512sums=('63efda015c7f693499a6f1f28b8356c4bb05ed0354fe2fb79042295607bf4f12c15082a48ced348ca5647fca9d83b99068c28311623f46225e9b09b5dc23a290'
            'SKIP')
b2sums=('a5a2d22d99eb9f20fcb0b61107db61b97fec8207f5d8079c7d8e1d7bbc73478c3b575c7ecf32cb3ffe64f82a93673ab1f734139755c512d48439358e314e8762'
        'SKIP')
validpgpkeys=(
  '751E9FF6944A3B36A5432216DB511043A31ACAAF' # miniupnp (miniupnp !) <miniupnp@free.fr>
)

build() {
  cd ${pkgname}-${pkgver}
  make
  python setup.py build
}

check() {
  cd ${pkgname}-${pkgver}
  make test
}

package_miniupnpc() {
  depends=(sh glibc)
  provides=(libminiupnpc.so)

  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -Dm 644 man3/miniupnpc.3 -t "${pkgdir}/usr/share/man/man3"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

package_python-miniupnpc() {
  pkgdesc='Python bindings for miniupnpc'
  depends=(python glibc)

  cd ${pkgbase}-${pkgver}
  python setup.py install --optimize=1 --skip-build --root="$pkgdir"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
