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

EAPI=5

inherit fortran-2

MYP=${PN}_${PV}

DESCRIPTION="Galaxy photometric redshifts from evolutionary synthesis"
HOMEPAGE="http://imacdlb.iap.fr:8080/cgi-bin/zpeg/zpeg.pl"
SRC_URI="ftp://ftp.iap.fr/pub/from_users/leborgne/${PN}/${MYP}.tar.gz"

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

RDEPEND="gdl? ( dev-lang/gdl )"
DEPEND=""

S="${WORKDIR}/${MYP}"

FORTRAN_STANDARD="90"

src_prepare() {
	# save configure for tests
	cp configure{,.orig} || die
	# install data in FHS
	sed -i \
		-e "s:ZPEG_ROOT=.*:ZPEG_ROOT=${EPREFIX}/usr/share/${PN}:" \
		configure || die
}

src_compile() {
	# not worth debugging parallel build failures which is due to
	# fortran modules missing dependencies)
	emake -j1 -C src
}

src_test() {
	# test only works with hardcoded path, so reconfigure and recompile
	mv bin/zpeg{,.orig} || die
	mv configure{.orig,} || die
	emake -C src clean && econf && emake -j1 -C src
	cd test
	../bin/zpeg -V ZPEG1_cata.cat -o hdf.zpeg -p hdf.par -t hdf.par.tmp || die
	mv bin/zpeg{.orig,} || die
}

src_install() {
	dobin bin/zpeg
	insinto /usr/share/${PN}
	doins -r data VERSION
	dodoc HISTORY
	echo > 99zpeg "ZPEG_ROOT=${EROOT}/usr/share/${PN}"
	doenvd 99zpeg
	if use gdl; then
		insinto /usr/share/gnudatalanguage/${PN}
		doins idl/*.pro
	fi
}