Permalink
Browse files

add net/kannel

  • Loading branch information...
1 parent cc8a3ff commit 8d3f9566f9eb8622e90de2a29828a92435c69385 @krp-kp krp-kp committed May 20, 2012
Showing with 2,693 additions and 0 deletions.
  1. +81 −0 net/kannel/Makefile
  2. +5 −0 net/kannel/distinfo
  3. +112 −0 net/kannel/files/kannelctl
  4. +17 −0 net/kannel/files/smsbox_enable
  5. +17 −0 net/kannel/files/wapbox_enable
  6. +37 −0 net/kannel/patches/patch-doc_examples_kannel_conf
  7. +31 −0 net/kannel/patches/patch-gw_bb_boxc_c
  8. +37 −0 net/kannel/patches/patch-gw_bb_smscconn_c
  9. +18 −0 net/kannel/patches/patch-gw_bearerbox_c
  10. +14 −0 net/kannel/patches/patch-gw_kannel_8
  11. +37 −0 net/kannel/patches/patch-gw_msg-decl_h
  12. +107 −0 net/kannel/patches/patch-gw_msg_c
  13. +27 −0 net/kannel/patches/patch-gw_msg_h
  14. +12 −0 net/kannel/patches/patch-gw_shared_c
  15. +28 −0 net/kannel/patches/patch-gw_smsbox_c
  16. +54 −0 net/kannel/patches/patch-gw_smsc_smsc_at_c
  17. +12 −0 net/kannel/patches/patch-gw_smsc_smsc_c
  18. +48 −0 net/kannel/patches/patch-gw_smsc_smsc_cimd2_c
  19. +66 −0 net/kannel/patches/patch-gw_smsc_smsc_cimd_c
  20. +21 −0 net/kannel/patches/patch-gw_smsc_smsc_emi_c
  21. +220 −0 net/kannel/patches/patch-gw_smsc_smsc_emi_x25_c
  22. +48 −0 net/kannel/patches/patch-gw_smsc_smsc_ois_c
  23. +32 −0 net/kannel/patches/patch-gw_smsc_smsc_sema_c
  24. +12 −0 net/kannel/patches/patch-gw_smsc_smsc_smpp_c
  25. +41 −0 net/kannel/patches/patch-gw_smsc_smsc_soap_c
  26. +12 −0 net/kannel/patches/patch-gw_wap-appl_c
  27. +32 −0 net/kannel/patches/patch-gw_wap_ppg_push_machine_def
  28. +32 −0 net/kannel/patches/patch-gw_wap_ppg_session_machine_def
  29. +39 −0 net/kannel/patches/patch-gw_wap_push_ppg_c
  30. +21 −0 net/kannel/patches/patch-gw_wap_push_ppg_h
  31. +34 −0 net/kannel/patches/patch-gwlib_accesslog_c
  32. +12 −0 net/kannel/patches/patch-gwlib_date_c
  33. +16 −0 net/kannel/patches/patch-gwlib_gw_uuid_c
  34. +12 −0 net/kannel/patches/patch-gwlib_gwmem-check_c
  35. +62 −0 net/kannel/patches/patch-gwlib_log_c
  36. +12 −0 net/kannel/patches/patch-gwlib_md5_c
  37. +83 −0 net/kannel/patches/patch-gwlib_octstr_c
  38. +21 −0 net/kannel/patches/patch-test_decompile_c
  39. +12 −0 net/kannel/patches/patch-test_test_cimd2_c
  40. +12 −0 net/kannel/patches/patch-test_test_http_c
  41. +12 −0 net/kannel/patches/patch-test_test_xmlrpc_c
  42. +11 −0 net/kannel/patches/patch-utils_run_kannel_box_8
  43. +21 −0 net/kannel/patches/patch-wap_cookies_c
  44. +13 −0 net/kannel/patches/patch-wap_wap_addr_c
  45. +30 −0 net/kannel/patches/patch-wap_wsp_h
  46. +21 −0 net/kannel/patches/patch-wap_wsp_push_client_c
  47. +12 −0 net/kannel/patches/patch-wap_wsp_push_client_h
  48. +25 −0 net/kannel/patches/patch-wap_wsp_push_client_machine_def
  49. +23 −0 net/kannel/patches/patch-wap_wsp_server_method_machine_def
  50. +32 −0 net/kannel/patches/patch-wap_wsp_server_push_machine_def
  51. +28 −0 net/kannel/patches/patch-wap_wsp_server_session_machine_def
  52. +57 −0 net/kannel/patches/patch-wap_wsp_session_c
  53. +21 −0 net/kannel/patches/patch-wap_wtls_c
  54. +12 −0 net/kannel/patches/patch-wap_wtls_h
  55. +32 −0 net/kannel/patches/patch-wap_wtls_machine-decl_h
  56. +417 −0 net/kannel/patches/patch-wap_wtls_statesupport_c
  57. +21 −0 net/kannel/patches/patch-wap_wtp_init_c
  58. +12 −0 net/kannel/patches/patch-wap_wtp_init_h
  59. +32 −0 net/kannel/patches/patch-wap_wtp_init_machine_def
  60. +21 −0 net/kannel/patches/patch-wap_wtp_resp_c
  61. +12 −0 net/kannel/patches/patch-wap_wtp_resp_h
  62. +32 −0 net/kannel/patches/patch-wap_wtp_resp_machine_def
  63. +14 −0 net/kannel/patches/patch-wmlscript_wmlsc_c
  64. +12 −0 net/kannel/patches/patch-wmlscript_wslexer_c
  65. +3 −0 net/kannel/pkg/DESCR
  66. +178 −0 net/kannel/pkg/PLIST
  67. +20 −0 net/kannel/pkg/README
  68. +23 −0 net/kannel/pkg/kannel.rc
