diff options
author | Alan Mizrahi <alan+crux@mizrahi.com.ve> | 2012-11-07 12:06:04 +0900 |
---|---|---|
committer | Alan Mizrahi <alan+crux@mizrahi.com.ve> | 2012-11-07 12:06:04 +0900 |
commit | 90a3099e574b20a028190cd4f4efdb1e62a4694d (patch) | |
tree | 74a640892d677a78da49e4e50152240c00346d29 | |
parent | 707ecceec911e40ce15896c8a0c7cb5dcf93f386 (diff) | |
download | contrib-90a3099e574b20a028190cd4f4efdb1e62a4694d.tar.gz contrib-90a3099e574b20a028190cd4f4efdb1e62a4694d.tar.xz |
asterisk: Updated version, Improved startup script, removed ilbc dependency, fixed permissions of config dir
-rw-r--r-- | asterisk/.footprint | 7 | ||||
-rw-r--r-- | asterisk/.md5sum | 5 | ||||
-rw-r--r-- | asterisk/Pkgfile | 11 | ||||
-rw-r--r-- | asterisk/asterisk.rc | 70 | ||||
-rw-r--r-- | asterisk/system-ilbc.patch | 11 | ||||
-rw-r--r-- | ilbc/.footprint | 12 | ||||
-rw-r--r-- | ilbc/.md5sum | 1 | ||||
-rw-r--r-- | ilbc/Pkgfile | 16 |
8 files changed, 61 insertions, 72 deletions
diff --git a/asterisk/.footprint b/asterisk/.footprint index f74d1347a..e01ddab5e 100644 --- a/asterisk/.footprint +++ b/asterisk/.footprint @@ -1,5 +1,5 @@ drwxr-xr-x root/root etc/ -drw-r----- root/asterisk etc/asterisk/ +drwxr-x--- root/asterisk etc/asterisk/ -rw-r----- root/asterisk etc/asterisk/adsi.conf -rw-r----- root/asterisk etc/asterisk/agents.conf -rw-r----- root/asterisk etc/asterisk/ais.conf @@ -82,7 +82,6 @@ drw-r----- root/asterisk etc/asterisk/ -rw-r----- root/asterisk etc/asterisk/res_pktccops.conf -rw-r----- root/asterisk etc/asterisk/res_snmp.conf -rw-r----- root/asterisk etc/asterisk/res_stun_monitor.conf --rw-r----- root/asterisk etc/asterisk/rpt.conf -rw-r----- root/asterisk etc/asterisk/rtp.conf -rw-r----- root/asterisk etc/asterisk/say.conf -rw-r----- root/asterisk etc/asterisk/sip.conf @@ -93,7 +92,6 @@ drw-r----- root/asterisk etc/asterisk/ -rw-r----- root/asterisk etc/asterisk/telcordia-1.adsi -rw-r----- root/asterisk etc/asterisk/udptl.conf -rw-r----- root/asterisk etc/asterisk/unistim.conf --rw-r----- root/asterisk etc/asterisk/usbradio.conf -rw-r----- root/asterisk etc/asterisk/users.conf -rw-r----- root/asterisk etc/asterisk/voicemail.conf -rw-r----- root/asterisk etc/asterisk/vpb.conf @@ -334,7 +332,6 @@ drwxr-xr-x root/root usr/lib/asterisk/modules/ -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_dahdi.so -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_iax2.so -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_local.so --rwxr-xr-x root/root usr/lib/asterisk/modules/chan_mgcp.so -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_multicast_rtp.so -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_oss.so -rwxr-xr-x root/root usr/lib/asterisk/modules/chan_phone.so @@ -447,6 +444,8 @@ drwxr-xr-x root/root usr/lib/asterisk/modules/ -rwxr-xr-x root/root usr/lib/asterisk/modules/res_timing_dahdi.so -rwxr-xr-x root/root usr/lib/asterisk/modules/res_timing_pthread.so -rwxr-xr-x root/root usr/lib/asterisk/modules/res_timing_timerfd.so +-rwxr-xr-x root/root usr/lib/asterisk/modules/test_config.so +-rwxr-xr-x root/root usr/lib/asterisk/modules/test_linkedlists.so drwxr-xr-x root/root usr/man/ drwxr-xr-x root/root usr/man/man8/ -rw-r--r-- root/root usr/man/man8/asterisk.8.gz diff --git a/asterisk/.md5sum b/asterisk/.md5sum index a4a421b22..ce4e4bb3e 100644 --- a/asterisk/.md5sum +++ b/asterisk/.md5sum @@ -1,8 +1,7 @@ -bf13d80136fb45f3fb35868604132245 asterisk-1.8.5.0.tar.gz -ec35f00ffb96e15cab3739c2d3ad8bf9 asterisk.rc +b08ea4a605b6a1cac51f0504b1a96680 asterisk-1.8.18.0.tar.gz +6c08926394413df2b8c5cb34d7d1f3ff asterisk.rc 69940891ce39a2d14209f8c94d408311 build-disable-sounds-en-gsm.patch 8ded3aa36d9ebd42c88ebc995f4567dc build-disable-sounds-moh.patch 921ca0b9652076765330eb14cfd9436b build-enable-cdr-mysql.patch 1f176d857322c95edf82c59be650ccb6 build-enable-ilbc.patch b2c16b1a24d47a4399329125eac8faf2 menuselect-tree -130a0755c75bf2e8992c3d0e603e257e system-ilbc.patch diff --git a/asterisk/Pkgfile b/asterisk/Pkgfile index dd6a74ccc..2f2f7c6ba 100644 --- a/asterisk/Pkgfile +++ b/asterisk/Pkgfile @@ -1,16 +1,15 @@ # Description: PBX Software implementation # URL: http://www.asterisk.org # Maintainer: Alan Mizrahi, alan at mizrahi dot com dot ve -# Depends on: openssl ncurses ilbc +# Depends on: openssl ncurses name=asterisk -version=1.8.5.0 -release=2 +version=1.8.18.0 +release=1 source=( http://downloads.digium.com/pub/asterisk/releases/asterisk-$version.tar.gz asterisk.rc menuselect-tree -system-ilbc.patch build-enable-ilbc.patch build-enable-cdr-mysql.patch build-disable-sounds-en-gsm.patch @@ -25,9 +24,6 @@ build () { # Normally this file is created by running the interactive menuselect program cp $SRC/menuselect-tree . - # Use system's ilbc library - patch -p1 -i $SRC/system-ilbc.patch - # Add support for ILBC patch -p1 -i $SRC/build-enable-ilbc.patch @@ -61,4 +57,5 @@ build () { chown -R asterisk:asterisk $PKG/var/{lib,log,run,spool}/asterisk chown -R root:asterisk $PKG/etc/asterisk chmod -R 640 $PKG/etc/asterisk + chmod 750 $PKG/etc/asterisk } diff --git a/asterisk/asterisk.rc b/asterisk/asterisk.rc index df90cc793..29870b4fc 100644 --- a/asterisk/asterisk.rc +++ b/asterisk/asterisk.rc @@ -3,38 +3,72 @@ # /etc/rc.d/asterisk: start/stop/restart asterisk # +NAME=asterisk USER=asterisk GROUP=asterisk +RUNDIR=/var/run/$NAME +PIDFILE=$RUNDIR/$NAME.pid +KILLINTCHECKS=30 +KILLINT=1 case $1 in -start) - cd /; /usr/sbin/asterisk -G $GROUP -U $USER - ;; -startdebug) - /usr/sbin/asterisk -G $GROUP -U $USER -vvv - ;; -stop) - [ -f /var/run/asterisk/asterisk.pid ] && kill `cat /var/run/asterisk/asterisk.pid` - ;; -stopnice) - /usr/sbin/asterisk -r -x 'core stop gracefully' - if [ -f /var/run/asterisk/asterisk.pid ]; then - echo "not stopped" +start|startnice|startdebug) + [ -d $RUNDIR ] || install -d -m 750 -o $USER -g $GROUP $RUNDIR || exit 1 + if [ -f $PIDFILE ]; then + pid=$(< $PIDFILE) + if [ ! -d /proc/$pid -o -z "$pid" ]; then + echo "$NAME: removing stale pidfile $PIDFILE" >&2 + rm -f $PIDFILE + fi + fi + if [ -f $PIDFILE ]; then + echo "$NAME already running with pid $pid" >&2 exit 1 + fi + [ $1 = "startnice" ] && echo "$NAME: starting" >&2 + cd / + if [ $1 = "startdebug" ]; then + /usr/sbin/asterisk -G $GROUP -U $USER -vvv + else + /usr/sbin/asterisk -G $GROUP -U $USER + fi + ;; +stop|stopnice) + if [ -f $PIDFILE ]; then + pid=$(< $PIDFILE) + if [ ! -d /proc/$pid -o -z "$pid" ]; then + echo "$NAME: removing stale pidfile $PIDFILE" >&2 + rm -f $PIDFILE + else + if [ $1 = "stop" ]; then + /usr/sbin/asterisk -r -x 'core stop now' + else + /usr/sbin/asterisk -r -x 'core stop gracefully' + fi + t=0 + while [ -d /proc/$pid -a $t -lt $KILLINTCHECKS ]; do + echo -n . + sleep $KILLINT + let t++ + done + if [ -d /proc/$pid ]; then + echo "$NAME still running with pid $pid" >&2 + else + rm -f $PIDFILE + fi + fi else - echo "stopped" - exit 0 + echo "$NAME is not running" >&2 fi ;; restart) $0 stop - sleep 2 $0 start ;; restartnice) - $0 stopnice && sleep 2 && $0 start + $0 stopnice && $0 startnice ;; *) - echo "usage: $0 [start|stop|restart]" + echo "usage: $0 [start|startnice|stop|stopnice|restart|restartnice]" ;; esac diff --git a/asterisk/system-ilbc.patch b/asterisk/system-ilbc.patch deleted file mode 100644 index a18cc29ce..000000000 --- a/asterisk/system-ilbc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- asterisk-1.8.4-rc2/codecs/Makefile.orig 2011-03-10 11:24:13.230106368 +0900 -+++ asterisk-1.8.4-rc2/codecs/Makefile 2011-03-10 11:25:02.246768144 +0900 -@@ -17,7 +17,7 @@ - MENUSELECT_CATEGORY=CODECS - MENUSELECT_DESCRIPTION=Codec Translators - --LIBILBC:=ilbc/libilbc.a -+LIBILBC:=/usr/lib/libilbc.a - LIBLPC10:=lpc10/liblpc10.a - - all: _all diff --git a/ilbc/.footprint b/ilbc/.footprint deleted file mode 100644 index 73551c5b6..000000000 --- a/ilbc/.footprint +++ /dev/null @@ -1,12 +0,0 @@ -drwxr-xr-x root/root usr/ -drwxr-xr-x root/root usr/include/ -drwxr-xr-x root/root usr/include/ilbc/ --rw-r--r-- root/root usr/include/ilbc/iLBC_decode.h --rw-r--r-- root/root usr/include/ilbc/iLBC_define.h --rw-r--r-- root/root usr/include/ilbc/iLBC_encode.h -drwxr-xr-x root/root usr/lib/ --rw-r--r-- root/root usr/lib/libilbc.a --rwxr-xr-x root/root usr/lib/libilbc.la -lrwxrwxrwx root/root usr/lib/libilbc.so -> libilbc.so.0.0.0 -lrwxrwxrwx root/root usr/lib/libilbc.so.0 -> libilbc.so.0.0.0 --rwxr-xr-x root/root usr/lib/libilbc.so.0.0.0 diff --git a/ilbc/.md5sum b/ilbc/.md5sum deleted file mode 100644 index 5d7c6b800..000000000 --- a/ilbc/.md5sum +++ /dev/null @@ -1 +0,0 @@ -c53bb4f1d7184789ab90d2d33571e78a ilbc-rfc3951.tar.gz diff --git a/ilbc/Pkgfile b/ilbc/Pkgfile deleted file mode 100644 index 9ef9b1975..000000000 --- a/ilbc/Pkgfile +++ /dev/null @@ -1,16 +0,0 @@ -# Description: iLBC library -# URL: http://www.ilbcfreeware.org -# Maintainer: Alan Mizrahi, alan at mizrahi dot com dot ve -# Depends on: - -name=ilbc -version=0.1 -release=1 -source=(http://download.savannah.nongnu.org/releases/linphone/1.3.x/source/ilbc-rfc3951.tar.gz) - -build () { - cd ilbc-rfc3951 - ./configure --prefix=/usr - make - make DESTDIR=$PKG install -} |