diff options
author | Michael Mason <ms13sp@gmail.com> | 2010-03-17 19:09:51 +0000 |
---|---|---|
committer | Michael Mason <ms13sp@gmail.com> | 2010-03-17 19:09:51 +0000 |
commit | 52600877ccdfcc91be897b12d885ed8543022cfb (patch) | |
tree | 1165611dd6fb310ed7dd348c6ca1743d2a7e83a6 /testing | |
parent | 4b23d4dfa33b09440ffbdfccbd46571649ccecaa (diff) | |
download | aports-52600877ccdfcc91be897b12d885ed8543022cfb.tar.bz2 aports-52600877ccdfcc91be897b12d885ed8543022cfb.tar.xz |
testing/freeswitch updated with init script and post/pre install scripts
Diffstat (limited to 'testing')
-rw-r--r-- | testing/freeswitch/APKBUILD | 15 | ||||
-rw-r--r-- | testing/freeswitch/freeswitch.initd | 40 | ||||
-rwxr-xr-x | testing/freeswitch/freeswitch.post-deinstall | 4 | ||||
-rwxr-xr-x | testing/freeswitch/freeswitch.post-install | 3 | ||||
-rwxr-xr-x | testing/freeswitch/freeswitch.pre-install | 3 |
5 files changed, 50 insertions, 15 deletions
diff --git a/testing/freeswitch/APKBUILD b/testing/freeswitch/APKBUILD index 293678c7d..3e06f0962 100644 --- a/testing/freeswitch/APKBUILD +++ b/testing/freeswitch/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Michael Mason <ms13sp@gmail.com> pkgname=freeswitch pkgver=1.0.4 -pkgrel=0 +pkgrel=1 pkgdesc="A communications platform written in C from the ground up" url="http://www.freeswitch.org" license="GPL" @@ -12,6 +12,10 @@ install= subpackages="$pkgname-dev" source="http://files.freeswitch.org/freeswitch-$pkgver.tar.gz modules.conf + freeswitch.initd + freeswitch.post-install + freeswitch.pre-install + freeswitch.post-deinstall " build() { @@ -42,6 +46,9 @@ build() { # then the rest should build in parallel too make || return 1 +} +package(){ + cd "$srcdir/$pkgname-$pkgver" make -j1 DESTDIR="$pkgdir" install # TODO: make and test init.d scripts @@ -50,4 +57,8 @@ build() { } md5sums="86e34bdd8cc027d71772cb0dc51388da freeswitch-1.0.4.tar.gz -c05f2356be159e99b3845f5260a33599 modules.conf" +c05f2356be159e99b3845f5260a33599 modules.conf +9733f676521006eeeedbc59f44b6e312 freeswitch.initd +0d06345634fdf4b3f85f6856f3b734f6 freeswitch.post-install +1ffa906dfcd0afd2af8400c75e45d766 freeswitch.pre-install +a7188703019a74fd7f128d165b3ecf42 freeswitch.post-deinstall" diff --git a/testing/freeswitch/freeswitch.initd b/testing/freeswitch/freeswitch.initd index 34f441390..6433bb43d 100644 --- a/testing/freeswitch/freeswitch.initd +++ b/testing/freeswitch/freeswitch.initd @@ -1,19 +1,33 @@ #!/sbin/runscript +# Copyright 2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: $ -NAME=freeswitch -USER=freeswitch -DAEMON=/usr/bin/freeswitch -OPTIONS_START="-u $USER -g $GROUP -nc" -OPTIONS_STOP="-stop" +depend() { + need net +} start() { - ebegin "Starting $NAME" - $DAEMON $OPTIONS_START - eend 0 - } + local OPTS + + [ -n "${FREESWITCH_USER}" ] && \ + OPTS="${OPTS} -u ${FREESWITCH_USER}" + + [ -n "${FREESWITCH_GROUP}" ] && \ + OPTS="${OPTS} -g ${FREESWITCH_GROUP}" + + [ -n "${FREESWITCH_OPTS}" ] && \ + OPTS="${OPTS} ${FREESWITCH_OPTS}" + + ebegin "Starting Freeswitch" + start-stop-daemon --start --quiet --exec /opt/freeswitch/bin/freeswitch \ + --pidfile /var/run/freeswitch.pid -- -nc ${OPTS} + eend $? +} stop() { - ebegin "Stopping $NAME" - $DAEMON $OPTIONS_STOP - eend 0 - } + ebegin "Stopping Freeswitch" + start-stop-daemon --stop --quiet --pidfile /opt/freeswitch/log/freeswitch.pid + eend $? +} + diff --git a/testing/freeswitch/freeswitch.post-deinstall b/testing/freeswitch/freeswitch.post-deinstall new file mode 100755 index 000000000..5ec871cb1 --- /dev/null +++ b/testing/freeswitch/freeswitch.post-deinstall @@ -0,0 +1,4 @@ +#!/bin/sh + +deluser freeswitch +delgroup freeswitch diff --git a/testing/freeswitch/freeswitch.post-install b/testing/freeswitch/freeswitch.post-install new file mode 100755 index 000000000..2375ada13 --- /dev/null +++ b/testing/freeswitch/freeswitch.post-install @@ -0,0 +1,3 @@ +#!/bin/sh + +chown -R freeswitch:freeswitch /etc/freeswitch/ diff --git a/testing/freeswitch/freeswitch.pre-install b/testing/freeswitch/freeswitch.pre-install new file mode 100755 index 000000000..1272bf9c6 --- /dev/null +++ b/testing/freeswitch/freeswitch.pre-install @@ -0,0 +1,3 @@ +#!/bin/sh + +adduser -h /dev/null -s /bin/false -D freeswitch 2>/dev/null |