| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-misc/geneweb/geneweb-5.02.ebuild,v 1.5 2011/10/04 16:56:28 nativemad Exp $ |
| 4 |
|
| 5 |
EAPI=2 |
| 6 |
inherit eutils user |
| 7 |
|
| 8 |
DESCRIPTION="Genealogy software program with a Web interface." |
| 9 |
HOMEPAGE="http://cristal.inria.fr/~ddr/GeneWeb/" |
| 10 |
SRC_URI="ftp://ftp.inria.fr/INRIA/Projects/cristal/${PN}/Src/${P}.tgz" |
| 11 |
|
| 12 |
LICENSE="GPL-2" |
| 13 |
SLOT="0" |
| 14 |
KEYWORDS="amd64 x86" |
| 15 |
IUSE="+ocamlopt" |
| 16 |
|
| 17 |
RDEPEND="dev-lang/ocaml[ocamlopt?] |
| 18 |
dev-ml/camlp5" |
| 19 |
DEPEND="${RDEPEND} |
| 20 |
!net-p2p/ghostwhitecrab" |
| 21 |
|
| 22 |
src_prepare() { |
| 23 |
epatch "${FILESDIR}"/${P}-gentoo.patch \ |
| 24 |
"${FILESDIR}"/${P}-amd64.patch \ |
| 25 |
"${FILESDIR}"/${P}-parallellbuild.patch |
| 26 |
sed -i -e "s:@GENTOO_DATADIR@:/usr/share/${PN}:" \ |
| 27 |
setup/setup.ml || die "Failed sed for gentoo path" |
| 28 |
rm -f contrib/gwdiff/.{cvsignore,depend} |
| 29 |
} |
| 30 |
|
| 31 |
src_compile() { |
| 32 |
if use ocamlopt; then |
| 33 |
emake || die "Compiling native code executables failed" |
| 34 |
else |
| 35 |
emake OCAMLC=ocamlc OCAMLOPT=ocamlopt out \ |
| 36 |
|| die "Compiling byte code executables failed" |
| 37 |
# If using bytecode we dont want to strip the binary as it would remove |
| 38 |
# the bytecode and only leave ocamlrun... |
| 39 |
export STRIP_MASK="*/bin/*" |
| 40 |
fi |
| 41 |
} |
| 42 |
|
| 43 |
src_install() { |
| 44 |
make distrib || die "Failed making distrib" |
| 45 |
cd distribution/gw |
| 46 |
# Install doc |
| 47 |
dodoc CHANGES.txt |
| 48 |
# Install binaries |
| 49 |
dobin gwc gwc2 consang gwd gwu update_nldb ged2gwb gwb2ged gwsetup \ |
| 50 |
|| die "Failed installing binaries" |
| 51 |
insinto /usr/lib/${PN} |
| 52 |
doins -r gwtp_tmp/* || die "Failed installing CGI program" |
| 53 |
dodoc a.gwf |
| 54 |
dohtml -r doc/* |
| 55 |
insinto /usr/share/${PN} |
| 56 |
doins -r etc images lang setup gwd.arg only.txt\ |
| 57 |
|| die "Failed installing data" |
| 58 |
|
| 59 |
cd ../.. |
| 60 |
|
| 61 |
# Install binaries |
| 62 |
dobin src/check_base \ |
| 63 |
|| die "Failed installing check_base binaries" |
| 64 |
# Install manpages |
| 65 |
doman man/* || die "Failed installing man pages" |
| 66 |
|
| 67 |
# Install doc |
| 68 |
dodoc ICHANGES |
| 69 |
insinto /usr/share/doc/${PF}/contrib |
| 70 |
doins -r contrib/{gwdiff,misc} \ |
| 71 |
|| die "Failed installing contributions" |
| 72 |
|
| 73 |
newinitd "${FILESDIR}/geneweb.initd" geneweb |
| 74 |
newconfd "${FILESDIR}/geneweb.confd" geneweb |
| 75 |
} |
| 76 |
|
| 77 |
pkg_postinst() { |
| 78 |
enewuser geneweb "" "/bin/bash" /var/lib/geneweb |
| 79 |
einfo "A CGI program has been installed in /usr/lib/${PN}. Follow the" |
| 80 |
einfo "instructions on the README in that directory to use it" |
| 81 |
} |