summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO35
-rw-r--r--.gitignore7
-rw-r--r--PKGBUILD76
-rw-r--r--fix_doc_warning.patch11
4 files changed, 129 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..857408bd1b6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,35 @@
+pkgbase = python-pysynphot
+ pkgdesc = Python Synthetic Photometry Utilities
+ pkgver = 0.9.14
+ pkgrel = 1
+ url = http://pysynphot.readthedocs.io/
+ arch = i686
+ arch = x86_64
+ license = BSD
+ makedepends = python-setuptools
+ makedepends = python2-setuptools
+ makedepends = python-astropy
+ makedepends = python2-numpy
+ makedepends = python-sphinx
+ makedepends = python-sphinx_rtd_theme
+ makedepends = python-beautifulsoup4
+ source = https://files.pythonhosted.org/packages/source/p/pysynphot/pysynphot-0.9.14.tar.gz
+ source = fix_doc_warning.patch
+ md5sums = fe4d19b92cb22673b872015377758d30
+ md5sums = b97a899082172969f014b1f7ffe45bd0
+
+pkgname = python-pysynphot
+ depends = python-numpy>=1.9
+ depends = python-astropy>=1.1
+ optdepends = python-matplotlib: Plotting support
+ optdepends = python-pysynphot-doc: Documentation for PySynphot
+
+pkgname = python2-pysynphot
+ depends = python2-numpy>=1.9
+ depends = python2-astropy>=1.1
+ optdepends = python2-matplotlib: Plotting support
+ optdepends = python-pysynphot-doc: Documentation for PySynphot
+
+pkgname = python-pysynphot-doc
+ pkgdesc = Documentation for pysynphot
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..1df7b618a7b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+src
+pkg
+*.src.tar.gz
+*.tar.gz
+*.tar.bz2
+*.part
+*.pkg.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..4367cfe2b58
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,76 @@
+# Maintainer: Astro Benzene <universebenzene at sina dot com>
+pkgbase=python-pysynphot
+_pyname=${pkgbase#python-}
+pkgname=("python-${_pyname}" "python2-${_pyname}" "python-${_pyname}-doc")
+pkgver=0.9.14
+pkgrel=1
+pkgdesc="Python Synthetic Photometry Utilities"
+arch=('i686' 'x86_64')
+url="http://pysynphot.readthedocs.io/"
+license=('BSD')
+makedepends=('python-setuptools' 'python2-setuptools' 'python-astropy' 'python2-numpy' 'python-sphinx' 'python-sphinx_rtd_theme' 'python-beautifulsoup4')
+#checkdepends=('python-pytest-remotedata')
+source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
+ 'fix_doc_warning.patch')
+md5sums=('fe4d19b92cb22673b872015377758d30'
+ 'b97a899082172969f014b1f7ffe45bd0')
+
+prepare() {
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ patch -Np1 -i "${srcdir}/fix_doc_warning.patch"
+ 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
+
+ msg "Building Docs"
+ python setup.py build_sphinx
+}
+
+#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-pysynphot() {
+ depends=('python2-numpy>=1.9' 'python2-astropy>=1.1')
+ optdepends=('python2-matplotlib: Plotting support'
+ 'python-pysynphot-doc: Documentation for PySynphot')
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE.md
+ install -D -m644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.rst
+ python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+}
+
+package_python-pysynphot() {
+ depends=('python-numpy>=1.9' 'python-astropy>=1.1')
+ optdepends=('python-matplotlib: Plotting support'
+ 'python-pysynphot-doc: Documentation for PySynphot')
+ cd ${srcdir}/${_pyname}-${pkgver}
+
+ install -D -m644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE.md
+ install -D -m644 -t "${pkgdir}/usr/share/doc/${pkgname}" README.rst
+ python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
+}
+
+package_python-pysynphot-doc() {
+ pkgdesc="Documentation for pysynphot"
+ cd ${srcdir}/${_pyname}-${pkgver}/build/sphinx
+
+ install -d -m755 "${pkgdir}/usr/share/doc/${pkgbase}"
+ cp -a html "${pkgdir}/usr/share/doc/${pkgbase}"
+}
diff --git a/fix_doc_warning.patch b/fix_doc_warning.patch
new file mode 100644
index 00000000000..819b038084c
--- /dev/null
+++ b/fix_doc_warning.patch
@@ -0,0 +1,11 @@
+--- a/doc/source/index.rst 2019-08-21 06:17:51.000000000 +0800
++++ b/doc/source/index.rst 2019-08-28 13:46:14.237270062 +0800
+@@ -62,7 +62,7 @@
+
+ If missing, the following dependencies must also be installed:
+
+-* `astropy https://pypi.org/project/astropy/>`_ 1.1 or greater
++* `astropy <https://pypi.org/project/astropy/>`_ 1.1 or greater
+ * `numpy <https://pypi.org/project/numpy/>`_ 1.9 or greater
+ * `matplotlib <https://matplotlib.org/>`_ (optional)
+