# Contributor: Fabian Affolter # Maintainer: Fabian Affolter setglobal pkgname = 'py-nwdiag' setglobal _pkgname = 'nwdiag' setglobal pkgver = '1.0.4' setglobal pkgrel = '2' setglobal pkgdesc = '"A Python tool to generate network-diagram image'" setglobal url = '"https://pypi.python.org/pypi/nwdiag'" setglobal arch = '"noarch'" setglobal license = '"ASL 2.0'" setglobal depends = '"py-pillow py-funcparserlib py-blockdiag'" setglobal makedepends = '"python2-dev python3-dev py-setuptools'" setglobal subpackages = ""py2-$(pkgname#py-):_py2 py3-$(pkgname#py-):_py3"" setglobal source = ""https://files.pythonhosted.org/packages/source/$(_pkgname:0:1)/$_pkgname/$_pkgname-$pkgver.tar.gz"" setglobal builddir = ""$srcdir"/$_pkgname-$pkgver" proc prepare { local i cd $builddir for i in [$source] { match $i { with *.patch msg $i; patch -p1 -i "$srcdir"/$i || return 1 } } } proc build { cd $builddir python2 setup.py build || return 1 python3 setup.py build || return 1 } proc package { mkdir -p $pkgdir } proc _py2 { setglobal replaces = $pkgname setglobal depends = $(depends//py-/py2-) _py python2 } proc _py3 { setglobal depends = $(depends//py-/py3-) _py python3 } proc _py { local python="$1" setglobal pkgdesc = ""$pkgdesc (for $python)"" setglobal depends = ""$depends $python"" setglobal install_if = ""$pkgname=$pkgver-r$pkgrel $python"" cd $builddir $python setup.py install --prefix=/usr --root="$subpkgdir" } setglobal md5sums = '"0d2ff1348aeff53aaf08838d0fa2c001 nwdiag-1.0.4.tar.gz'" setglobal sha256sums = '"002565875559789a2dfc5f578c07abdf44269c3f7cdf78d4809bdc4bdc2213fa nwdiag-1.0.4.tar.gz'" setglobal sha512sums = '"755493fb8425243117e11d06e7657c9cae44a8c72bc1fbf515a7f38670307fca43bf46c3017b32aa66eece4f389379abb12fcb4914c33fd58e3bb6eff3361f2f nwdiag-1.0.4.tar.gz'"