summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD58
1 files changed, 58 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e055a38c1747
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Astro Benzene <universebenzene at sina dot com>
+pkgbase=python-extinction
+_pyname=${pkgbase#python-}
+pkgname=("python-${_pyname}" "python2-${_pyname}")
+pkgver=0.4.0
+pkgrel=1
+pkgdesc="Fast interstellar dust extinction laws in Python"
+arch=('i686' 'x86_64')
+url="http://extinction.readthedocs.io/"
+license=('MIT')
+makedepends=('python-setuptools' 'python2-setuptools' 'python-numpy' 'python2-numpy')
+#checkdepends=('python-pytest' 'python2-pytest')
+source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz")
+md5sums=('f67c418793a4b44b4075af6d2f9b742b')
+
+prepare() {
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ cp -a ${srcdir}/${_pyname}-${pkgver}{,-py2}
+}
+
+build() {
+ msg "Building Python2"
+ cd ${srcdir}/${_pyname}-${pkgver}-py2
+ python2 setup.py build
+
+ msg "Building Python3"
+ cd ${srcdir}/${_pyname}-${pkgver}
+ python setup.py build
+}
+
+check() {
+ msg "Checking Python3"
+ cd ${srcdir}/${_pyname}-${pkgver}
+ python setup.py test
+
+ msg "Checking Python2"
+ cd ${srcdir}/${_pyname}-${pkgver}-py2
+ python2 setup.py test
+}
+
+package_python2-extinction() {
+ depends=('python2-numpy')
+ cd ${srcdir}/${_pyname}-${pkgver}-py2
+
+ install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
+ python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+}
+
+package_python-extinction() {
+ depends=('python-numpy')
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
+ python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+}