updated on Sun Jan 22 08:00:21 UTC 2012
[aur-mirror.git] / emos / PKGBUILD
blobe24b7630150cbbfaf1897ad370bf665267e65d2e
1 # Contributor: Graziano Giuliani <graziano.giuliani@poste.it>
2 pkgname=emos
3 pkgver=000380
4 pkgrel=1
5 pkgdesc="ECMWF Interpolation Library"
6 arch=(i686 x86_64)
7 url="http://www.ecmwf.int/products/data/software/interpolation.html"
8 license=('LGPL')
9 groups=(science)
10 makedepends=(rsync)
11 source=(http://www.ecmwf.int/products/data/software/download/software_files/${pkgname}_$pkgver.tar.gz)
12 md5sums=('b3dfa25010ea8f6de183bb0c1e867b73' )
14 build() {
15   cd "$startdir/src/${pkgname}_$pkgver"
17   export ARCHFLAGS=$CFLAGS
18   arch=`arch`
19   A64=
20   R64=
21   target=`uname -s | tr '[A-Z]' '[a-z]'`
22   gnu=yes
23   CNAME=_gfortran
24   [ "$arch" = x86_64 ] && { A64="A64"; R64=; }
25   cat Makefile.in | sed s:reals:$R64: > Makefile
26   for subdirs in gribex pbio bufrdc bufrtables crexdc interpolation fft
27   do
28     cat $subdirs/Makefile.in | sed s:reals:$R64: | \
29                                sed s:arch:$target: | \
30                                sed s:plat:$A64: | \
31                                sed s:depl:emos: | \
32                                sed s:comp:$CNAME: > $subdirs/Makefile
33   done
34   for subdirs in examples/gribex examples/bufr \
35       examples/crex examples/interpolation examples/fft
36   do
37     cat $subdirs/Makefile.in | sed s:reals:$R64: | \
38                                sed s:arch:$target: | \
39                                sed s:plat:$A64: | \
40                                sed s:comp:$CNAME: > $subdirs/Makefile
41   done
42   cat config/config.$target$CNAME$R64$A64.in | \
43          sed s:emos:/usr/share/emos: > config/config.$target$CNAME$R64$A64
44   make ARCH=linux CNAME=_gfortran A64=$A64 R64=$R64
46   ls bufrtables/*000* > .list/bufrtables
47   mkdir -p $startdir/pkg/usr/lib
48   mkdir -p $startdir/pkg/usr/share/emos
50   INSTALL_DIR=$startdir/pkg/usr/lib
51   install -m 644 libemos$R64.a $startdir/pkg/usr/lib/libemos.a
52   for d in gribtables bufrtables crextables land_sea_mask gribtemplates ; do
53     mkdir -p $startdir/pkg/usr/share/emos/$d
54     find $d -type d -exec mkdir -p $startdir/pkg/usr/share/emos/{} \;
55     for i in `cat .list/$d` ; do
56       rsync -a $i $startdir/pkg/usr/share/emos/$i
57     done
58   done
61 # vim:set ts=2 sw=2 et: