summaryrefslogtreecommitdiff
blob: c5607afb8b216b410a02e9b5923225ee5082c647 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit eutils
# A well-used example of an eclass function that needs eutils is epatch. If
# your source needs patches applied, it's suggested to put your patch in the
# 'files' directory and use:
#
#   epatch "${FILESDIR}"/patch-name-here
#
# eclasses tend to list descriptions of how to use their functions properly.
# take a look at /usr/portage/eclasses/ for more examples.

DESCRIPTION="General-Use FTools for manipulating and inspecting FITS files"
HOMEPAGE="http://heasarc.gsfc.nasa.gov/docs/software/ftools/ftools_menu.html"
SRC_URI="heasoft${PV}src.tar.gz"
LICENSE="GPLv2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
RESTRICT="test"

DEPEND="x11-base/xorg-server"
RDEPEND="${DEPEND}"

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


src_prepare() {
	# The same source file hd_install.c occurs multiple times, and needs to
	# be patched to support $DESTDIR.
	for subdir in . demo tcltk ftools heacore heatools; do
		cd "${S}"/${subdir}/BUILD_DIR
		epatch "${FILESDIR}"/hd_install-destdir.patch || die "epatch failed"
	done
	cd "${S}"
	epatch "${FILESDIR}"/no-tk-docs.patch || die "epatch failed"
	epatch "${FILESDIR}"/lhea-fixperl-destdir.patch || die "epatch failed"
	epatch "${FILESDIR}"/headas-init-destdir.patch || die "epatch failed"
}

src_configure() {
	cd BUILD_DIR
	./configure --prefix="/usr/heasoft-${PV}/" || die "configure failed"
}

src_compile() {
	cd BUILD_DIR
	make -j1 || die "make failed"
}

src_install() {
	cd BUILD_DIR
	make -j1 DESTDIR="${D}" INSTALL_ROOT="${D}" install || die "make install failed"

	#emake \
	#	prefix="${D}"/usr \
	#	mandir="${D}"/usr/share/man \
	#	infodir="${D}"/usr/share/info \
	#	libdir="${D}"/usr/$(get_libdir) \
	#	install || die "emake install failed"

	# The portage shortcut to the above command is simply:
	#
	#einstall || die "einstall failed"
}