Subject: [alpine-devel] extra/iaxmodem: move to /usr/sbin

From: Natanael Copa <[email-masked]>
Date: Thu, 26 Mar 2009 09:04:13 +0100

Cameron,

You are the maintainer for iaxmodem so I'm telling I took some liberty
to clean it up a bit.

Basicly, I moved it from /sbin to /usr/sbin since its not really needed
for booting, restoring, recovering, and/or repairing the system. (see
http://pathname.com/fhs/pub/fhs-2.3.html#SBINSYSTEMBINARIES )

while there I also removed the uclibc++ dependency (added by mmason
here:
http://git.alpinelinux.org/cgit/aports/commit/?id=615d2cc07d0670b067225881a43352c58f4e2205 )

Nothing links to uclibc++ (use 'scanelf -Rn pkg/' to verify that) and
the g++ check is only done by braindead configure script. So, I just
patch the configure script and removed the uclibc++ stuff.

I also removed the comments at the end that hold dead code for
installing init.d script. If you plan to add init.d scripts the package
should have been in testing and not in "extra".

My commit:
http://git.alpinelinux.org/cgit/aports/commit/?id=8d9d321723fe5361d0886f9f8f66801c1f11b0b3

Are you ok with those changes?

-nc

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

---

From: Cameron Banta <[email-masked]>
Date: Thu, 26 Mar 2009 15:48:01 -0500

Natanael,

On Thu, Mar 26, 2009 at 3:04 AM, Natanael Copa <[email-masked]>wrote:

> http://git.alpinelinux.org/cgit/aports/commit/?id=615d2cc07d0670b067225881a43352c58f4e2205)
>
> Those changes sound good. Thanks for cleaning it up. I didn't think about
it or plan on it at the time, I was making it as a dependency for hylafax,
but now I think it probably does need an init script. I'll work on that and
submit a patch.

Thanks,
Cameron

---

From: Cameron Banta <[email-masked]>
Date: Thu, 26 Mar 2009 16:50:36 -0500

Here's an init.d script for iaxmodem. Please review.

-Cameron
From b122d4695661c3bca37893880b50dbba0d0ff818 Mon Sep 17 00:00:00 2001
From: Cameron Banta <[email-masked]>
Date: Thu, 26 Mar 2009 21:48:20 +0000
Subject: [PATCH] Added initd

---
 extra/iaxmodem/APKBUILD       |   10 +++++++---
 extra/iaxmodem/iaxmodem.initd |   29 +++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 extra/iaxmodem/iaxmodem.initd

diff --git a/extra/iaxmodem/APKBUILD b/extra/iaxmodem/APKBUILD
index f1f2b21..7266429 100644
--- a/extra/iaxmodem/APKBUILD
+++ b/extra/iaxmodem/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Cameron Banta <[email-masked]>
 pkgname=iaxmodem
 pkgver=1.2.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Softmodem for hylafax that connects to VOIP gateway with IAX"
 url="http://iaxmodem.sourceforge.net/"
 license="GPL"
@@ -11,7 +11,8 @@ makedepends="tiff-dev"
 install=
 subpackages="$pkgname-doc"
 source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
-	nocxx.patch"
+	nocxx.patch
+	$pkgname.initd"
 
 build() {
 	cd "$srcdir/$pkgname-$pkgver"
@@ -26,6 +27,8 @@ build() {
 	mkdir -p "$pkgdir/etc/iaxmodem"
 	mkdir -p "$pkgdir/var/log/iaxmodem"
 
+        install -Dm 755 "$startdir"/$pkgname.initd $pkgdir/etc/init.d/$pkgname
+	
 	#library licenses
 	install -m644 -D "$srcdir/$pkgname-$pkgver/lib/libiax2/COPYING" \
 		"$pkgdir"/usr/share/licenses/$pkgname/libiax2.COPYING
@@ -51,4 +54,5 @@ build() {
 }
 
 md5sums="f8b26cfeed188e5c1dcbc5ae5ef923b3  iaxmodem-1.2.0.tar.gz
-28513788ba4d556ccd538867dc6205ab  nocxx.patch"
+28513788ba4d556ccd538867dc6205ab  nocxx.patch
+a8f31d3afacdffe54876b2ae266004d8  iaxmodem.initd"
diff --git a/extra/iaxmodem/iaxmodem.initd b/extra/iaxmodem/iaxmodem.initd
new file mode 100644
index 0000000..dc61a74
--- /dev/null
+++ b/extra/iaxmodem/iaxmodem.initd
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/iaxmodem
+NAME=iaxmodem
+DESC=iaxmodem
+
+start() {
+	ebegin "Starting $DESC: "
+	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON
+	eend $?
+}
+stop() {
+	ebegin "Stopping $DESC: "
+	start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON
+	eend $?
+}
+reload() {
+	ebegin "Reloading $DESC: "
+	if [ -e /var/run/$NAME.pid ]; then
+	    kill -HUP $(cat /var/run/$NAME.pid)
+	    eend 0
+	else
+	    echo "$NAME not running!"
+	    eend 1
+	fi
+}
-- 
1.6.1.3