summaryrefslogtreecommitdiff
blob: b267932b59f907775938984eb50ec1e483528c49 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-libs/cfitsio/cfitsio-2.510-r1.ebuild,v 1.6 2009/09/23 20:06:29 patrick Exp $

inherit eutils multilib toolchain-funcs

IUSE="doc"

DESCRIPTION="C and Fortran library for manipulating FITS files"
HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html"
SRC_URI="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/${PN}${PV//.}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 ~hppa ppc ppc64 sparc x86"

DEPEND=""

S=${WORKDIR}/${PN}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}"/${P}-configure.patch || die "epatch failed"
}

src_compile() {
	econf --host=${CHOST} --prefix="${D}"usr --libdir="${D}"usr/$(get_libdir) \
	    || die "econf failed"
	make || die "make failed"
	make shared fitscopy imcopy listhead
}

src_install () {
	diropts "-m0644"
	dodir /usr/include
	dobin fitscopy imcopy listhead
	dolib.so libcfitsio.so.*
	dolib.a libcfitsio.a
	dodoc changes.txt README Licence.txt

	if use doc; then
		dodoc *.ps cookbook.*
	fi
	insinto /usr/include
	doins fitsio.h fitsio2.h longnam.h drvrsmem.h
	cd "${D}"/usr/$(get_libdir)
	    dosym libcfitsio.so.0 /usr/$(get_libdir)/libcfitsio.so
}