summaryrefslogtreecommitdiff
blob: c6b5523d38c7b1e971c084a70f5508d2b6ee2faf (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: /var/cvsroot/gentoo-x86/sci-astronomy/xephem/xephem-3.7.4.ebuild,v 1.1 2009/07/26 15:33:25 bicatali Exp $

EAPI=2
inherit eutils

DESCRIPTION="Interactive tool for astronomical ephemeris and sky simulation"
HOMEPAGE="http://www.clearskyinstitute.com/xephem"
SRC_URI="http://97.74.56.125/free/${P}.tar.gz"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
IUSE=""
SLOT=0
LICENSE="as-is"
DEPEND="x11-libs/openmotif
	media-libs/jpeg
	media-libs/libpng"
RDEPEND="${DEPEND}"

src_prepare() {
	# make sure we use system libs and respect user flags
	epatch "${FILESDIR}"/${P}-libs-flags.patch
}

src_compile() {
	cd GUI/xephem
	emake || die "emake failed"
	for i in tools/{lx200xed,xedb,xephemdbd}; do
		emake -C ${i} || die "emake ${i} failed"
	done
}

src_install() {
	into "/usr"
	cd "${S}"/GUI/xephem
	dobin xephem  || die "dobin xephem failed"
	doman xephem.1 || die
	newicon XEphem.png ${PN}.png
	insinto /usr/share/${PN}
	for i in auxil catalogs fifos fits gallery lo; do
		doins -r ${i} || die
	done
	insinto /usr/share/doc/${PF}/html
	doins -r help/* || die
	cd tools
	for file in lx200xed/lx200xed xedb/xedb xephemdbd/xephemdbd; do
		dobin ${file} || die "dobin ${file} failed"
	done
	for file in {xedb,lx200xed}/README; do
		newdoc ${file} README.$(dirname ${file}) || die "newdoc ${file} failed"
	done
	cd xephemdbd
	insinto /usr/share/doc/${PF}/xephemdbd
	doins README cgi-lib.pl start-xephemdbd.pl xephemdbd.html xephemdbd.pl || die

	cd "${S}"
	echo > XEphem "XEphem.ShareDir: /usr/share/${PN}"
	insinto /usr/share/X11/app-defaults
	has_version '<x11-base/xorg-x11-7.0' && insinto /etc/X11/app-defaults
	doins XEphem || die
	echo > 99xephem "XEHELPURL=/usr/share/doc/${PF}/html/xephem.html"
	doenvd 99xephem || die
	dodoc Copyright README
	make_desktop_entry xephem XEphem ${PN}
}

pkg_postinst() {
	elog "See /usr/share/doc/${PF}/xephemdbd/README to set up a web interface"
}