From d44155bc4cc41bd2545bb832f3b39dbe83fab5eb Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Tue, 5 Feb 2008 10:39:41 +0000 Subject: [PATCH] Initial import of smstools: The SMS Server Tools 3 is a SMS Gateway software which can send and receive short messages through GSM modems and mobile phones. You can send short messages by simply storing text files into a special spool directory. The program monitors this directory and sends new files automatically. It also stores received short messages into another directory as text files. Binary messages (including Unicode text) are also supported, for example ring tone messages. It's also possible to send a WAP Push message to the WAP/MMS capable mobile phone. The program can be run as a SMS daemon which can be started automatically when the operating system starts. High availability can be ensured by using multiple GSM devices (currently up to 64, this limit is easily changeable). --- smstools/DESCR | 7 +++++ smstools/Makefile | 32 +++++++++++++++++++++++ smstools/PLIST | 8 ++++++ smstools/TODO | 1 + smstools/distinfo | 6 +++++ smstools/files/smsd.sh | 54 +++++++++++++++++++++++++++++++++++++++ smstools/patches/patch-aa | 22 ++++++++++++++++ 7 files changed, 130 insertions(+) create mode 100644 smstools/DESCR create mode 100644 smstools/Makefile create mode 100644 smstools/PLIST create mode 100644 smstools/TODO create mode 100644 smstools/distinfo create mode 100644 smstools/files/smsd.sh create mode 100644 smstools/patches/patch-aa diff --git a/smstools/DESCR b/smstools/DESCR new file mode 100644 index 0000000000..61ab90084d --- /dev/null +++ b/smstools/DESCR @@ -0,0 +1,7 @@ +The SMS Server Tools 3 is a SMS Gateway software which can send and +receive short messages through GSM modems and mobile phones. + +You can send short messages by simply storing text files into a special +spool directory. The program monitors this directory and sends new +files automatically. It also stores received short messages into another +directory as text files. diff --git a/smstools/Makefile b/smstools/Makefile new file mode 100644 index 0000000000..e10cdda1b2 --- /dev/null +++ b/smstools/Makefile @@ -0,0 +1,32 @@ +# $NetBSD: Makefile,v 1.1.1.1 2008/02/05 10:39:41 shattered Exp $ +# + +DISTNAME= smstools3-3.0.10 +PKGNAME= smstools-3.0.10 +CATEGORIES= comms +MASTER_SITES= http://smstools3.kekekasvi.com/packages/ + +MAINTAINER= shattered@users.sourceforge.net +HOMEPAGE= http://smstools3.kekekasvi.com/ +COMMENT= Send and receive short messages via GSM phones + +USE_TOOLS+= gmake +CPPFLAGS+= -DPKG_SYSCONFDIR="\"${PKG_SYSCONFDIR}\"" + +EGDIR= ${PREFIX}/share/examples/smstools +CONF_FILES= ${EGDIR}/smsd.conf ${PKG_SYSCONFDIR}/smsd.conf +INSTALLATION_DIRS+= ${EGDIR} +RCD_SCRIPTS= smsd + +WRKSRC= ${WRKDIR}/smstools3 +BUILD_DIRS= src + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/src/smsd ${PREFIX}/sbin + ${INSTALL_SCRIPT} ${WRKSRC}/scripts/sendsms ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/scripts/sms2html ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/scripts/sms2unicode ${PREFIX}/bin + ${INSTALL_SCRIPT} ${WRKSRC}/scripts/unicode2sms ${PREFIX}/bin + ${INSTALL_DATA} ${WRKSRC}/examples/smsd.conf.easy ${EGDIR}/smsd.conf + +.include "../../mk/bsd.pkg.mk" diff --git a/smstools/PLIST b/smstools/PLIST new file mode 100644 index 0000000000..da14eda0ea --- /dev/null +++ b/smstools/PLIST @@ -0,0 +1,8 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2008/02/05 10:39:41 shattered Exp $ +bin/sendsms +bin/sms2html +bin/sms2unicode +bin/unicode2sms +sbin/smsd +share/examples/rc.d/smsd +share/examples/smstools/smsd.conf diff --git a/smstools/TODO b/smstools/TODO new file mode 100644 index 0000000000..06e8d3d0c0 --- /dev/null +++ b/smstools/TODO @@ -0,0 +1 @@ +Install HTML documentation. diff --git a/smstools/distinfo b/smstools/distinfo new file mode 100644 index 0000000000..27085f5019 --- /dev/null +++ b/smstools/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1.1.1 2008/02/05 10:39:41 shattered Exp $ + +SHA1 (smstools3-3.0.10.tar.gz) = 86a77b250dd4d1519161aa551a69146068f3ac31 +RMD160 (smstools3-3.0.10.tar.gz) = 04aef3ddf345038138b76dd1fd68c2b0d72e5cfe +Size (smstools3-3.0.10.tar.gz) = 210913 bytes +SHA1 (patch-aa) = d6fcad9fb3f1ba82165be8733fcaf0c51f69d649 diff --git a/smstools/files/smsd.sh b/smstools/files/smsd.sh new file mode 100644 index 0000000000..6cf6bd110b --- /dev/null +++ b/smstools/files/smsd.sh @@ -0,0 +1,54 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# PROVIDE: smsd +# REQUIRE: DAEMON +# KEYWORD: shutdown + +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="smsd" +rcvar=$name +command="@PREFIX@/bin/${name}" +command_args="&" +required_files="@PKG_SYSCONFDIR@/smsd.conf" +start_precmd="smsd_precmd" + +if [ -f "${required_files}" ]; then + pidfile_=`@AWK@ '/^#/ {next}; /^pidfile[ ]/ {r = $3}; + END {print r}' ${required_files}` + if [ -n "${pidfile_}" ]; then + pidfile=${pidfile_} + fi + smsd_user=`@AWK@ '/^#/ {next}; /^user[ ]/ {r = $3}; + END {print r}' ${required_files}` + device=`@AWK@ '/^#/ {next}; /^device[ ]/ {r = $3}; + END {print r}' ${required_files}` + logfile=`@AWK@ '/^#/ {next}; /^logfile[ ]/ {r = $3}; + END {print r}' ${required_files}` +fi + +smsd_precmd() +{ + if [ -n "${smsd_user}" -a -n "${device}" ]; then + @CHOWN@ ${smsd_user} ${device} + fi + if [ -n "${smsd_user}" -a -n "${pidfile}" ]; then + @TOUCH@ ${pidfile} + @CHOWN@ ${smsd_user} ${pidfile} + fi + if [ -n "${smsd_user}" -a -n "${logfile}" ]; then + @TOUCH@ ${logfile} + @CHOWN@ ${smsd_user} ${logfile} + fi +} + +if [ -f /etc/rc.subr -a -f /etc/rc.conf \ + -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then + load_rc_config $name + run_rc_command "$1" +else + @ECHO@ -n " ${name}" + ${command} ${command_args} +fi diff --git a/smstools/patches/patch-aa b/smstools/patches/patch-aa new file mode 100644 index 0000000000..3f994162a4 --- /dev/null +++ b/smstools/patches/patch-aa @@ -0,0 +1,22 @@ +$NetBSD: patch-aa,v 1.1.1.1 2008/02/05 10:39:41 shattered Exp $ + +--- src/smsd_cfg.c.orig 2007-07-08 12:45:30.000000000 +0000 ++++ src/smsd_cfg.c +@@ -677,7 +677,7 @@ void help() + #endif + printf(" -t run smsd in terminal\n"); + printf(" -V print copyright and version\n\n"); +- printf("All other options are set by the file /etc/smsd.conf.\n\n"); ++ printf("All other options are set by the file " PKG_SYSCONFDIR "/smsd.conf.\n\n"); + printf("Output is written to stdout, errors are written to stderr.\n\n"); + exit(0); + } +@@ -685,7 +685,7 @@ void help() + void parsearguments(int argc,char** argv) + { + int result; +- strcpy(configfile,"/etc/smsd.conf"); ++ strcpy(configfile,PKG_SYSCONFDIR "/smsd.conf"); + printstatus=0; + terminal = 0; + arg_infofile[0] = 0;