summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b410575c0265240377c45561aa262912b9da92db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Astro Benzene <universebenzene at sina dot com>
pkgbase=python-stsci.sphinxext
_pyname=${pkgbase#python-}
pkgname=("python-${_pyname}" "python2-${_pyname}")
pkgver=1.2.1
pkgrel=2
pkgdesc="A set of tools and templates to customize Sphinx for use in STScI projects"
arch=('i686' 'x86_64')
url="http://www.stsci.edu/institute/software_hardware/pyraf/stsci_python"
license=('BSD' 'LPPL')
makedepends=('python-setuptools' 'python2-setuptools' 'python-d2to1' 'python2-d2to1' 'python-stsci.distutils' 'python2-stsci.distutils')
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
        'fix_new_sphinx.patch')
md5sums=('d23f6ad057a4af86a6ce3771bddb1754'
         'fafd43af38820f2c7ea301287909e16e')

prepare() {
    cd ${srcdir}/${_pyname}-${pkgver}
    patch -Np1 -i "${srcdir}/fix_new_sphinx.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
}

check() {
#   cd ${srcdir}/${_pyname}-${pkgver}
#   msg "Checking Python3"
#   python setup.py test

#   msg "Checking Python2"
    cd ${srcdir}/${_pyname}-${pkgver}-py2
    python2 setup.py test
}

package_python2-stsci.sphinxext() {
    depends=('python2' 'python2-sphinx>=0.6.3' 'python2-numpydoc' 'python2-matplotlib')
    cd ${srcdir}/${_pyname}-${pkgver}-py2

    install -D -m644 LICENSE* -t "${pkgdir}/usr/share/licenses/${pkgname}"
    install -D -m644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
    python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
}

package_python-stsci.sphinxext() {
    depends=('python')
    depends=('python' 'python-sphinx>=0.6.3' 'python-numpydoc' 'python-matplotlib')
    optdepends=('python-sphinx>=0.6.3'
                'python-numpydoc: Provides support for Numpy-style docstring syntax'
                'python-matplotlib: Provides matplotlib extensions for inline plotting')
    cd ${srcdir}/${_pyname}-${pkgver}

    install -D -m644 LICENSE* -t "${pkgdir}/usr/share/licenses/${pkgname}"
    install -D -m644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
    python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
}