updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / xfoil / PKGBUILD
bloba0cd6bd38044c66db57944fe381f6487af0f930f
1 # Contributor: pfm <nl081130@yahoo.de>
2 # Based on the Gentoo ebuild: http://gentoo-portage.com/sci-physics/xfoil
4 pkgname=xfoil
5 pkgver=6.97
6 pkgrel=3
7 pkgdesc="Program for design and analysis of subsonic airfoils."
8 arch=('i686' 'x86_64')
9 url="http://web.mit.edu/drela/Public/web/xfoil/"
10 license=('GPL')
11 depends=('gcc-libs' 'libx11')
12 makedepends=('gcc-fortran' 'sed' 'patch')
13 source=("http://web.mit.edu/drela/Public/web/xfoil/$pkgname$pkgver.tar.gz" \
14         "xfoil-6.96-gfortran.patch" "xfoil-6.97-overflow.patch")
15 md5sums=('b9ce001ed838be880262c75038d489c5'
16          'b66e0eab1473537c7813111fe856b693'
17          '6c993590ae3303b7e59968115682e01d')
19 _FORTRANC=gfortran
21 build() {
23   cd "$srcdir/Xfoil"
25   patch -Np0 -i ../xfoil-6.96-gfortran.patch || return 1
26   patch -Np0 -i ../xfoil-6.97-overflow.patch || return 1
28   sed -i \
29     -e '/^FC/d' \
30     -e '/^CC/d' \
31     -e '/^FFLAGS/d' \
32     -e '/^CFLAGS/d' \
33     -e 's/^\(FFLOPT .*\)/FFLOPT = $(FFLAGS)/g' \
34     {bin,plotlib,orrs/bin}/Makefile plotlib/config.make \
35     || return 1
36   sed -i \
37      -e 's:/var/local/codes/orrs/osmap.dat:/usr/share/xfoil/orrs/osmap.dat:' \
38      orrs/src/osmap.f || return 1
39   
40   export FC="${_FORTRANC}" F77="${_FORTRANC}"
42   cd "$srcdir/Xfoil/orrs/bin"
43     make FLG="${FFLAGS}" FTNLIB="${LDFLAGS}" OS || return 1
44   cd "$srcdir/Xfoil/orrs"
45     bin/osgen osmaps_ns.lst || return 1
46   cd "$srcdir/Xfoil/plotlib"
47     make CFLAGS="${CFLAGS} -DUNDERSCORE" || return 1
48   cd "$srcdir/Xfoil/bin"
49     for i in xfoil pplot pxplot; do
50       make \
51         PLTOBJ="../plotlib/libPlt.a" \
52         CFLAGS="${CFLAGS} -DUNDERSCORE" \
53         FTNLIB="${LDFLAGS}" \
54         ${i} || return 1
55     done
57   install -d $pkgdir/usr/bin
58   install -d $pkgdir/usr/share/xfoil/{doc,orrs}
60   cd "$srcdir/Xfoil/bin"
61   install -m755 xfoil $pkgdir/usr/bin
62   install -m755 pplot $pkgdir/usr/bin
63   install -m755 pxplot $pkgdir/usr/bin
65   cd "$srcdir/Xfoil/orrs"
66   install -m644 osm*.dat $pkgdir/usr/share/xfoil/orrs
68   cd "$srcdir/Xfoil"
69   install -m644 xfoil_doc.txt $pkgdir/usr/share/xfoil/doc