summaryrefslogtreecommitdiff
blob: 3a4b95a8c19b868024539aaddb5c9a58eacdcbe8 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils fortran autotools

# This package only includes the futils.

DESCRIPTION="HEASOFT/HEADAS: The FTools (futils only) from NASA's GSFC for viewing and manipulating FITS files. Includes CFITSIO."
HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/"
SRC_URI="ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/heasoft${PV}src.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

# Recommend >=dev-lang/perl-5.6.0.
# Possibly we can have cfitsio installed side-by-side.
DEPEND=">=dev-lang/perl-5.6.0
	x11-base/xorg-server
	!sci-libs/cfitsio"
RDEPEND="${DEPEND}"


S="${WORKDIR}/heasoft-${PV}"

# INSTDIR="${D}/headas-${PV}"
# INSTDIR_ARCH="${INSTDIR}/<arch-and-lib>"

INSTPREFIX=/usr/heasoft
ARCHPREFIX=/usr

pkg_setup() {
	fortran_pkg_setup
}

# src_unpack() {
	# unpack "${A}"

	# # All occurrences of hd_install.c are the same, and need the same patch.
	# # HD_INSTALL_C_DIR=". tcltk ftools heacore demo"
	# # for rdir in ${HD_INSTALL_C_DIR}; do
		# # cd "${S}/${rdir}"
		# # einfo "Entering \"${rdir}\" ..."
		# # EPATCH_OPTS="-p1" epatch "${FILESDIR}/hd_install-DESTDIR.patch"
	# # done
# }

src_compile() {
	cd "${S}/BUILD_DIR/"
	econf || die "econf failed"
	emake || die "emake failed"
}


src_install() {
	cd "${S}/BUILD_DIR/"
	emake DESTDIR="${D}" install || die "Install failed"
	dodoc "${S}/Release_Notes_6.4.1" || die "dodoc failed"
}

pkg_postinst() {
	ewarn "In order to use heasoft and the ftools, put in your ~/.bashrc"
	einfo
	ewarn "	export HEADAS=\"${INSTDIR_ARCH}\""
	ewarn "	alias heainit=\". $HEADAS/headas-init.sh"
	einfo
	ewarn "and initialize the ftools with"
	einfo
	ewarn "	$ heainit"
	einfo
	ewarn "every time you start a new shell."
	ewarn "This is necessary since heasoft does not comply exactly with"
	ewarn "GNU software conventions."
	elog "Happy fitsing."
}