summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bf87489aea22f575d504dcda04f143186ca13c6c (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
65
66
67
68
69
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Andres Alejandro Navarro Alsina <aanavarroa@unal.edu.co>
# Contributor: M. Jarvis
_tag=v0.2.5
_pkgname=python-piff-git
pkgbase=python-piff-git
pkgname=('python-piff-git' 'python2-piff-git')
pkgver=v0.2.5.r0.gdee19b7
pkgrel=1
pkgdesc=" Piff is a Python software package for modeling the
point-spread function (PSF) across multiple detectors in the full
field of view"
arch=('any')
url="https://github.com/rmjarvis/Piff.git"
license=('BSD')
makedepends=('git' 'python' 'libffi' 'python-cffi' 'python-numpy' 'python-scipy' 'python-yaml' 'python-treecorr-git' 'python-fitsio-git' 'python-lmfit-git' 'python-matplotlib' 'python2' 'python2-cffi' 'python2-numpy' 'python2-scipy' 'python2-yaml' 'python2-treecorr-git' 'python2-fitsio-git' 'python2-lmfit-git' 'python2-matplotlib' 'python-galsim-git' 'python2-galsim-git' 'python-coord-git' 'python2-coord-git')
optdepends=('python2-scikit-learn' 'python-piff' 'python2-piff' 'python2-pyaml' 'python2-yaml')
checkdepends=('python-nose' 'python2-nose' 'python-scikit-learn' 'python-uncertainties' 'python2-uncertainties' )
conflicts=('python-piff' 'python2-piff')
source=("${pkgbase}::git+${url}#tag=$_tag")
md5sums=('SKIP')

pkgver() {
  	 cd "$srcdir"/$_pkgname
 	 printf "%s" "$(git describe --long | sed 's/^foo-//;s/\([^-]*-g\)/r\1/;s/-/./g')"	 
}

prepare() {
	  cp -a $_pkgname{,-py2}
}

build() {
	cd "$srcdir"/$_pkgname
	python setup.py build

	cd "$srcdir"/$_pkgname-py2
	python2 setup.py build
}

check() {
	cd "$srcdir"/$_pkgname/tests
	git checkout "$_tag"
	nosetests -v || warning 'Tests failed'

	cd "$srcdir"/$_pkgname-py2/tests
	git checkout "$_tag"
	nosetests2 -v || warning 'Tests2 failed'
}

package_python-piff-git() {
	  		  depends=('python-cffi' 'python-yaml' 'python-numpy' 'python-scipy' 'python-pyaml' 'python-treecorr-git' 'python-fitsio-git' 'python-lmfit-git' 'python-matplotlib' 'python-galsim-git' 'python-coord-git')
	  		  cd "${_pkgname}"
	  		  python setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
			  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
}

package_python2-piff-git() {
	  		  depends=('python2-cffi' 'python2-yaml' 'python2-numpy' 'python2-scipy' 'python2-pyaml' 'python2-treecorr-git' 'python2-fitsio-git' 'python2-matplotlib' 'python2-galsim-git' 'python2-coord-git')
	  		  cd "${_pkgname}"
			  python2 setup.py install --root=${pkgdir} --prefix=/usr --optimize=1
			  mv "$pkgdir"/usr/bin/piffify{,2} 
			  #mv "$pkgdir"/usr/bin/plotify{,2}
			  #rm -rf "$pkgdir"/usr/bin
			  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
}