diff options
Diffstat (limited to 'main/freeswitch')
-rw-r--r-- | main/freeswitch/APKBUILD | 40 | ||||
-rwxr-xr-x | main/freeswitch/freeswitch.initd | 39 | ||||
-rwxr-xr-x | main/freeswitch/freeswitch.post-install | 3 | ||||
-rwxr-xr-x | main/freeswitch/freeswitch.pre-install | 4 |
4 files changed, 56 insertions, 30 deletions
diff --git a/main/freeswitch/APKBUILD b/main/freeswitch/APKBUILD index 8280a8489f..27081c2e5c 100644 --- a/main/freeswitch/APKBUILD +++ b/main/freeswitch/APKBUILD @@ -1,15 +1,15 @@ # Contributor: Michael Mason <ms13sp@gmail.com> pkgname=freeswitch pkgver=1.0.6 -pkgrel=4 +pkgrel=5 pkgdesc="A communications platform written in C from the ground up" url="http://www.freeswitch.org" license="GPL" depends="" makedepends="curl-dev unixodbc-dev zlib-dev openssl-dev autoconf automake libtool" -install= -subpackages="$pkgname-dev" +install="$pkgname.pre-install $pkgname.post-install" +subpackages="$pkgname-dev $pkgname-sounds $pkgname-moh" source="http://files.freeswitch.org/freeswitch-$pkgver.tar.gz modules.conf freeswitch.confd @@ -29,28 +29,26 @@ build() { ./configure --prefix=/usr \ --sysconfdir=/etc/freeswitch \ --with-modinstdir=/usr/lib/freeswitch \ + --with-rundir=/var/run/freeswitch \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ - # check how/when parallel builds are fixed here: - # http://jira.freeswitch.org/browse/FSBUILD-6 - - # build the libs and prerequisites in parallel first - make libs/apr/libapr-1.la \ - libs/apr-util/libaprutil-1.la \ - libs/speex/libspeex/libspeexdsp.la \ - libs/sqlite/libsqlite3.la \ - libs/pcre/libpcre.la \ - libs/srtp/libsrtp.la \ - src/include/switch_version.h - - # then the rest should build in parallel too - make || return 1 + make all || return 1 } package(){ cd "$srcdir/$pkgname-$pkgver" make -j1 DESTDIR="$pkgdir" install - mkdir "$pkgdir"/var/run/freeswitch + # we need to do some moving/cleanup to allow some... kind of FHS + mkdir -p "$pkgdir"/var/run/freeswitch + mkdir -p "$pkgdir"/var/lib/freeswitch + mkdir -p "$pkgdir"/var/log + mkdir -p "$pkgdir"/usr/share/freeswitch + mv "$pkgdir"/usr/db "$pkgdir"/var/lib/freeswitch/ + mv "$pkgdir"/usr/grammar "$pkgdir"/var/lib/freeswitch/ + mv "$pkgdir"/usr/htdocs "$pkgdir"/usr/share/freeswitch/ + mv "$pkgdir"/usr/recordings "$pkgdir"/var/lib/freeswitch/ + mv "$pkgdir"/usr/scripts "$pkgdir"/usr/share/freeswitch/ + mv "$pkgdir"/usr/log "$pkgdir"/var/log/freeswitch install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname } @@ -58,6 +56,6 @@ package(){ md5sums="388effee587887a81fe7f411b7350590 freeswitch-1.0.6.tar.gz c05f2356be159e99b3845f5260a33599 modules.conf c608cca8ad773acebf201f581438c7e7 freeswitch.confd -dd3a6535c54fc6ed8399d6bb57d88369 freeswitch.initd -697f8069eb8eaa158fa6c063d0e5fed7 freeswitch.post-install -661e2dff4022522b95c875f2f88aa66a freeswitch.pre-install" +a15f739b6f4f2c1685ab9f8831d30ca6 freeswitch.initd +107c52398ff88275006b8223ee0b4907 freeswitch.post-install +25945ad43b7dd988f37bf6f2603e22be freeswitch.pre-install" diff --git a/main/freeswitch/freeswitch.initd b/main/freeswitch/freeswitch.initd index 84381d7711..0538fff56b 100755 --- a/main/freeswitch/freeswitch.initd +++ b/main/freeswitch/freeswitch.initd @@ -7,27 +7,52 @@ depend() { need net } +opts="reload" + start() { local OPTS [ -n "${FREESWITCH_USER}" ] && \ - OPTS="${OPTS} -u ${FREESWITCH_USER}" + OPTS="${OPTS} -u ${FREESWITCH_USER}" [ -n "${FREESWITCH_GROUP}" ] && \ - OPTS="${OPTS} -g ${FREESWITCH_GROUP}" + OPTS="${OPTS} -g ${FREESWITCH_GROUP}" [ -n "${FREESWITCH_OPTS}" ] && \ - OPTS="${OPTS} ${FREESWITCH_OPTS}" + OPTS="${OPTS} ${FREESWITCH_OPTS}" - ebegin "Starting Freeswitch" + ebegin "Starting Freeswitch" + limits start-stop-daemon --start --quiet --exec /usr/bin/freeswitch \ - --pidfile /var/run/freeswitch.pid -- -nc ${OPTS} + -- -nc -conf /etc/freeswitch -log /var/log/freeswitch \ + -run /var/run/freeswitch -db /var/lib/freeswitch/db \ + -htdocs /usr/share/freeswitch/htdocs \ + -scripts /usr/share/freeswitch/scripts ${OPTS} eend $? } +# Recomended ULIMIT settings +# http://tinyurl.com/2dr467l (i,q,u,x not suppoted) + +limits() { + ulimit -c unlimited + ulimit -d unlimited + ulimit -f unlimited + ulimit -n 999999 + ulimit -v unlimited + ulimit -s 244 + ulimit -l unlimited +} + stop() { - ebegin "Stopping Freeswitch" - start-stop-daemon --stop --quiet --pidfile /var/run/freeswitch.pid + ebegin "Stopping Freeswitch" + /usr/bin/freeswitch -stop eend $? } +reload() { + start-stop-daemon --stop --signal 1 --quiet --pidfile \ + /var/run/freeswitch.pid --name freeswitch + return 0 +} + diff --git a/main/freeswitch/freeswitch.post-install b/main/freeswitch/freeswitch.post-install index 21577b1b0a..fef23caef1 100755 --- a/main/freeswitch/freeswitch.post-install +++ b/main/freeswitch/freeswitch.post-install @@ -1,4 +1,5 @@ #!/bin/sh -chown -R freeswitch:freeswitch /var/run/freeswitch/ +chown -R freeswitch:freeswitch /var/*/freeswitch +exit 0 diff --git a/main/freeswitch/freeswitch.pre-install b/main/freeswitch/freeswitch.pre-install index 23756f31df..043b963bbd 100755 --- a/main/freeswitch/freeswitch.pre-install +++ b/main/freeswitch/freeswitch.pre-install @@ -1,3 +1,5 @@ #!/bin/sh -adduser -H /var/run/freeswitch -s /bin/false -D freeswitch 2>/dev/null +adduser -H -h /var/run/freeswitch -s /bin/false -D freeswitch 2>/dev/null + +exit 0 |