# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
pkgname=cfitsio
pkgver=4.4.0
pkgrel=1
epoch=1
pkgdesc='A library of C and Fortran subroutines for reading and writing data files in FITS (Flexible Image Transport System) data format'
arch=(x86_64 'armv7h')
url='https://heasarc.gsfc.nasa.gov/fitsio/'
license=(custom)
depends=(curl
glibc
zlib)
source=(https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/$pkgname-$pkgver.tar.gz)
sha256sums=('95900cf95ae760839e7cb9678a7b2fad0858d6ac12234f934bd1cb6bfc246ba9')
prepare() {
cd $pkgname-$pkgver
sed -e 's|LDFLAGS=.*|LDFLAGS="$LDFLAGS"|g' -i configure.in # Fix LDFLAGS
autoreconf -vi
}
build() {
cd $pkgname-$pkgver
./configure --prefix=/usr --enable-reentrant
make shared
make utils
}
#check() {
# cd $pkgname-$pkgver
# LD_LIBRARY_PATH=. ./testprog > testprog.lis
# [[ -z $(diff testprog.lis testprog.out) ]] || return 1
# [[ -z $(cmp testprog.fit testprog.std) ]] || return 1
#}
package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
install -D -m644 licenses/* \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# Fix conflicts with ccfits and smem
rm "$pkgdir"/usr/bin/{cookbook,smem,testprog}
}