View
@@ -0,0 +1,81 @@
+# $OpenBSD:
+
+COMMENT = compact and very powerful WAP and SMS gateway
+
+VERSION = 1.5.0
+SVNDATE = 20120512
+DISTNAME = kannel-${VERSION}-${SVNDATE}
+PKGNAME = kannel-${VERSION}
+EXTRACT_SUFX = .tar.bz2
+
+CATEGORIES = net
+MAINTAINER = Roman Kravchuk <kravchuk.kp@gmail.com>
+
+HOMEPAGE = http://kannel.org/
+
+# Kannel Software License 1.0
+PERMIT_PACKAGE_CDROM = Yes
+PERMIT_PACKAGE_FTP = Yes
+PERMIT_DISTFILES_CDROM =Yes
+PERMIT_DISTFILES_FTP = Yes
+
+MASTER_SITES = http://spacehopper.org/mirrors/
+
+LDFLAGS="${LDFLAGS} -pthread"
+
+WANTLIB = c crypto m ssl z pthread ssl xml2 iconv
+
+LIB_DEPENDS = textproc/libxml,-main,no_python\
+ converters/libiconv
+
+USE_GMAKE = Yes
+CONFIGURE_STYLE = gnu
+CONFIGURE_ARGS += --enable-warnings
+
+WRKDIST = ${WRKDIR}/gateway-1.5.0
+
+NO_REGRESS = Yes
+
+PSEUDO_FLAVORS = no_pgsql no_mysql no_sqlite pcre
+
+FLAVOR ?=
+
+.if !${FLAVOR:L:Mno_pgsql}
+ CONFIGURE_ARGS += --with-pgsql
+ WANTLIB += pq
+ LIB_DEPENDS += databases/postgresql,-main
+.endif
+
+.if !${FLAVOR:L:Mno_mysql}
+ CONFIGURE_ARGS += --with-mysql
+ WANTLIB += crypto m ssl z mysqlclient lib/mysql/mysqlclient_r
+ LIB_DEPENDS += databases/mysql,-main
+.endif
+
+.if !${FLAVOR:L:Mno_sqlite}
+ CONFIGURE_ARGS += --with-sqlite3
+ WANTLIB += sqlite3 z
+ LIB_DEPENDS += databases/sqlite3
+.endif
+
+.if ${FLAVOR:L:Mpcre}
+ CONFIGURE_ARGS += --enable-pcre
+ WANTLIB += pcre pcreposix
+ LIB_DEPENDS += devel/pcre
+.endif
+
+
+SH_SCRIPTS = kannelctl smsbox_enable wapbox_enable
+
+post-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/kannel
+ ${INSTALL_DATA} ${WRKSRC}/doc/examples/kannel.conf \
+ ${WRKSRC}/doc/examples/modems.conf \
+ ${WRKSRC}/doc/examples/dlr-mysql.conf \
+ ${WRKSRC}/doc/examples/dlr-sqlite3.conf \
+ ${PREFIX}/share/examples/kannel
+.for i in ${SH_SCRIPTS}
+ ${INSTALL_SCRIPT} ${FILESDIR}/$i ${PREFIX}/sbin
+.endfor
+
+.include <bsd.port.mk>
View
@@ -0,0 +1,5 @@
+MD5 (kannel-1.5.0-20120512.tar.bz2) = fBy6wHMtbjaUWZ3q6o2L5w==
+RMD160 (kannel-1.5.0-20120512.tar.bz2) = NqY0raKMeOtsHGfeTxv7qKCtNDE=
+SHA1 (kannel-1.5.0-20120512.tar.bz2) = lWGIyLym+x3pZsRKTvnDfbqRE8E=
+SHA256 (kannel-1.5.0-20120512.tar.bz2) = E2o4O8XMILvKbuitidHnQhKEGQM+kbpMB7waAZ3JD+s=
+SIZE (kannel-1.5.0-20120512.tar.bz2) = 5291971
View
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+CONF="/etc/kannel/kannel.conf"
+RUN="/usr/local/sbin/run_kannel_box"
+BEARERBOX="/usr/local/sbin/bearerbox"
+SMSBOX="/usr/local/sbin/smsbox"
+WAPBOX="/usr/local/sbin/wapbox"
+PID_DIR="/var/run/kannel"
+USER="_kannel"
+
+if [ -f "/usr/local/share/kannel/enabled_kannel_box" ]; then
+ . "/usr/local/share/kannel/enabled_kannel_box"
+fi
+
+if [[ ${SMSBOX_ENABLED} != "yes" && ${WAPBOX_ENABLED} != "yes" ]]; then
+ printf "You do not have enabled kannel box ...\n"
+ exit 1
+fi
+
+kannel_start() {
+ PID=`pgrep -f "${BEARERBOX}"`
+ if [ $? = 0 ]; then
+ printf "Kannel is already running...\n"
+ exit 1
+ else
+ rm -rf ${PID_DIR}/*
+
+ printf "Starting kannel bearer box ...\n"
+ ${RUN} --pidfile ${PID_DIR}/kannel_bearerbox.pid ${BEARERBOX} -u ${USER} -p ${PID_DIR}/bearerbox.pid ${CONF}
+ sleep 10
+ if [ ! -f ${PID_DIR}/bearerbox.pid ] ; then
+ if [ ! -f ${PID_DIR}/kannel_bearerbox.pid ] ; then
+ kill `cat ${PID_DIR}/kannel_bearerbox.pid`
+ fi
+ printf "PID file ${PID_DIR}/bearerbox.pid does not exist -- bearer box start failed\n"
+ exit 1
+ fi
+ printf "Kannel bearer box started (pid: `cat ${PID_DIR}/bearerbox.pid`)\n"
+
+ if [[ ${SMSBOX_ENABLED} = "yes" ]]; then
+ printf "Starting kannel SMS box ...\n"
+ ${RUN} --pidfile ${PID_DIR}/kannel_smsbox.pid ${SMSBOX} -u ${USER} -p ${PID_DIR}/smsbox.pid ${CONF}
+ sleep 3
+ if [ ! -f ${PID_DIR}/smsbox.pid ] ; then
+ printf "PID file ${PID_DIR}/smsbox.pid does not exist -- SMS box start failed\n"
+ else
+ printf "Kannel SMS box started (pid: `cat ${PID_DIR}/smsbox.pid`)\n"
+ fi
+ fi
+
+ if [[ ${WAPBOX_ENABLED} = "yes" ]]; then
+ printf "Starting kannel WAP box ...\n"
+ ${RUN} --pidfile ${PID_DIR}/kannel_wapbox.pid ${WAPBOX} -u ${USER} -p ${PID_DIR}/wapbox.pid ${CONF}
+ sleep 3
+ if [ ! -f ${PID_DIR}/wapbox.pid ] ; then
+ printf "PID file ${PID_DIR}/wapbox.pid does not exist -- WAP box start failed\n"
+ else
+ printf "Kannel WAP box started (pid: `cat ${PID_DIR}/wapbox.pid`)\n"
+ fi
+ fi
+
+ exit 0
+ fi
+}
+
+kannel_stop() {
+ PID=`pgrep -f "${BEARERBOX}"`
+ if [ $? = 1 ]; then
+ printf "Kannel is not running\n"
+ exit 1
+ else
+ printf "Stopping Kannel ...\n"
+ pkill -f ${RUN}
+ pkill -f ${SMSBOX}
+ pkill -f ${WAPBOX}
+ pkill -f ${BEARERBOX}
+ sleep 5
+ PID=`pgrep -f "${BEARERBOX}"`
+ if [ $? = 0 ]; then
+ printf "Stop Kannel failed...\n"
+ exit 1
+ else
+ printf "Kannel is stoped\n"
+ exit 0
+ fi
+ fi
+}
+
+kannel_restart() {
+ kannel_stop
+ sleep 5
+ kannel_start
+}
+
+case "$1" in
+ start)
+ kannel_start
+ ;;
+
+ stop)
+ kannel_stop
+ ;;
+
+ restart)
+ kannel_restart
+ ;;
+
+ *)
+ printf $"Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ -f "/usr/local/share/kannel/enabled_kannel_box" ]; then
+ . /usr/local/share/kannel/enabled_kannel_box
+ if [[ ${SMSBOX_ENABLED} != "yes" ]]; then
+ echo "SMSBOX_ENABLED=\"yes\"" >> /usr/local/share/kannel/enabled_kannel_box
+ print -n "Kannel SMS box enable ...\n"
+ exit 0
+ fi
+ print -n "Kannel SMS box is enabled ...\n"
+ exit 0
+else
+ mkdir -p /usr/local/share/kannel
+ echo "SMSBOX_ENABLED=\"yes\"" >> /usr/local/share/kannel/enabled_kannel_box
+ print -n "Kannel SMS box enable ...\n"
+ exit 0
+fi
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ -f "/usr/local/share/kannel/enabled_kannel_box" ]; then
+ . /usr/local/share/kannel/enabled_kannel_box
+ if [[ ${WAPBOX_ENABLED} != "yes" ]]; then
+ echo "WAPBOX_ENABLED=\"yes\"" >> /usr/local/share/kannel/enabled_kannel_box
+ print -n "Kannel WAP box enable ...\n"
+ exit 0
+ fi
+ print -n "Kannel WAP box is enabled ...\n"
+ exit 0
+else
+ mkdir -p /usr/local/share/kannel
+ echo "WAPBOX_ENABLED=\"yes\"" >> /usr/local/share/kannel/enabled_kannel_box
+ print -n "Kannel WAP box enable ...\n"
+ exit 0
+fi
@@ -0,0 +1,37 @@
+$OpenBSD$
+--- doc/examples/kannel.conf.orig Sat May 12 13:43:56 2012
++++ doc/examples/kannel.conf Fri May 18 23:22:18 2012
+@@ -11,15 +11,17 @@ admin-password = bar
+ #status-password = foo
+ #admin-deny-ip = ""
+ #admin-allow-ip = ""
+-#log-file = "/tmp/kannel.log"
+-#log-level = 0
+-#access-log = "access.log"
++log-file = "/var/log/kannel/bearerbox.log"
++log-level = 3
++access-log = "/var/log/kannel/bearerbox-access.log"
+ #http-proxy-host = "127.0.0.1"
+ #http-proxy-port = 8080
+ #http-proxy-exceptions = "127.0.0.1"
+ #http-proxy-username = "user"
+ #http-proxy-password = "password"
+ #ssl-certkey-file = "mycertandprivkeyfile.pem"
++store-type = spool
++store-location = /var/spool/kannel
+
+ # Smsbox related
+ #smsbox-port = 13001
+@@ -142,9 +144,9 @@ bearerbox-host = localhost
+ sendsms-port = 13013
+ #sendsms-chars = "0123456789 +-"
+ #global-sender = 12345
+-#log-file = "/tmp/smsbox.log"
+-#log-level = 0
+-#access-log = "access.log"
++#log-file = "/var/log/kannel/smsbox.log"
++#log-level = 3
++#access-log = "/var/log/kannel/smsbox-access.log"
+ #white-list =
+ #black-list =
+ #reply-couldnotfetch =
@@ -0,0 +1,31 @@
+$OpenBSD$
+--- gw/bb_boxc.c.orig Sun May 20 00:13:18 2012
++++ gw/bb_boxc.c Sun May 20 00:18:12 2012
+@@ -1327,7 +1327,8 @@ Octstr *boxc_status(int status_type)
+ Octstr *tmp;
+ char *lb, *ws;
+ int i, boxes, para = 0;
+- time_t orig, t;
++ time_t orig;
++ long t;
+ Boxc *bi;
+
+ orig = time(NULL);
+@@ -1365,7 +1366,7 @@ Octstr *boxc_status(int status_type)
+ bi = gwlist_get(wapbox_list, i);
+ if (bi->alive == 0)
+ continue;
+- t = orig - bi->connect_time;
++ t = (long)difftime(orig, bi->connect_time);
+ if (status_type == BBSTATUS_XML)
+ octstr_format_append(tmp,
+ "<box>\n\t\t<type>wapbox</type>\n\t\t<IP>%s</IP>\n"
+@@ -1400,7 +1401,7 @@ Octstr *boxc_status(int status_type)
+ bi = gwlist_get(smsbox_list, i);
+ if (bi->alive == 0)
+ continue;
+- t = orig - bi->connect_time;
++ t = (long)difftime(orig,bi->connect_time);
+ if (status_type == BBSTATUS_XML)
+ octstr_format_append(tmp, "<box>\n\t\t<type>smsbox</type>\n"
+ "\t\t<id>%s</id>\n\t\t<IP>%s</IP>\n"
@@ -0,0 +1,37 @@
+$OpenBSD$
+--- gw/bb_smscconn.c.orig Fri May 18 23:18:25 2012
++++ gw/bb_smscconn.c Fri May 18 23:19:55 2012
+@@ -1198,7 +1198,7 @@ Octstr *smsc2_status(int status_type)
+ switch (info.status) {
+ case SMSCCONN_ACTIVE:
+ case SMSCCONN_ACTIVE_RECV:
+- sprintf(tmp3, "online %lds", info.online);
++ snprintf(tmp3, sizeof(tmp3), "online %lds", info.online);
+ incoming_sms_load_0 = load_get(conn->incoming_sms_load,0);
+ incoming_sms_load_1 = load_get(conn->incoming_sms_load,1);
+ incoming_sms_load_2 = load_get(conn->incoming_sms_load,2);
+@@ -1213,19 +1213,19 @@ Octstr *smsc2_status(int status_type)
+ outgoing_dlr_load_2 = load_get(conn->outgoing_dlr_load,2);
+ break;
+ case SMSCCONN_DISCONNECTED:
+- sprintf(tmp3, "disconnected");
++ snprintf(tmp3, sizeof(tmp3), "disconnected");
+ break;
+ case SMSCCONN_CONNECTING:
+- sprintf(tmp3, "connecting");
++ snprintf(tmp3, sizeof(tmp3), "connecting");
+ break;
+ case SMSCCONN_RECONNECTING:
+- sprintf(tmp3, "re-connecting");
++ snprintf(tmp3, sizeof(tmp3), "re-connecting");
+ break;
+ case SMSCCONN_DEAD:
+- sprintf(tmp3, "dead");
++ snprintf(tmp3, sizeof(tmp3), "dead");
+ break;
+ default:
+- sprintf(tmp3, "unknown");
++ snprintf(tmp3, sizeof(tmp3), "unknown");
+ }
+
+ if (status_type == BBSTATUS_XML)
@@ -0,0 +1,18 @@
+$OpenBSD$
+--- gw/bearerbox.c.orig Sun May 20 00:11:58 2012
++++ gw/bearerbox.c Sun May 20 00:13:05 2012
+@@ -941,12 +941,12 @@ Octstr *bb_print_status(int status_type)
+ char *s, *lb;
+ char *frmt, *footer;
+ Octstr *ret, *str, *version;
+- time_t t;
++ long t;
+
+ if ((lb = bb_status_linebreak(status_type)) == NULL)
+ return octstr_create("Un-supported format");
+
+- t = time(NULL) - start_time;
++ t = (long)difftime(time(NULL), start_time);
+
+ if (bb_status == BB_RUNNING)
+ s = "running";
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- gw/kannel.8.orig Mon May 14 00:50:02 2012
++++ gw/kannel.8 Mon May 14 00:50:20 2012
+@@ -35,9 +35,7 @@ and the SMS based services, respectively.
+ .PP
+ For more information,
+ see
+-.B http://www.kannel.org
+-or
+-.BR file://usr/doc/kannel/ .
++.B http://www.kannel.org.
+ .SH "SEE ALSO"
+ .BR run_kannel_box (8),
+ .BR seewbmp (1).
Oops, something went wrong.

0 comments on commit 8d3f956

Please sign in to comment.