* [Buildroot] [PATCH] Add SMS Tools Server 3 package
@ 2014-01-08 15:18 julien.boibessot at free.fr
2014-01-15 18:14 ` Julien Boibessot
2014-01-15 18:24 ` Gustavo Zacarias
0 siblings, 2 replies; 5+ messages in thread
From: julien.boibessot at free.fr @ 2014-01-08 15:18 UTC (permalink / raw)
To: buildroot
From: Julien Boibessot <julien.boibessot@armadeus.com>
Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
---
package/Config.in | 1 +
package/smstools3/Config.in | 24 ++++++++++++++++++++++
package/smstools3/S50smsd | 43 ++++++++++++++++++++++++++++++++++++++++
package/smstools3/smstools3.mk | 35 ++++++++++++++++++++++++++++++++
4 files changed, 103 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..e0ea0f7
--- /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
+
+config BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT
+ bool "Start SMS Server Tools at system boot"
+ default y
+
+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..ded4189
--- /dev/null
+++ b/package/smstools3/S50smsd
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# Starts the SMS Server Tools 3
+#
+
+NAME=smsd
+DAEMON=/usr/local/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..2403b6f
--- /dev/null
+++ b/package/smstools3/smstools3.mk
@@ -0,0 +1,35 @@
+#############################################################
+#
+# 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
+
+define SMSTOOLS3_BUILD_CMDS
+ $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(SMSTOOLS3_CFLAGS)" -C $(@D)
+endef
+
+ifeq ($(BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT),y)
+SMSTOOLS3_INIT_SCRIPT_NAME = S50smsd
+else
+SMSTOOLS3_INIT_SCRIPT_NAME = 50smsd
+endif
+
+define SMSTOOLS3_INSTALL_TARGET_CMDS
+ mkdir -p $(TARGET_DIR)/usr/local/bin
+ cp $(@D)/src/smsd $(TARGET_DIR)/usr/local/bin
+ cp $(@D)/scripts/sendsms $(TARGET_DIR)/usr/local/bin
+ cp $(@D)/examples/smsd.conf.easy $(TARGET_DIR)/etc/
+ $(INSTALL) -m 0755 -D package/smstools3/S50smsd $(TARGET_DIR)/etc/init.d/$(SMSTOOLS3_INIT_SCRIPT_NAME)
+endef
+
+$(eval $(generic-package))
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Buildroot] [PATCH] Add SMS Tools Server 3 package
2014-01-08 15:18 [Buildroot] [PATCH] Add SMS Tools Server 3 package julien.boibessot at free.fr
@ 2014-01-15 18:14 ` Julien Boibessot
2014-01-15 18:24 ` Gustavo Zacarias
1 sibling, 0 replies; 5+ messages in thread
From: Julien Boibessot @ 2014-01-15 18:14 UTC (permalink / raw)
To: buildroot
ping ?
On 01/08/2014 04:18 PM, julien.boibessot at free.fr wrote:
> From: Julien Boibessot <julien.boibessot@armadeus.com>
>
>
> Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
> ---
> package/Config.in | 1 +
> package/smstools3/Config.in | 24 ++++++++++++++++++++++
> package/smstools3/S50smsd | 43 ++++++++++++++++++++++++++++++++++++++++
> package/smstools3/smstools3.mk | 35 ++++++++++++++++++++++++++++++++
> 4 files changed, 103 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..e0ea0f7
> --- /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
> +
> +config BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT
> + bool "Start SMS Server Tools at system boot"
> + default y
> +
> +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..ded4189
> --- /dev/null
> +++ b/package/smstools3/S50smsd
> @@ -0,0 +1,43 @@
> +#!/bin/sh
> +#
> +# Starts the SMS Server Tools 3
> +#
> +
> +NAME=smsd
> +DAEMON=/usr/local/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..2403b6f
> --- /dev/null
> +++ b/package/smstools3/smstools3.mk
> @@ -0,0 +1,35 @@
> +#############################################################
> +#
> +# 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
> +
> +define SMSTOOLS3_BUILD_CMDS
> + $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(SMSTOOLS3_CFLAGS)" -C $(@D)
> +endef
> +
> +ifeq ($(BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT),y)
> +SMSTOOLS3_INIT_SCRIPT_NAME = S50smsd
> +else
> +SMSTOOLS3_INIT_SCRIPT_NAME = 50smsd
> +endif
> +
> +define SMSTOOLS3_INSTALL_TARGET_CMDS
> + mkdir -p $(TARGET_DIR)/usr/local/bin
> + cp $(@D)/src/smsd $(TARGET_DIR)/usr/local/bin
> + cp $(@D)/scripts/sendsms $(TARGET_DIR)/usr/local/bin
> + cp $(@D)/examples/smsd.conf.easy $(TARGET_DIR)/etc/
> + $(INSTALL) -m 0755 -D package/smstools3/S50smsd $(TARGET_DIR)/etc/init.d/$(SMSTOOLS3_INIT_SCRIPT_NAME)
> +endef
> +
> +$(eval $(generic-package))
^ permalink raw reply [flat|nested] 5+ messages in thread* [Buildroot] [PATCH] Add SMS Tools Server 3 package
2014-01-08 15:18 [Buildroot] [PATCH] Add SMS Tools Server 3 package julien.boibessot at free.fr
2014-01-15 18:14 ` Julien Boibessot
@ 2014-01-15 18:24 ` Gustavo Zacarias
2014-01-16 18:58 ` Julien Boibessot
1 sibling, 1 reply; 5+ messages in thread
From: Gustavo Zacarias @ 2014-01-15 18:24 UTC (permalink / raw)
To: buildroot
On 01/08/2014 12:18 PM, julien.boibessot at free.fr wrote:
Hi. Let's see...
> +config BR2_PACKAGE_SMSTOOLS3_NB_MODEMS
> + string "Number of modems to support"
> + default 1
What does this knob do in/to the code?
> +
> +config BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT
> + bool "Start SMS Server Tools at system boot"
> + default y
Ehhmm no, we don't make initscripts conditional that way, there are
various hooks to get rid of it if someone doesn't want it that way or
they run services their own way.
> +
> +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..ded4189
> --- /dev/null
> +++ b/package/smstools3/S50smsd
> @@ -0,0 +1,43 @@
> +#!/bin/sh
> +#
> +# Starts the SMS Server Tools 3
> +#
> +
> +NAME=smsd
> +DAEMON=/usr/local/bin/$NAME
/usr/local? Why?
> +ifeq ($(BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT),y)
> +SMSTOOLS3_INIT_SCRIPT_NAME = S50smsd
> +else
> +SMSTOOLS3_INIT_SCRIPT_NAME = 50smsd
> +endif
Please use SMSTOOLS3_INSTALL_INIT_SYSV for the script.
See docs/manual/adding-packages-generic.txt for the reason.
Otherwise looking good in general without testing it though.
Regards.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] Add SMS Tools Server 3 package
2014-01-15 18:24 ` Gustavo Zacarias
@ 2014-01-16 18:58 ` Julien Boibessot
2014-01-17 11:39 ` Gustavo Zacarias
0 siblings, 1 reply; 5+ messages in thread
From: Julien Boibessot @ 2014-01-16 18:58 UTC (permalink / raw)
To: buildroot
Hello Gustavo,
and thanks for the review !
On 01/15/2014 07:24 PM, Gustavo Zacarias wrote:
> On 01/08/2014 12:18 PM, julien.boibessot at free.fr wrote:
>
> Hi. Let's see...
>
>> +config BR2_PACKAGE_SMSTOOLS3_NB_MODEMS
>> + string "Number of modems to support"
>> + default 1
> What does this knob do in/to the code?
It (NUMBER_OF_MODEMS) is used in a very large number of loops of the
program and by default set to 64.
Doc says: "If you are running SMSTools3 in an embedded device, you can
use NUMBER_OF_MODEMS=1 to save memory."
Don't know why the author didn't choose to take dynamic command
parameters instead of static code define...
>
>> +
>> +config BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT
>> + bool "Start SMS Server Tools at system boot"
>> + default y
> Ehhmm no, we don't make initscripts conditional that way, there are
> various hooks to get rid of it if someone doesn't want it that way or
> they run services their own way.
ok !
>
>> +
>> +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..ded4189
>> --- /dev/null
>> +++ b/package/smstools3/S50smsd
>> @@ -0,0 +1,43 @@
>> +#!/bin/sh
>> +#
>> +# Starts the SMS Server Tools 3
>> +#
>> +
>> +NAME=smsd
>> +DAEMON=/usr/local/bin/$NAME
> /usr/local? Why?
Well... no particular reason :-)
/usr would be ok ?
>
>> +ifeq ($(BR2_PACKAGE_SMSTOOLS3_START_AT_BOOT),y)
>> +SMSTOOLS3_INIT_SCRIPT_NAME = S50smsd
>> +else
>> +SMSTOOLS3_INIT_SCRIPT_NAME = 50smsd
>> +endif
> Please use SMSTOOLS3_INSTALL_INIT_SYSV for the script.
> See docs/manual/adding-packages-generic.txt for the reason.
ok !
>
> Otherwise looking good in general without testing it though.
Thanks !
I will send a corrected version tomorrow.
Regards,
Julien
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH] Add SMS Tools Server 3 package
2014-01-16 18:58 ` Julien Boibessot
@ 2014-01-17 11:39 ` Gustavo Zacarias
0 siblings, 0 replies; 5+ messages in thread
From: Gustavo Zacarias @ 2014-01-17 11:39 UTC (permalink / raw)
To: buildroot
On 01/16/2014 03:58 PM, Julien Boibessot wrote:
>>> +config BR2_PACKAGE_SMSTOOLS3_NB_MODEMS
>>> + string "Number of modems to support"
>>> + default 1
>> What does this knob do in/to the code?
>
> It (NUMBER_OF_MODEMS) is used in a very large number of loops of the
> program and by default set to 64.
>
> Doc says: "If you are running SMSTools3 in an embedded device, you can
> use NUMBER_OF_MODEMS=1 to save memory."
>
> Don't know why the author didn't choose to take dynamic command
> parameters instead of static code define...
Ok, i'm usually not comfortable with this kind of tuning but it's up to
upstream to fix it.
> Well... no particular reason :-)
> /usr would be ok ?
Yes, /usr is the usual install directory, /usr/local is normally outside
of the PATH and not practical.
Historically it's reserved for customizations so it shouldn't be used
for a "default target".
> Thanks !
> I will send a corrected version tomorrow.
Thanks, looking forward to it :)
Regards.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-01-17 11:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 15:18 [Buildroot] [PATCH] Add SMS Tools Server 3 package julien.boibessot at free.fr
2014-01-15 18:14 ` Julien Boibessot
2014-01-15 18:24 ` Gustavo Zacarias
2014-01-16 18:58 ` Julien Boibessot
2014-01-17 11:39 ` Gustavo Zacarias
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox