summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c3bf29dcc91c8170a1c6fe958d16161ae29baef7 (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
# Maintainer: Astro Benzene <universebenzene at sina dot com>
pkgname=python2-sherpa
_pyname=${pkgname#python2-}
pkgver=4.11.0
pkgrel=1
pkgdesc="Modeling and fitting package for scientific data analysis"
arch=('i686' 'x86_64')
url="http://cxc.cfa.harvard.edu/contrib/sherpa/"
license=('GPL')
depends=('python2>=2.7' 'python2-numpy' 'fftw')
makedepends=('python2-setuptools')
#'gcc-fortran')
optdepends=('python2-matplotlib: Graphical output'
            'python2-astropy: Data I/O support'
            'ds9: Imaging requires'
            'xpa: Imaging requires'
            'python2-pytest>=3.3: For testing suite'
            'python2-mock: For testing suite'
            'python2-pytest-xvfb: For testing suite'
            'python-sherpa-doc: Documentation for Sherpa')
install=python2-sherpa.install
source=("https://files.pythonhosted.org/packages/source/${_pyname:0:1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
        'sherpa_local_fftw.patch')
md5sums=('43a8b284712a7a1e22a00447a486a93e'
         'd1823cc7683442d92450fadff7aed362')

prepare() {
    cd ${srcdir}/${_pyname}-${pkgver}

    patch -Np1 -i "${srcdir}/sherpa_local_fftw.patch"
}

package() {
#   unset LDFLAGS
    cd ${srcdir}/${_pyname}-${pkgver}

    install -D -m644 {README.md,CITATION} -t "${pkgdir}/usr/share/doc/${pkgname}"
    install -D -m644 notebooks/SherpaQuickStart.ipynb -t "${pkgdir}/usr/share/doc/${pkgname}/notebooks"
    install -D -m644 COPYRIGHT -t "${pkgdir}/usr/share/licenses/${pkgname}"
    python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
    rm ${pkgdir}/usr/lib/python2.7/site-packages/sherpa-${pkgver}-py2.7.egg-info/SOURCES.txt

    mv ${pkgdir}/usr/bin/sherpa_smoke{,2}
    mv ${pkgdir}/usr/bin/sherpa_test{,2}
}