692c89bf09ed5d41344c20000d60784ea1e25e26
[gentoo.git] / app-misc / geneweb / geneweb-6.08-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit eutils user
6
7 DESCRIPTION="Genealogy software program with a Web interface"
8 HOMEPAGE="https://github.com/geneanet/geneweb"
9 SRC_URI="https://github.com/geneweb/geneweb/archive/v6.08.tar.gz -> ${P}.tar.gz
10         https://dev.gentoo.org/~tupone/${P}-ocaml-4.patch.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="+ocamlopt"
16 RESTRICT="strip"
17
18 RDEPEND="dev-lang/ocaml[ocamlopt?]
19         dev-ml/camlp5[ocamlopt?]"
20 DEPEND="${RDEPEND}
21         !net-p2p/ghostwhitecrab"
22
23 PATCHES=(
24         "${WORKDIR}"/${P}-ocaml-4.patch
25         "${FILESDIR}"/${PF}-gentoo.patch
26         "${FILESDIR}"/${P}-parallellbuild.patch )
27
28 src_compile() {
29         if use ocamlopt; then
30                 emake
31         else
32                 emake OCAMLC=ocamlc OCAMLOPT=ocamlopt out
33                 # If using bytecode we dont want to strip the binary as it would remove
34                 # the bytecode and only leave ocamlrun...
35         fi
36 }
37
38 src_install() {
39         dodoc ICHANGES
40         emake new_distrib
41         emake wrappers
42         # Install doc
43         cd distribution
44         dodoc CHANGES.txt
45         # Install binaries
46         cd gw
47         dobin gwc gwc1 gwc2 consang gwd gwu update_nldb ged2gwb ged2gwb2 gwb2ged gwsetup
48         insinto /usr/lib/${PN}
49         doins -r gwtp_tmp/*
50         dodoc a.gwf
51         insinto /usr/share/${PN}
52         doins -r etc images lang setup gwd.arg only.txt
53
54         cd ../..
55
56         # Install binaries
57         dobin src/check_base
58         # Install manpages
59         doman man/*
60
61         # Install doc
62         insinto /usr/share/doc/${PF}/contrib
63         doins -r contrib/{gwdiff,misc}
64
65         newinitd "${FILESDIR}/geneweb.initd" geneweb
66         newconfd "${FILESDIR}/geneweb.confd" geneweb
67 }
68
69 pkg_postinst() {
70         enewuser geneweb "" "/bin/bash" /var/lib/geneweb
71         einfo "A CGI program has been installed in /usr/lib/${PN}. Follow the"
72         einfo "instructions on the README in that directory to use it"
73         einfo "For 64 bits architecture you need to rebuild the database"
74         einfo "\"gwu foo > foo.gw \" will save the database (use the previous"
75         einfo "version to do that). \"gwc2 foo.gw -o bar \" will restore it "
76         einfo "(using the current package)"
77 }