summaryrefslogtreecommitdiff
path: root/app-mobilephone/kannel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-02-10 15:40:27 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-02-10 15:40:27 +0000
commit6bc2e4d7c5906e46a8f275a876ead6ec41aca5bb (patch)
treecee0a97398040001220ece3cd48c3d568bcddb4a /app-mobilephone/kannel
parent1db00cc6e94b90c08090bb5b8c406622946c4ae5 (diff)
gentoo resync : 10.02.2019
Diffstat (limited to 'app-mobilephone/kannel')
-rw-r--r--app-mobilephone/kannel/Manifest2
-rw-r--r--app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch346
-rw-r--r--app-mobilephone/kannel/kannel-1.5.0-r4.ebuild128
3 files changed, 129 insertions, 347 deletions
diff --git a/app-mobilephone/kannel/Manifest b/app-mobilephone/kannel/Manifest
index e9872440b307..7765693891b1 100644
--- a/app-mobilephone/kannel/Manifest
+++ b/app-mobilephone/kannel/Manifest
@@ -1,5 +1,4 @@
AUX kannel-1.4.3-autotools.patch 952 BLAKE2B 40817e492326d441e848ad1f1303435d1b13843a380ad9e122190c18f9f1846fff200028484a1ae61b4e92a847d95ed6749eb1ac870be6c92d770f1f04df58d0 SHA512 ff449047fa16d6274682e0c1ccb5741187d397345bdc28bdcdf9aea4c4329d572e63066a75433191a1128302cf529d186a1d493bbc0d9e7de4ff271b59413f4b
-AUX kannel-1.4.3-custom-wap-ports.patch 13135 BLAKE2B b79363fb859eb73c64564f0d18112642d46ea7be48f571aa59bcaf65087c7a360ed6b13a3b7f2711229a13b611a85eb60baaa8e2031a99029964077c9fa92d8e SHA512 5b4830e2c148926cf85e071933e356bc6d82c0e469a6a0887eef65fb95151e7bb864258087783283239cc1dc28fb92637269ea8984a87f1aab3846d00bc4c188
AUX kannel-1.4.3-external-libuuid.patch 19830 BLAKE2B e33aa303050ad688f7b8efccbfef2048619a33b7edb1fca8845db599e046a80d70284c6c8a179d147c0d21ce787f384651353199ce8303df5ed979daf90a34b5 SHA512 e810d87f5aba6651a87aa3b959780115ed643253b120c2d4da13a7a7fe0cb9ca264e4303aa402ff1401200b9649a663dd203355c3384b28c4152b72b2a2916a2
AUX kannel-1.5.0-custom-wap-ports.patch 13161 BLAKE2B 2c99902d1d21a61ec54e43ffa0c205889124cc51a36b2650d608cc2c4456980954086ab18c9911c5e2723918234e9925ce5645885fd5f225ede2439498f23256 SHA512 cd71a435feadb43533ed06cf0a1f9e556131f5339951cc1971c9ebf922a5e028b390af978441d7d3fde68022f9c67fe3af69be737d9952614486613f7ba29d23
AUX kannel-1.5.0-initgroups.patch 333 BLAKE2B ad24397bf6f9d8af7e4313697e25a6e86f1b56af37afd9c2936812338ea8a373ed6d45236725f9f8e9c4b12904f033bcd70db74f58b0fac6a6cf03428e3bb3bd SHA512 06b143b70fd09575adc7bee61c1f48f10ced3da6239fedb9726d56162d53a1f0e6fe6c603e3e56ea4068b26df00196ca6ec4cfb02d321135bbacde6b7f75c217
@@ -8,4 +7,5 @@ AUX kannel-smsbox.initd 849 BLAKE2B 2e3c663b340d624c6e97d1fda12ced252a8357395fae
AUX kannel-wapbox.initd 849 BLAKE2B 2e3c663b340d624c6e97d1fda12ced252a8357395fae66f6d3a4665d8756c77ae7c840e210cae9897f266b4d750202e94a402ced907bfccc507438446063b9a1 SHA512 f0bad4c7b083c7edb96620e4263495872dbc59c2e911cf981f09e8d7a1ee2d3cc7fea63bec0596d60133aa50eea0e8ffeda1c3422395fe6fd7a35dcfa726426e
DIST gateway-1.5.0.tar.gz 3469476 BLAKE2B c77c43ec782884f8404e70dbe8fb76cb66526ba7f313db7b7ee83073aae71fb2a1661b58be297f0dc2e6bffbccc862d5e7f1239bd4431bbfa4f009848d57face SHA512 5bd35ff40e0f5882367f717e67104a0dc8703b5d6d95654e1268ded15cf6fac6366968b10adbe2eec22b3ac17fe3ae33b4142cd38f51fd3d75a56c8fe7653652
EBUILD kannel-1.5.0-r3.ebuild 3029 BLAKE2B 8c7e9f4928eb635f738fb40e88406415a1c8cdca1a229376601b28a9b409a62b2dfd18423f40de986cad771312225491693e2ef26af8b512dd21127ddde2486b SHA512 0bf6cf604585bc7cb7fe1749eacd9e3e67c1fb3e4829091fcf759ebfc176e9d5333ec8d32b789288d954e20774b258150324f3e08025a25d4abc2efdecd4d16b
+EBUILD kannel-1.5.0-r4.ebuild 3039 BLAKE2B f535507f3617fca16dfcdcf7b89882a70f2e3570f92c7de615f257a9f1091ad37ea35706fad4b03b344b7ca729822572fcfb286d4ca372baf2a7b475b700aed2 SHA512 1b3c799749f145adf685c719b1d991bf5a703f0080d523bc8ad13ee4c1e098fc6b4596c3236f50d7cb29803a1e78812be1ea5687351423b7309e38d89a809f55
MISC metadata.xml 390 BLAKE2B 6465bab424ef3f1ec5eadfa9d79c8f81c32008e1e1d58c23aa781570f3d0233f6ddd1bb5ef1dbb13b7f5714247ba6294a33703385f04f896642d7f08aef16ac3 SHA512 8a41bfb7c62e2d9c247bbab03e7e9d352a2165e668e71f3930592f891d5a2c911064d62f0b1f1f13eefc69c9a6dcaa06d8575499fc9161b661256388cfdcf534
diff --git a/app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch b/app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch
deleted file mode 100644
index e1992b08319a..000000000000
--- a/app-mobilephone/kannel/files/kannel-1.4.3-custom-wap-ports.patch
+++ /dev/null
@@ -1,346 +0,0 @@
-diff -Nru gateway-1.4.3.orig/gw/bb_udp.c gateway-1.4.3/gw/bb_udp.c
---- gateway-1.4.3.orig/gw/bb_udp.c 2009-01-12 16:46:56.000000000 +0000
-+++ gateway-1.4.3/gw/bb_udp.c 2009-03-01 14:20:38.000000000 +0000
-@@ -78,7 +78,7 @@
- #include "gwlib/gwlib.h"
- #include "msg.h"
- #include "bearerbox.h"
--
-+#include "custports.h"
- /* passed from bearerbox core */
-
- extern volatile sig_atomic_t bb_status;
-@@ -352,13 +352,13 @@
- while (gwlist_len(ifs) > 0) {
- iface = gwlist_extract_first(ifs);
- info(0, "Adding interface %s", octstr_get_cstr(iface));
-- add_service(9200, octstr_get_cstr(iface)); /* wsp */
-- add_service(9201, octstr_get_cstr(iface)); /* wsp/wtp */
-+ add_service(port_wsp, octstr_get_cstr(iface)); /* wsp */
-+ add_service(port_wtp, octstr_get_cstr(iface)); /* wsp/wtp */
-
- #ifdef HAVE_WTLS_OPENSSL
- if (allow_wtls) {
-- add_service(9202, octstr_get_cstr(iface)); /* wsp/wtls */
-- add_service(9203, octstr_get_cstr(iface)); /* wsp/wtp/wtls */
-+ add_service(port_wsps, octstr_get_cstr(iface)); /* wsp/wtls */
-+ add_service(port_wtps, octstr_get_cstr(iface)); /* wsp/wtp/wtls */
- }
- #else
- if (allow_wtls)
-diff -Nru gateway-1.4.3.orig/gw/bearerbox.c gateway-1.4.3/gw/bearerbox.c
---- gateway-1.4.3.orig/gw/bearerbox.c 2009-01-12 16:46:56.000000000 +0000
-+++ gateway-1.4.3/gw/bearerbox.c 2009-03-01 14:23:05.000000000 +0000
-@@ -78,6 +78,7 @@
- #include "shared.h"
- #include "dlr.h"
- #include "load.h"
-+#include "custports.h"
-
- /* global variables; included to other modules as needed */
-
-@@ -365,6 +366,7 @@
- int ssl_enabled = 0;
- #endif /* HAVE_LIBSSL */
-
-+ ReadCustomPorts(cfg);
- /* defaults: use localtime and markers for access-log */
- lf = m = 1;
-
-diff -Nru gateway-1.4.3.orig/gw/custports.c gateway-1.4.3/gw/custports.c
---- gateway-1.4.3.orig/gw/custports.c 1970-01-01 00:00:00.000000000 +0000
-+++ gateway-1.4.3/gw/custports.c 2009-03-01 14:20:38.000000000 +0000
-@@ -0,0 +1,88 @@
-+/* ====================================================================
-+ * The Kannel Software License, Version 1.0
-+ *
-+ * Copyright (c) 2001-2004 Kannel Group
-+ * Copyright (c) 1998-2001 WapIT Ltd.
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The end-user documentation included with the redistribution,
-+ * if any, must include the following acknowledgment:
-+ * "This product includes software developed by the
-+ * Kannel Group (http://www.kannel.org/)."
-+ * Alternately, this acknowledgment may appear in the software itself,
-+ * if and wherever such third-party acknowledgments normally appear.
-+ *
-+ * 4. The names "Kannel" and "Kannel Group" must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission. For written permission, please
-+ * contact org@kannel.org.
-+ *
-+ * 5. Products derived from this software may not be called "Kannel",
-+ * nor may "Kannel" appear in their name, without prior written
-+ * permission of the Kannel Group.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+ * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ * ====================================================================
-+ *
-+ * This software consists of voluntary contributions made by many
-+ * individuals on behalf of the Kannel Group. For more information on
-+ * the Kannel Group, please see <http://www.kannel.org/>.
-+ *
-+ * Portions of this software are based upon software originally written at
-+ * WapIT Ltd., Helsinki, Finland for the Kannel project.
-+ */
-+
-+/*
-+ * gw/custports.c
-+ *
-+ * Implementation of reading custom UDP ports used by wapbox
-+ *
-+ * Lubor Kolar <kolar@porcus.cz>, 14.03.2006
-+ */
-+
-+#include <custports.h>
-+
-+long port_wsp = 9200; // connectionless default
-+long port_wtp = 9201; // connection-oriented default
-+long port_wsps = 9202; // connectionless secure default
-+long port_wtps = 9203; // connection-oriented secure
-+
-+
-+void ReadCustomPorts(Cfg *config)
-+{
-+ CfgGroup *grp;
-+ grp = cfg_get_single_group(config, octstr_imm("wapbox"));
-+ if(grp == NULL)
-+ return;
-+
-+ if(cfg_get_integer(&port_wsp, grp, octstr_imm("wsp-port")) != -1)
-+ info(0, "Using custom WSP port %ld", port_wsp);
-+ if(cfg_get_integer(&port_wtp, grp, octstr_imm("wtp-port")) != -1)
-+ info(0, "Using custom WSP/WTP port %ld", port_wtp);
-+ if(cfg_get_integer(&port_wsps, grp, octstr_imm("wsps-port")) != -1)
-+ info(0, "Using custom WSP/WTLS port %ld", port_wsps);
-+ if(cfg_get_integer(&port_wtps, grp, octstr_imm("wtps-port")) != -1)
-+ info(0, "Using custom WSP/WTP/WTLS port %ld", port_wtps);
-+}
-diff -Nru gateway-1.4.3.orig/gw/custports.h gateway-1.4.3/gw/custports.h
---- gateway-1.4.3.orig/gw/custports.h 1970-01-01 00:00:00.000000000 +0000
-+++ gateway-1.4.3/gw/custports.h 2009-03-01 14:20:38.000000000 +0000
-@@ -0,0 +1,77 @@
-+/* ====================================================================
-+ * The Kannel Software License, Version 1.0
-+ *
-+ * Copyright (c) 2001-2004 Kannel Group
-+ * Copyright (c) 1998-2001 WapIT Ltd.
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ *
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ *
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in
-+ * the documentation and/or other materials provided with the
-+ * distribution.
-+ *
-+ * 3. The end-user documentation included with the redistribution,
-+ * if any, must include the following acknowledgment:
-+ * "This product includes software developed by the
-+ * Kannel Group (http://www.kannel.org/)."
-+ * Alternately, this acknowledgment may appear in the software itself,
-+ * if and wherever such third-party acknowledgments normally appear.
-+ *
-+ * 4. The names "Kannel" and "Kannel Group" must not be used to
-+ * endorse or promote products derived from this software without
-+ * prior written permission. For written permission, please
-+ * contact org@kannel.org.
-+ *
-+ * 5. Products derived from this software may not be called "Kannel",
-+ * nor may "Kannel" appear in their name, without prior written
-+ * permission of the Kannel Group.
-+ *
-+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
-+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+ * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
-+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ * ====================================================================
-+ *
-+ * This software consists of voluntary contributions made by many
-+ * individuals on behalf of the Kannel Group. For more information on
-+ * the Kannel Group, please see <http://www.kannel.org/>.
-+ *
-+ * Portions of this software are based upon software originally written at
-+ * WapIT Ltd., Helsinki, Finland for the Kannel project.
-+ */
-+
-+/*
-+ * gw/custports.h
-+ *
-+ * Implementation of wapbox custom UDP ports)
-+ *
-+ * Lubor Kolar <kolar@porcus.cz>, 14.03.2006
-+ */
-+
-+#ifndef CUSTPORTS_H
-+#define CUSTPORTS_H
-+
-+#include "gwlib/gwlib.h"
-+
-+extern long port_wsp; // connectionless
-+extern long port_wtp; // connection-oriented
-+extern long port_wsps; // connectionless secure
-+extern long port_wtps; // connection-oriented secure
-+
-+void ReadCustomPorts(Cfg *config);
-+#endif /* CUSTPORTS_H */
-+
-diff -Nru gateway-1.4.3.orig/gw/wapbox.c gateway-1.4.3/gw/wapbox.c
---- gateway-1.4.3.orig/gw/wapbox.c 2009-01-12 16:46:57.000000000 +0000
-+++ gateway-1.4.3/gw/wapbox.c 2009-03-01 14:20:38.000000000 +0000
-@@ -84,17 +84,11 @@
- #include "gwlib/pki.h"
- #endif
- #include "radius/radius_acct.h"
-+#include "custports.h"
-
- static void config_reload(int reload);
- static long logfilelevel=-1;
-
--enum {
-- CONNECTIONLESS_PORT = 9200,
-- CONNECTION_ORIENTED_PORT = 9201,
-- WTLS_CONNECTIONLESS_PORT = 9202,
-- WTLS_CONNECTION_ORIENTED_PORT = 9203
--};
--
- enum { DEFAULT_TIMER_FREQ = 1};
-
- static Octstr *bearerbox_host;
-@@ -131,6 +125,8 @@
-
- cfg_dump(cfg);
-
-+ ReadCustomPorts(cfg);
-+
- /*
- * Extract info from the core group.
- */
-@@ -776,9 +772,9 @@
- * XXXX here should be suspend/resume, add RSN
- */
- } else if (msg_type(msg) == wdp_datagram) {
-- switch (msg->wdp_datagram.destination_port) {
-- case CONNECTIONLESS_PORT:
-- case CONNECTION_ORIENTED_PORT:
-+ if(msg->wdp_datagram.destination_port == port_wsp
-+ || msg->wdp_datagram.destination_port == port_wtp)
-+ {
- dgram = wap_event_create(T_DUnitdata_Ind);
- dgram->u.T_DUnitdata_Ind.addr_tuple = wap_addr_tuple_create(
- msg->wdp_datagram.source_address,
-@@ -789,19 +785,22 @@
- msg->wdp_datagram.user_data = NULL;
-
- wap_dispatch_datagram(dgram);
-- break;
-- case WTLS_CONNECTIONLESS_PORT:
-- case WTLS_CONNECTION_ORIENTED_PORT:
-+ }
-+ else
-+ if(msg->wdp_datagram.destination_port == port_wsps
-+ || msg->wdp_datagram.destination_port == port_wtps)
-+ {
- #if (HAVE_WTLS_OPENSSL)
- dgram = wtls_unpack_wdp_datagram(msg);
- if (dgram != NULL)
- wtls_dispatch_event(dgram);
- #endif
-- break;
-- default:
-+ }
-+ else
-+ {
- panic(0,"Bad packet received! This shouldn't happen!");
- break;
-- }
-+ }
- } else {
- warning(0, "Received other message than wdp/admin, ignoring!");
- }
-diff -Nru gateway-1.4.3.orig/gw/wap_push_ppg.c gateway-1.4.3/gw/wap_push_ppg.c
---- gateway-1.4.3.orig/gw/wap_push_ppg.c 2009-01-12 16:46:56.000000000 +0000
-+++ gateway-1.4.3/gw/wap_push_ppg.c 2009-03-01 14:20:38.000000000 +0000
-@@ -88,6 +88,7 @@
- #include "wap_push_pap_compiler.h"
- #include "wap_push_pap_mime.h"
- #include "wap_push_ppg_pushuser.h"
-+#include "custports.h"
-
- enum {
- TIME_EXPIRED = 0,
-@@ -1779,10 +1780,10 @@
-
- if (!cless_accepted) {
- cliport = CONNECTED_CLIPORT;
-- servport = CONNECTED_SERVPORT;
-+ servport = port_wtp;
- } else {
- cliport = CONNECTIONLESS_PUSH_CLIPORT;
-- servport = CONNECTIONLESS_SERVPORT;
-+ servport = port_wsp;
- }
-
- address_type = (**e).u.Push_Message.address_type;
-diff -Nru gateway-1.4.3.orig/gw/wap_push_ppg.h gateway-1.4.3/gw/wap_push_ppg.h
---- gateway-1.4.3.orig/gw/wap_push_ppg.h 2009-01-12 16:46:57.000000000 +0000
-+++ gateway-1.4.3/gw/wap_push_ppg.h 2009-03-01 14:20:38.000000000 +0000
-@@ -167,9 +167,7 @@
- */
- enum {
- CONNECTIONLESS_PUSH_CLIPORT = 2948,
-- CONNECTIONLESS_SERVPORT = 9200,
- CONNECTED_CLIPORT = 9209,
-- CONNECTED_SERVPORT = 9201
- };
-
- struct PPGSessionMachine {
-diff -Nru gateway-1.4.3.orig/gwlib/cfg.def gateway-1.4.3/gwlib/cfg.def
---- gateway-1.4.3.orig/gwlib/cfg.def 2009-01-12 16:46:55.000000000 +0000
-+++ gateway-1.4.3/gwlib/cfg.def 2009-03-01 14:20:38.000000000 +0000
-@@ -159,6 +159,10 @@
- OCTSTR(concatenation)
- OCTSTR(max-messages)
- OCTSTR(wml-strict)
-+ OCTSTR(wsp-port)
-+ OCTSTR(wtp-port)
-+ OCTSTR(wsps-port)
-+ OCTSTR(wtps-port)
- )
-
-
diff --git a/app-mobilephone/kannel/kannel-1.5.0-r4.ebuild b/app-mobilephone/kannel/kannel-1.5.0-r4.ebuild
new file mode 100644
index 000000000000..685697eb64d2
--- /dev/null
+++ b/app-mobilephone/kannel/kannel-1.5.0-r4.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+WANT_AUTOMAKE=none
+
+inherit autotools flag-o-matic ssl-cert user
+
+DESCRIPTION="Powerful SMS and WAP gateway"
+HOMEPAGE="http://www.kannel.org/"
+SRC_URI="http://www.kannel.org/download/${PV}/gateway-${PV}.tar.gz"
+
+LICENSE="Apache-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc mysql libressl pam pcre postgres sqlite ssl"
+
+RESTRICT="test" # some tests fail with "address already in use"
+
+RDEPEND="
+ sys-libs/e2fsprogs-libs
+ dev-libs/libxml2:2
+ dev-lang/perl
+ sys-libs/zlib
+ ssl? (
+ libressl? ( dev-libs/libressl:0= )
+ !libressl? ( dev-libs/openssl:0= ) )
+ mysql? ( dev-db/mysql-connector-c:= )
+ sqlite? ( dev-db/sqlite:3 )
+ postgres? ( dev-db/postgresql:=[server] )
+ pcre? ( dev-libs/libpcre:3 )
+ pam? ( virtual/pam )
+"
+DEPEND="${RDEPEND}
+ >=sys-devel/bison-2.2
+ doc? ( media-gfx/transfig
+ app-text/jadetex
+ app-text/docbook-dsssl-stylesheets
+ app-text/docbook-sgml-dtd:3.1 )
+"
+
+S="${WORKDIR}/gateway-${PV}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.5.0-custom-wap-ports.patch"
+ "${FILESDIR}/${PN}-1.4.3-autotools.patch"
+ "${FILESDIR}/${PN}-1.4.3-external-libuuid.patch"
+ "${FILESDIR}/${PN}-1.5.0-initgroups.patch"
+)
+
+pkg_setup() {
+ enewgroup kannel
+ enewuser kannel -1 -1 /var/log/kannel kannel
+}
+
+src_prepare() {
+ default
+
+ #by default, use current directory for logging
+ sed -i -e 's:/tmp/::' doc/examples/kannel.conf
+
+ mv configure.in configure.ac || die
+ eautoconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing # some code breaks strict aliasing
+ econf \
+ --enable-localtime \
+ --disable-start-stop-daemon \
+ --without-sqlite2 \
+ $(use_enable pam) \
+ $(use_enable debug debug) \
+ $(use_enable pcre) \
+ $(use_enable doc docs) \
+ $(use_enable ssl) \
+ $(use_with mysql) \
+ $(use_with sqlite sqlite3) \
+ $(use_with postgres pgsql)
+}
+
+# phase disabled by RESTRICT
+# src_test() {
+# emake check || die "emake check failed"
+# }
+
+src_install() {
+ default
+
+ if use doc; then
+ emake -j1 DESTDIR="${D}" install-docs || die "emake install-docs failed"
+ fi
+
+ diropts -g kannel -m0750
+ dodir /etc/kannel
+ insinto /etc/kannel
+ newins doc/examples/kannel.conf kannel.conf.sample
+
+ local f
+ for f in bearerbox smsbox wapbox; do
+ newinitd "${FILESDIR}/kannel-$f.initd" kannel-$f
+ done
+
+ diropts -g kannel -m0770
+ keepdir /var/log/kannel
+}
+
+pkg_postinst() {
+ if use ssl; then
+ elog "SSL certificate can be created by running"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ fi
+}
+
+pkg_config() {
+ if use ssl; then
+ if install_cert /etc/ssl/kannel; then
+ chown kannel "${ROOT}"etc/ssl/kannel.{pem,key}
+ einfo "For using this certificate, you have to add following line to your kannel.conf:"
+ einfo ' ssl-client-certkey-file = "/etc/ssl/kannel.pem"'
+ einfo ' ssl-server-cert-file = "/etc/ssl/kannel.crt"'
+ einfo ' ssl-server-key-file = "/etc/ssl/kannel.key"'
+ fi
+ else
+ eerror "This phase exists only for creating kannel SSL certificate"
+ eerror "and ssl USE flag is disabled for this package!"
+ fi
+}