diff mbox

[1/1] ser2net: New recipe

Message ID 2b7995a2905b5f266ca9f477e96cb1fa31eb735d.1393418863.git.kibo@prevas.dk
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

Kim Bøndergaard Feb. 26, 2014, 12:48 p.m. UTC
---
 recipes/ser2net/files/ser2net.conf.in |  3 +++
 recipes/ser2net/files/ser2net.init    | 32 ++++++++++++++++++++++++++++++
 recipes/ser2net/ser2net.inc           | 37 +++++++++++++++++++++++++++++++++++
 recipes/ser2net/ser2net_2.9.1.oe      |  1 +
 recipes/ser2net/ser2net_2.9.1.oe.sig  |  1 +
 5 files changed, 74 insertions(+)
 create mode 100644 recipes/ser2net/files/ser2net.conf.in
 create mode 100755 recipes/ser2net/files/ser2net.init
 create mode 100644 recipes/ser2net/ser2net.inc
 create mode 100644 recipes/ser2net/ser2net_2.9.1.oe
 create mode 100644 recipes/ser2net/ser2net_2.9.1.oe.sig
diff mbox

Patch

diff --git a/recipes/ser2net/files/ser2net.conf.in b/recipes/ser2net/files/ser2net.conf.in
new file mode 100644
index 0000000..0b4ef0e
--- /dev/null
+++ b/recipes/ser2net/files/ser2net.conf.in
@@ -0,0 +1,3 @@ 
+BANNER:banner1:this is ser2net TCP port \p device \d  serial parms \s\r\n
+
+
diff --git a/recipes/ser2net/files/ser2net.init b/recipes/ser2net/files/ser2net.init
new file mode 100755
index 0000000..a99cd20
--- /dev/null
+++ b/recipes/ser2net/files/ser2net.init
@@ -0,0 +1,32 @@ 
+#! /bin/sh
+
+SERVICE=ser2net
+UTIL=/usr/sbin/$SERVICE
+
+test -f $UTIL || exit 0
+
+case "$1" in
+	start)
+		echo -n "Starting $SERVICE ..."
+  		start-stop-daemon --start --quiet --exec $UTIL
+		echo "."
+  		;;
+	stop)
+		echo -n "Stopping $SERVICE ..."
+  		start-stop-daemon --stop --quiet --exec $UTIL
+		echo "."
+  		;;
+	restart|force-reload)
+		echo -n "Restarting $SERVICE ..."
+  		start-stop-daemon --stop --quiet --exec $UTIL
+  		sleep 2
+  		start-stop-daemon --start --quiet --exec $UTIL
+		echo "done."
+  		;;
+	*)
+  		echo "Usage: /etc/init.d/$SERVICE {start|stop|restart|force-reload}"
+  		exit 1
+		;;
+esac
+
+exit 0
diff --git a/recipes/ser2net/ser2net.inc b/recipes/ser2net/ser2net.inc
new file mode 100644
index 0000000..ebcb124
--- /dev/null
+++ b/recipes/ser2net/ser2net.inc
@@ -0,0 +1,37 @@ 
+DESCRIPTION = "Serial port to network proxy"
+HOMEPAGE = "http://sourceforge.net/projects/ser2net/"
+LICENSE = "GPLv2"
+
+inherit autotools-autoreconf auto-package-utils
+
+require conf/fetch/sourceforge.conf
+SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${PN}-${PV}.tar.gz"
+SRC_URI += "file://ser2net.conf.in"
+SRC_URI += "file://ser2net.init"
+
+RECIPE_FLAGS += "ser2net_config"
+DEFAULT_USE_ser2net_config = "3001:telnet:0:/dev/ttyUSB0:115200 remctl banner1"
+
+do_patch[postfuncs] += "do_patch_conf_file"
+do_patch_conf_file() {
+	echo ${USE_ser2net_config} >> ${SRCDIR}/ser2net.conf.in
+}
+
+do_install[postfuncs] += "do_install_extra_files"
+do_install_extra_files() {
+	sysvinit_install_script ${SRCDIR}/ser2net.init ser2net
+	mkdir -p ${D}${sysconfdir}
+	install -m 0644 ${SRCDIR}/ser2net.conf.in \
+				${D}${sysconfdir}/ser2net.conf
+}
+
+inherit sysvinit
+RECIPE_FLAGS += "ser2net_sysvinit_start ser2net_sysvinig_stop"
+SYSVINIT_SCRIPT_ser2net = "ser2net"
+DEFAULT_USE_ser2net_sysvinit_start = "98"
+DEFAULT_USE_ser2net_sysvinit_stop  = "98"
+
+FILES_${PN} += "/etc/ser2net.conf"
+
+DEPENDS_${PN} = "libc"
+RDEPENDS_${PN} = "libc"
diff --git a/recipes/ser2net/ser2net_2.9.1.oe b/recipes/ser2net/ser2net_2.9.1.oe
new file mode 100644
index 0000000..7b6d5a2
--- /dev/null
+++ b/recipes/ser2net/ser2net_2.9.1.oe
@@ -0,0 +1 @@ 
+include ser2net.inc
diff --git a/recipes/ser2net/ser2net_2.9.1.oe.sig b/recipes/ser2net/ser2net_2.9.1.oe.sig
new file mode 100644
index 0000000..5ec41c4
--- /dev/null
+++ b/recipes/ser2net/ser2net_2.9.1.oe.sig
@@ -0,0 +1 @@ 
+dc8662a1c83391a6b437bc9d2443fb7a65548a9a  ser2net-2.9.1.tar.gz