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

inherit toolchain-funcs flag-o-matic

DESCRIPTION="Extract catalogs of sources from astronomical FITS images."
HOMEPAGE="http://terapix.iap.fr/soft/sextractor"
SRC_URI="ftp://ftp.iap.fr/pub/from_users/bertin/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc"
DEPEND=""
RESTRICT="test"

src_compile() {
	CONFDIR=/usr/share/${PN}/config
	# change default configuration files location from current dir
	sed -i -e "s:default\.:${CONFDIR}/default\.:" src/preflist.h
	# buggy with >= O2
	replace-flags -O[2-9] -O1
	local myconf
	[[ "$(tc-getCC)" == "icc" ]] \
		&& myconf="${myconf} --enable-icc"
	econf "${myconf}" || die "econf failed"
	emake || die "emake failed"
}

src_install () {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc AUTHORS BUGS ChangeLog HISTORY README THANKS
	insinto ${CONFDIR}
	doins config/*
	if use doc; then
		insinto /usr/share/doc/${PF}
		doins doc/*
	fi
}

pkg_postinst() {
	elog "SExtractor configuration files are located"
	elog "in ${CONFDIR} and loaded by default."
}