updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / yorick-spydr-git / PKGBUILD
blob59ba5a6ca561744fb98c28e8ee911486574efb21
1 # Maintainer: Francois Rigaut <frigaut at gmail dot com>
3 pkgname=yorick-spydr-git
4 pkgver=20110317
5 pkgrel=1
6 pkgdesc="Image display tool in yorick"
7 arch=('any')
8 license=('GPL')
9 url="http://www.maumae.net/yorick/doc/plugins.php"
10 groups=('science' 'yorick-all')
11 depends=('yorick' 'pygtk' 'yorick-yao-git' 'python2')
12 makedepends=('git' 'yorick' 'pkgconfig>=0.9.0')
13 provides=('yorick-spydr')
14 conflicts=('yorick-spydr')
15 replaces=('yorick-spydr')
17 _gitroot="git://github.com/frigaut/yorick-spydr.git"
18 _gitname="yorick-spydr"
20 build() {
21   cd ${srcdir}
22   msg "Connecting to git repo..."
23   if [ -d ${srcdir}/$_gitname ] ; then
24       cd $_gitname && git pull origin
25       msg "The local files are updated."
26   else
27       git clone $_gitroot
28   fi
30   msg "GIT checkout done or server timeout"
31   msg "Starting script install..."
33   git clone $_gitname $_gitname-build
34   cd ${srcdir}/$_gitname-build
36   yorick -batch make.i || return 1
37   make DESTDIR=${pkgdir} install || return 1
38   sed -i -e "s|env python|env python2|" ${pkgdir}/usr/share/yorick/2.2/python/spydr.py
39   mkdir -p ${pkgdir}/usr/bin
40   echo 's=sum(strtok(Y_VERSION,".",3)(1)+"."+strtok(Y_VERSION,".",3)(2))' > /tmp/get_yversion
41   echo 'f=open("/tmp/yversion","w"); write,f,format="%s",s; close,f;' >> /tmp/get_yversion
42   yorick -batch /tmp/get_yversion
43   yversion=`cat /tmp/yversion`
44   ln -s /usr/lib/yorick/${yversion}/bin/${_pkgshonam} ${pkgdir}/usr/bin/${_pkgshonam}