From patchwork Thu Jan 23 15:38:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Boibessot X-Patchwork-Id: 313641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id E682A2C0090 for ; Fri, 24 Jan 2014 02:39:03 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7B3CB8A3C0; Thu, 23 Jan 2014 15:39:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lOa0FlvKduqY; Thu, 23 Jan 2014 15:39:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6C89C84FE0; Thu, 23 Jan 2014 15:39:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 009231BF9D8 for ; Thu, 23 Jan 2014 15:39:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id ED5D584FE0 for ; Thu, 23 Jan 2014 15:38:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rGeNiZKjikFv for ; Thu, 23 Jan 2014 15:38:58 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B84984246 for ; Thu, 23 Jan 2014 15:38:56 +0000 (UTC) Received: from localhost.localdomain (unknown [82.234.232.91]) by smtp2-g21.free.fr (Postfix) with ESMTP id B531F4B0153; Thu, 23 Jan 2014 16:38:50 +0100 (CET) From: julien.boibessot@free.fr To: buildroot@busybox.net Date: Thu, 23 Jan 2014 16:38:04 +0100 Message-Id: <1390491484-1394-1-git-send-email-julien.boibessot@free.fr> X-Mailer: git-send-email 1.7.5.4 Cc: Julien Boibessot Subject: [Buildroot] [PATCH v2] Add SMS Tools Server 3 package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Julien Boibessot Signed-off-by: Julien Boibessot --- Changes since v1: - 80x '#' in smstools3.mk header - use 'install' instead of 'cp' - took Gustavo's remarks into account: * help text for BR2_PACKAGE_SMSTOOLS3_NB_MODEMS option * install binaries in /usr/bin/ * use xxx_INSTALL_INIT_SYSV for init script installation package/Config.in | 1 + package/smstools3/Config.in | 24 ++++++++++++++++++++++ package/smstools3/S50smsd | 43 ++++++++++++++++++++++++++++++++++++++++ package/smstools3/smstools3.mk | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 0 deletions(-) create mode 100644 package/smstools3/Config.in create mode 100644 package/smstools3/S50smsd create mode 100644 package/smstools3/smstools3.mk diff --git a/package/Config.in b/package/Config.in index e502cde..1f4fe14 100644 --- a/package/Config.in +++ b/package/Config.in @@ -901,6 +901,7 @@ source "package/samba/Config.in" source "package/sconeserver/Config.in" source "package/ser2net/Config.in" source "package/smcroute/Config.in" +source "package/smstools3/Config.in" source "package/socat/Config.in" source "package/socketcand/Config.in" source "package/spawn-fcgi/Config.in" diff --git a/package/smstools3/Config.in b/package/smstools3/Config.in new file mode 100644 index 0000000..6ca533f --- /dev/null +++ b/package/smstools3/Config.in @@ -0,0 +1,24 @@ +config BR2_PACKAGE_SMSTOOLS3 + bool "smstools3" + depends on BR2_USE_WCHAR + depends on BR2_TOOLCHAIN_HAS_THREADS + help + The SMS Server Tools 3 is a SMS Gateway software which can send and + receive short messages through GSM modems and mobile phones. + + http://smstools3.kekekasvi.com/ + +if BR2_PACKAGE_SMSTOOLS3 + +config BR2_PACKAGE_SMSTOOLS3_NB_MODEMS + string "Number of modems to support" + default 1 + help + To reduce memory footprint of SMS Server Tools, you can specify the + exact number of modems connected to your board. By default only 1 + modem is used. + +endif + +comment "smstools3 needs a toolchain w/ wchar, threads" + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS diff --git a/package/smstools3/S50smsd b/package/smstools3/S50smsd new file mode 100644 index 0000000..239c3e3 --- /dev/null +++ b/package/smstools3/S50smsd @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Starts the SMS Server Tools 3 +# + +NAME=smsd +DAEMON=/usr/bin/$NAME +PIDFILE=/var/run/$NAME.pid +SPOOL=/var/spool/sms + +start() +{ + echo -n "Starting $NAME: " + mkdir -p $SPOOL/outgoing + mkdir -p $SPOOL/incoming + mkdir -p $SPOOL/checked + start-stop-daemon -S -q -p $PIDFILE --exec $DAEMON -- -c /etc/smsd.conf && echo "OK" || echo "Failed" +} + +stop() +{ + echo -n "Stopping $NAME: " + start-stop-daemon -K -q -p $PIDFILE && echo "OK" || echo "Failed" + rm -f $PIDFILE +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/package/smstools3/smstools3.mk b/package/smstools3/smstools3.mk new file mode 100644 index 0000000..edc57cb --- /dev/null +++ b/package/smstools3/smstools3.mk @@ -0,0 +1,37 @@ +############################################################################### +# +# smstools3 +# +############################################################################### + +SMSTOOLS3_VERSION = 3.1.15 +SMSTOOLS3_SITE = http://smstools3.kekekasvi.com/packages/ +SMSTOOLS3_LICENSE = GPLv2+ +SMSTOOLS3_LICENSE_FILES = doc/license.html LICENSE + +SMSTOOLS3_NB_MODEMS = $(call qstrip,$(BR2_PACKAGE_SMSTOOLS3_NB_MODEMS)) +SMSTOOLS3_CFLAGS = $(TARGET_CFLAGS) +SMSTOOLS3_CFLAGS += -D NUMBER_OF_MODEMS=$(SMSTOOLS3_NB_MODEMS) +SMSTOOLS3_CFLAGS += -D NOSTATS +SMSTOOLS3_TARGET_BINARIES_DIR = $(TARGET_DIR)/usr/bin + +define SMSTOOLS3_BUILD_CMDS + $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(SMSTOOLS3_CFLAGS)" -C $(@D) +endef + +define SMSTOOLS3_INSTALL_INIT_SYSV + $(INSTALL) -m 0755 -D package/smstools3/S50smsd \ + $(TARGET_DIR)/etc/init.d/S50smsd +endef + +define SMSTOOLS3_INSTALL_TARGET_CMDS + mkdir -p $(SMSTOOLS3_TARGET_BINARIES_DIR) + $(INSTALL) -m 0755 -D $(@D)/src/smsd \ + $(SMSTOOLS3_TARGET_BINARIES_DIR)/smsd + $(INSTALL) -m 0755 -D $(@D)/scripts/sendsms \ + $(SMSTOOLS3_TARGET_BINARIES_DIR)/sendsms + $(INSTALL) -m 0644 -D $(@D)/examples/smsd.conf.easy \ + $(TARGET_DIR)/etc/smsd.conf.easy +endef + +$(eval $(generic-package))