summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e71fa8330ddd9f6910fa3887823e22a1a2698dc8 (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
# Maintainer: Graziano Giuliani <graziano.giuliani@gmail.com>
pkgname=libbufr
pkgver=11.3.0
pkgrel=1
pkgdesc="NCEP library to encode or decode BUFR messages"
arch=(i686 x86_64)
url="https://www.emc.ncep.noaa.gov/index.php?branch=BUFRLIB"
license=('Custom')
options=('staticlibs')
makedepends=(gcc-fortran)
source=('https://www.emc.ncep.noaa.gov/BUFRLIB/docs/BUFRLIB_v11-3-0.tar'
        'LICENSE')
md5sums=('57b5bc85dff2b64125463dc43e207d5a'
         'f9f43492185682b834428d79f718f28e')

build() {
  cd ${srcdir}
  export CC=gcc
  export FC=gfortran
  export BFRCFLAGS="-DDYNAMIC_ALLOCATION -DNFILES=32 \
                    -DMAXCD=250 -DMAXNC=600 -DMXNAF=3"
  export BFRFFLAGS="-DLITTLE_ENDIAN -DNORMAL_BUILD -DDYNAMIC_ALLOCATION"
  export FCFLAGS="${CFLAGS} -fdollar-ok"
  export AR=ar
  export ARFLAGS=-rv
  sed -i bufrlib.prm -e 's/	/      /g'
  for file in *.c
  do
    echo "compiling $file"
    ${CC} ${CFLAGS} ${BFRCFLAGS} -c -DUNDERSCORE $file
  done
  for file in modv* moda*
  do
    echo "compiling $file"
    ${FC} ${FCFLAGS} ${BFRFFLAGS} -c $file
  done
  for file in `ls -1 *.F *.f | grep -v mod[av]`
  do
    echo "compiling $file"
    ${FC} ${FCFLAGS} ${BFRFFLAGS} -c $file
  done
  ${AR} ${ARFLAGS} libncepbufr.a *.o
}

package() {
  cd ${srcdir}
  mkdir -p ${pkgdir}/usr/lib
  mkdir -p ${pkgdir}/usr/include
  mkdir -p ${pkgdir}/usr/share/licenses/libbufr
  install -m 644 libncepbufr.a ${pkgdir}/usr/lib
  install -m 644 bufrlib.h ${pkgdir}/usr/include
  install -m 644 LICENSE ${pkgdir}/usr/share/licenses/libbufr
}

# vim:set ts=2 sw=2 et: