*/*: Drop stable ia64 keywords
[gentoo.git] / dev-ml / ocamlnet / ocamlnet-4.1.2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit eutils findlib
7
8 MY_P=${P/_beta/test}
9 DESCRIPTION="Modules for OCaml application-level Internet protocols"
10 HOMEPAGE="http://projects.camlcity.org/projects/ocamlnet.html"
11 SRC_URI="http://download.camlcity.org/download/${MY_P}.tar.gz"
12
13 LICENSE="ZLIB GPL-2+"
14 SLOT="0/${PV}"
15 KEYWORDS="amd64 ppc x86"
16 IUSE="gtk kerberos tk httpd +ocamlopt +pcre ssl zip"
17 RESTRICT="installsources strip"
18
19 # the auth-dh compile flag has been disabled as well, since it depends on
20 # ocaml-cryptgps, which is not available.
21
22 RDEPEND=">=dev-ml/findlib-1.0
23                 pcre? ( >=dev-ml/pcre-ocaml-5:= )
24                 >=dev-lang/ocaml-3.10.2:=[ocamlopt?]
25                 tk? ( dev-ml/labltk:= )
26                 ssl? ( net-libs/gnutls:= )
27                 gtk? ( >=dev-ml/lablgtk-2:= )
28                 kerberos? ( virtual/krb5 )
29                 zip? ( dev-ml/camlzip:= )
30                 "
31 DEPEND="${RDEPEND}
32         virtual/pkgconfig
33 "
34
35 S=${WORKDIR}/${MY_P}
36
37 src_prepare() {
38         epatch "${FILESDIR}/ocaml405.patch"
39 }
40
41 ocamlnet_use_with() {
42         if use $1; then
43                 echo "-with-$2"
44         else
45                 echo "-without-$2"
46         fi
47 }
48
49 ocamlnet_use_enable() {
50         if use $1; then
51                 echo "-enable-$2"
52         else
53                 echo "-disable-$2"
54         fi
55 }
56
57 src_configure() {
58         ./configure \
59                 -bindir /usr/bin \
60                 -datadir /usr/share/${PN} \
61                 $(ocamlnet_use_enable ssl gnutls) \
62                 $(ocamlnet_use_enable gtk gtk2) \
63                 $(ocamlnet_use_enable kerberos gssapi) \
64                 $(ocamlnet_use_enable pcre pcre) \
65                 $(ocamlnet_use_enable tk tcl) \
66                 $(ocamlnet_use_enable zip zip) \
67                 $(ocamlnet_use_with httpd nethttpd) \
68                 || die "Error : econf failed!"
69 }
70
71 src_compile() {
72         emake -j1 all
73         if use ocamlopt; then
74                 emake -j1 opt
75         fi
76 }