Subject: [alpine-devel] [PATCH] testing/softflowd: add init script

From: Jeff Bilyk <[email-masked]>
Date: Wed, 1 Dec 2010 20:45:04 +0000

add init script
---
 testing/softflowd/APKBUILD        |   13 +++++++++++--
 testing/softflowd/softflowd.confd |    2 ++
 testing/softflowd/softflowd.initd |   20 ++++++++++++++++++++
 3 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 testing/softflowd/softflowd.confd
 create mode 100755 testing/softflowd/softflowd.initd

diff --git a/testing/softflowd/APKBUILD b/testing/softflowd/APKBUILD
index 58d34b6..1ac3e75 100644
--- a/testing/softflowd/APKBUILD
+++ b/testing/softflowd/APKBUILD
@@ -9,7 +9,9 @@ depends="libpcap"
 makedepends="libpcap-dev"
 install=
 subpackages="$pkgname-doc"
-source="http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tar.gz"
+source="http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tar.gz
+	$pkgname.initd
+	$pkgname.confd"
 
 _builddir="$srcdir"/$pkgname-$pkgver
 
@@ -26,6 +28,13 @@ package() {
 	cd "$_builddir"
 	make DESTDIR="$pkgdir" install
 
+	mkdir -p "$pkgdir"/etc/init.d
+	mkdir -p "$pkgdir"/etc/conf.d
+
+	install -D -m755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+	install -D -m644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
 }
 
-md5sums="0054d1c80494396cc15edb0a1c7748b1  softflowd-0.9.8.tar.gz"
+md5sums="0054d1c80494396cc15edb0a1c7748b1  softflowd-0.9.8.tar.gz
+291204a29d6e268a53cd5aea22bf4f89  softflowd.initd
+ad05d3bf3ab5d62ca492bbbeb9402f16  softflowd.confd"
diff --git a/testing/softflowd/softflowd.confd b/testing/softflowd/softflowd.confd
new file mode 100644
index 0000000..390c5d7
--- /dev/null
+++ b/testing/softflowd/softflowd.confd
@@ -0,0 +1,2 @@
+SOFTFLOW_OPTS="-i eth0"
+SOFTFLOWDOWN_OPTS="shutdown"
diff --git a/testing/softflowd/softflowd.initd b/testing/softflowd/softflowd.initd
new file mode 100755
index 0000000..dd9abd6
--- /dev/null
+++ b/testing/softflowd/softflowd.initd
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+	need net
+	after firewall
+}
+
+start() {
+	ebegin "Starting $SVCNAME"
+	start-stop-daemon -S -x /usr/sbin/softflowd -- ${SOFTFLOW_OPTS}
+	eend $?
+}
+
+stop() {
+	ebegin "Stopping $SVCNAME"
+	start-stop-daemon -S -x /usr/sbin/softflowctl -- ${SOFTFLOWDOWN_OPTS}
+	eend $?
+}
-- 
1.7.3.2

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---