aboutsummaryrefslogtreecommitdiffstats
path: root/testing/kannel
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2015-07-29 11:45:38 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2015-07-29 11:45:43 +0000
commitcea1479d55a6f1246704c6ba12358d78c076d47a (patch)
tree793a7be14ed0b57362c67dd4d378758a26be5a9e /testing/kannel
parentd4f9e959e4cd7a6ecdaf50356b364758b0e0a5f8 (diff)
downloadaports-cea1479d55a6f1246704c6ba12358d78c076d47a.tar.bz2
aports-cea1479d55a6f1246704c6ba12358d78c076d47a.tar.xz
testing/kannel: new aport
Diffstat (limited to 'testing/kannel')
-rw-r--r--testing/kannel/APKBUILD81
-rw-r--r--testing/kannel/kannel-1.5.0-custom-wap-ports.patch346
-rw-r--r--testing/kannel/kannel-bearerbox.initd35
-rw-r--r--testing/kannel/kannel-smsbox.initd34
-rw-r--r--testing/kannel/kannel-wapbox.initd34
-rw-r--r--testing/kannel/kannel.confd10
-rw-r--r--testing/kannel/kannel.initd68
7 files changed, 608 insertions, 0 deletions
diff --git a/testing/kannel/APKBUILD b/testing/kannel/APKBUILD
new file mode 100644
index 0000000000..0b043b7df9
--- /dev/null
+++ b/testing/kannel/APKBUILD
@@ -0,0 +1,81 @@
+# Contributor: Francesco Colista <fcolista@alpinelinux.org>
+# Maintainer:
+pkgname=kannel
+pkgver=1.5.0
+pkgrel=0
+pkgdesc="Opensource WAP/SMS Gateway"
+url="http://www.kannel.org"
+arch="all"
+license="custom"
+depends=""
+depends_dev="libxml2-dev mariadb-dev postgresql-dev pcre-dev sqlite-dev"
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://www.kannel.org/download/$pkgver/gateway-$pkgver.tar.bz2
+ $pkgname-bearerbox.initd
+ $pkgname-smsbox.initd
+ $pkgname-wapbox.initd
+ $pkgname.initd
+ $pkgname.confd
+ kannel-1.5.0-custom-wap-ports.patch"
+
+_builddir="$srcdir"/gateway-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --enable-pcre \
+ --with-sqlite3 \
+ --with-pgsql \
+ --with-mysql
+ touch .depend
+ make depend
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR=$pkgdir install
+ make DESTDIR=$pkgdir install-test
+ mkdir -p $pkgdir/var/log/kannel/
+ install -Dm755 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname.initd
+ install -Dm755 "$srcdir"/$pkgname-bearerbox.initd "$pkgdir"/etc/init.d/$pkgname-bearerbox.initd
+ install -Dm755 "$srcdir"/$pkgname-wapbox.initd "$pkgdir"/etc/init.d/$pkgname-wapbox.initd
+ install -Dm755 "$srcdir"/$pkgname-smsbox.initd "$pkgdir"/etc/init.d/$pkgname-smsbox.initd
+ install -D -m 644 LICENSE $pkgdir/usr/share/licenses/$pkgname/COPYING
+}
+
+md5sums="7809cccaef27d1fad07618831e0ef4b5 gateway-1.5.0.tar.bz2
+6c6acbe564dab69b100230c486bca6bc kannel-bearerbox.initd
+9eb19bf89c29648611a7aa8686d2c385 kannel-smsbox.initd
+3ed7268481e81b4af9602e45187d09da kannel-wapbox.initd
+3c8b53c560edb5bb2372c146d752d15b kannel.initd
+b77f55cded4c364d155c302e81eb07c6 kannel.confd
+d17d349b71d5c59ebf25c1160e20178f kannel-1.5.0-custom-wap-ports.patch"
+sha256sums="e882cd2641985922a6629788691f12deb3e1d36a96cc1091df9416825bb1506a gateway-1.5.0.tar.bz2
+17bec60531f2f42468b392c3c35b783a6237ca6731116d915e648adf1fbea072 kannel-bearerbox.initd
+96acf214452733d41cdc564c209128b7f3b667ae00dda3720004708fb8960475 kannel-smsbox.initd
+700af491b04ebe5d4b0522211c165a6d0aa898f99098b89d90f790759cfec54f kannel-wapbox.initd
+c1dc73405ddde6fd9ab3645298ee690c2e48b7bee19146eece711555e9e85aa8 kannel.initd
+78afde2b41edad9338894b2eab5968c2c93a2a657745d0bb8d2d1ba401d7cee0 kannel.confd
+024874118ccb7ff2d0a4a42229b3639910bec6bbc02b6d251097303599392aa3 kannel-1.5.0-custom-wap-ports.patch"
+sha512sums="dff990a6856e23bd4c88f993f8a1973b35b02e7408410e228710611cb0fc4c70899bed3703e811c39af24e968fbe3b8e9c4eeac4f76dd68d8caa5287012fa289 gateway-1.5.0.tar.bz2
+aff82592ed5f5ef0af00e04a6f1013f1601141ce00d0c5c281d394661f9ffe332745bc825cc4873286ad69580ae6a8067c6ee0840e8683904e74defcf8cfa16e kannel-bearerbox.initd
+673ea6a0c30474c94ca04b79b558a68c91a79510d7b31d380c206f3b283a73d5bbe188d62769d748247c708af5eee01ceba343db70d52718c8a035fdd5ea863a kannel-smsbox.initd
+a64dfbbb1382e0494354efcc4d549c186a5f0c492ea2a064a20355369972e00a023bdade4bcb3262b33e4c3ebdf259f0aaea552fb3d6e1e3b4999fedf495af7a kannel-wapbox.initd
+e76c98a276953562ef05c23209270551fe431618ca83f90f557d510dd78f512e9844f9431f89ca7ad97af844af1536678a26395a4ebb438ec800ea35e3144032 kannel.initd
+042840638cc5166cf6a76d76c7b6c96aa3c77648a50f4e316195d564fde47a9ad3d6b66d5283175f8f2053171ae785772609b49f8db88579a0bfcda757ecbe0a kannel.confd
+cd71a435feadb43533ed06cf0a1f9e556131f5339951cc1971c9ebf922a5e028b390af978441d7d3fde68022f9c67fe3af69be737d9952614486613f7ba29d23 kannel-1.5.0-custom-wap-ports.patch"
diff --git a/testing/kannel/kannel-1.5.0-custom-wap-ports.patch b/testing/kannel/kannel-1.5.0-custom-wap-ports.patch
new file mode 100644
index 0000000000..63981f9859
--- /dev/null
+++ b/testing/kannel/kannel-1.5.0-custom-wap-ports.patch
@@ -0,0 +1,346 @@
+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 -ruN gateway-1.5.0/gwlib/cfg.def gateway-1.5.0-patched/gwlib/cfg.def
+--- gateway-1.5.0.orig/gwlib/cfg.def 2010-10-07 10:03:35.000000000 -0400
++++ gateway-1.5.0/gwlib/cfg.def 2013-08-25 15:07:47.544662379 -0400
+@@ -160,6 +160,10 @@
+ OCTSTR(concatenation)
+ OCTSTR(max-messages)
+ OCTSTR(wml-strict)
++ OCTSTR(wsp-port)
++ OCTSTR(wtp-port)
++ OCTSTR(wsps-port)
++ OCTSTR(wtps-port)
+ OCTSTR(http-timeout)
+ )
+
diff --git a/testing/kannel/kannel-bearerbox.initd b/testing/kannel/kannel-bearerbox.initd
new file mode 100644
index 0000000000..a576012278
--- /dev/null
+++ b/testing/kannel/kannel-bearerbox.initd
@@ -0,0 +1,35 @@
+#!/sbin/openrc-run
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/kannel/files/kannel-bearerbox.initd,v 1.1 2009/09/25 01:20:06 mrness Exp $
+
+KANNEL_SERVICE=${SVCNAME#*-}
+
+depend() {
+ need net
+ after dns mysql postgresql
+}
+
+checkconfig() {
+ if [ ! -f /etc/kannel/kannel.conf ] ; then
+ eerror "/etc/kannel/kannel.conf file doesn't exists!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --start --quiet --exec /usr/sbin/${KANNEL_SERVICE} -- \
+ --daemonize --user kannel --logfile /var/log/kannel/${KANNEL_SERVICE}.log \
+ --pid-file /var/run/kannel/${KANNEL_SERVICE}.pid /etc/kannel/kannel.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --stop --verbose --pidfile /var/run/kannel/${KANNEL_SERVICE}.pid
+ eend $?
+}
+
diff --git a/testing/kannel/kannel-smsbox.initd b/testing/kannel/kannel-smsbox.initd
new file mode 100644
index 0000000000..b5b8356bd3
--- /dev/null
+++ b/testing/kannel/kannel-smsbox.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/kannel/files/kannel-smsbox.initd,v 1.1 2009/09/25 01:20:06 mrness Exp $
+
+KANNEL_SERVICE=${SVCNAME#*-}
+
+depend() {
+ need kannel-bearerbox
+}
+
+checkconfig() {
+ if [ ! -f /etc/kannel/kannel.conf ] ; then
+ eerror "/etc/kannel/kannel.conf file doesn't exists!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --start --quiet --exec /usr/sbin/${KANNEL_SERVICE} -- \
+ --daemonize --user kannel --logfile /var/log/kannel/${KANNEL_SERVICE}.log \
+ --pid-file /var/run/kannel/${KANNEL_SERVICE}.pid /etc/kannel/kannel.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --stop --verbose --pidfile /var/run/kannel/${KANNEL_SERVICE}.pid
+ eend $?
+}
+
diff --git a/testing/kannel/kannel-wapbox.initd b/testing/kannel/kannel-wapbox.initd
new file mode 100644
index 0000000000..f0d47659f3
--- /dev/null
+++ b/testing/kannel/kannel-wapbox.initd
@@ -0,0 +1,34 @@
+#!/sbin/openrc-run
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-mobilephone/kannel/files/kannel-wapbox.initd,v 1.1 2009/09/25 01:20:06 mrness Exp $
+
+KANNEL_SERVICE=${SVCNAME#*-}
+
+depend() {
+ need kannel-bearerbox
+}
+
+checkconfig() {
+ if [ ! -f /etc/kannel/kannel.conf ] ; then
+ eerror "/etc/kannel/kannel.conf file doesn't exists!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --start --quiet --exec /usr/sbin/${KANNEL_SERVICE} -- \
+ --daemonize --user kannel --logfile /var/log/kannel/${KANNEL_SERVICE}.log \
+ --pid-file /var/run/kannel/${KANNEL_SERVICE}.pid /etc/kannel/kannel.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping kannel ${KANNEL_SERVICE}"
+ start-stop-daemon --stop --verbose --pidfile /var/run/kannel/${KANNEL_SERVICE}.pid
+ eend $?
+}
+
diff --git a/testing/kannel/kannel.confd b/testing/kannel/kannel.confd
new file mode 100644
index 0000000000..686be7ebc7
--- /dev/null
+++ b/testing/kannel/kannel.confd
@@ -0,0 +1,10 @@
+START_SMSBOX=yes
+START_WAPBOX=yes
+
+#See the documentation for setting proper options
+#Note: verbosity codes are strange!
+# Default is 0, which means 'debug'. 1 is 'info, 2 'warning', 3 'error' and 4 'panic'
+
+BEARERBOX_OPTS="--verbosity 1 --logfile bearerbox.log"
+SMSBOX_OPTS="--verbosity 1 --logfile smsbox.log"
+WAPBOX_OPTS="--verbosity 1 --logfile wapbox.log"
diff --git a/testing/kannel/kannel.initd b/testing/kannel/kannel.initd
new file mode 100644
index 0000000000..ddb5c7a13a
--- /dev/null
+++ b/testing/kannel/kannel.initd
@@ -0,0 +1,68 @@
+#!/sbin/openrc-run
+
+depend() {
+ need net
+ after mysql postgresql sshd
+}
+
+checkconfig() {
+ if [ ! -f /etc/kannel/kannel.conf ] ; then
+ eerror "/etc/kannel/kannel.conf file doesn't exists!"
+ return 1
+ fi
+ #set the location of logs
+ if ! cd /var/log/kannel ; then
+ eerror "/var/log/kannel directory doesn't exists!"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ einfo "Starting Kannel"
+ ebegin " - Bearer Box"
+ start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/bearerbox \
+ --background -- $BEARERBOX_OPTS /etc/kannel/kannel.conf
+ eend $? || return 1
+
+ if [ "$START_SMSBOX" = "yes" ] ; then
+ ebegin " - SMS Box"
+ start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/smsbox \
+ --background -- $SMSBOX_OPTS /etc/kannel/kannel.conf
+ eend $?
+ fi
+
+ if [ "$START_WAPBOX" = "yes" ] ; then
+ ebegin " - WAP Box"
+ start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/wapbox \
+ --background -- $WAPBOX_OPTS /etc/kannel/kannel.conf
+ eend $?
+ fi
+
+ return 0
+}
+
+stop() {
+ if [ "$START_WAPBOX" = "yes" ] ; then
+ einfo "Stopping Kannel"
+ ebegin " - WAP Box"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/wapbox
+ eend $?
+ fi
+
+ if [ "$START_SMSBOX" = "yes" ] ; then
+ ebegin " - SMS Box"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/smsbox
+ eend $?
+ fi
+
+ ebegin " - Bearer Box"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/bearerbox
+ eend $?
+
+ #stopping any other processes owned by kannel user
+ start-stop-daemon --stop --quiet --user kannel
+
+ return 0
+}