1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools flag-o-matic ssl-cert user
9 DESCRIPTION="Powerful SMS and WAP gateway"
10 HOMEPAGE="http://www.kannel.org/"
11 SRC_URI="http://www.kannel.org/download/${PV}/gateway-${PV}.tar.gz"
16 IUSE="debug doc mysql libressl pam pcre postgres sqlite ssl"
18 RESTRICT="test" # some tests fail with "address already in use"
21 sys-libs/e2fsprogs-libs
26 libressl? ( dev-libs/libressl:0= )
27 !libressl? ( dev-libs/openssl:0= ) )
28 mysql? ( virtual/mysql )
29 sqlite? ( dev-db/sqlite:3 )
30 postgres? ( dev-db/postgresql:=[server] )
31 pcre? ( dev-libs/libpcre:3 )
36 doc? ( media-gfx/transfig
38 app-text/docbook-dsssl-stylesheets
39 app-text/docbook-sgml-dtd:3.1 )
42 S="${WORKDIR}/gateway-${PV}"
45 "${FILESDIR}/${PN}-1.5.0-custom-wap-ports.patch"
46 "${FILESDIR}/${PN}-1.4.3-autotools.patch"
47 "${FILESDIR}/${PN}-1.4.3-external-libuuid.patch"
48 "${FILESDIR}/${PN}-1.5.0-initgroups.patch"
53 enewuser kannel -1 -1 /var/log/kannel kannel
59 #by default, use current directory for logging
60 sed -i -e 's:/tmp/::' doc/examples/kannel.conf
62 mv configure.in configure.ac || die
67 append-flags -fno-strict-aliasing # some code breaks strict aliasing
70 --disable-start-stop-daemon \
73 $(use_enable debug debug) \
75 $(use_enable doc docs) \
78 $(use_with sqlite sqlite3) \
79 $(use_with postgres pgsql)
82 # phase disabled by RESTRICT
84 # emake check || die "emake check failed"
91 emake -j1 DESTDIR="${D}" install-docs || die "emake install-docs failed"
94 diropts -g kannel -m0750
97 newins doc/examples/kannel.conf kannel.conf.sample
100 for f in bearerbox smsbox wapbox; do
101 newinitd "${FILESDIR}/kannel-$f.initd" kannel-$f
104 diropts -g kannel -m0770
105 keepdir /var/log/kannel
110 elog "SSL certificate can be created by running"
111 elog " emerge --config =${CATEGORY}/${PF}"
117 if install_cert /etc/ssl/kannel; then
118 chown kannel "${ROOT}"etc/ssl/kannel.{pem,key}
119 einfo "For using this certificate, you have to add following line to your kannel.conf:"
120 einfo ' ssl-client-certkey-file = "/etc/ssl/kannel.pem"'
121 einfo ' ssl-server-cert-file = "/etc/ssl/kannel.crt"'
122 einfo ' ssl-server-key-file = "/etc/ssl/kannel.key"'
125 eerror "This phase exists only for creating kannel SSL certificate"
126 eerror "and ssl USE flag is disabled for this package!"