diff options
author | Alan Hicks <alan@lizella.net> | 2010-05-11 20:01:29 +0200 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2010-05-11 20:01:29 +0200 |
commit | a98998a7f9403fdd57d512e2ca848155f5973b57 (patch) | |
tree | 22844bce7626f62cbfada32e9eb4700ce23e77f9 | |
parent | e728769016e769f36d650858c932e047268dd315 (diff) | |
download | slackbuilds-a98998a7f9403fdd57d512e2ca848155f5973b57.tar.gz |
network/asterisk: Added to 12.0 repository
-rw-r--r-- | network/asterisk/README | 6 | ||||
-rw-r--r-- | network/asterisk/asterisk.SlackBuild | 97 | ||||
-rw-r--r-- | network/asterisk/asterisk.info | 8 | ||||
-rw-r--r-- | network/asterisk/doinst.sh | 33 | ||||
-rw-r--r-- | network/asterisk/logrotate.asterisk | 8 | ||||
-rw-r--r-- | network/asterisk/slack-desc | 19 |
6 files changed, 171 insertions, 0 deletions
diff --git a/network/asterisk/README b/network/asterisk/README new file mode 100644 index 0000000000..919de7c8cf --- /dev/null +++ b/network/asterisk/README @@ -0,0 +1,6 @@ +Asterisk has a number of optional build dependencies. If you intend to +use any analogue PSTN hardware such as DigiumTDM400P, you should install +the zaptel software and drivers before compiling Asterisk. If you will +instead use digital telephony hardware (not IP phones) such as T1/E1 +lines or a PRI, you'll need to install libpri, again before compiling +Asterisk. diff --git a/network/asterisk/asterisk.SlackBuild b/network/asterisk/asterisk.SlackBuild new file mode 100644 index 0000000000..acb963d7b5 --- /dev/null +++ b/network/asterisk/asterisk.SlackBuild @@ -0,0 +1,97 @@ +#!/bin/bash +# Copyright 2006, Alan Hicks, Lizella, GA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Modified by Robby Workman <rworkman@slackbuilds.org> +# No additional license terms :) + +set -e + +PRGNAM="asterisk" +VERSION="1.4.13" +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG="$TMP/pkg-$PRGNAM" +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +fi + +rm -fr $PKG $TMP/$PRGNAM-$VERSION +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chmod -R a-s,u+w,go+r-w . +chown -R root:root . + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man + +make +make samples DESTDIR=$PKG +make install DESTDIR=$PKG + +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +mkdir -p $PKG/install $PKG/usr/doc/$PRGNAM-$VERSION/sample_confs +mv $PKG/etc/asterisk/* $PKG/usr/doc/$PRGNAM-$VERSION/sample_confs/ +cp -a CHANGES COPYING CREDITS ChangeLog LICENSE README UPGRADE.txt doc/ \ + $PKG/usr/doc/$PRGNAM-$VERSION/ +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +gzip -9 $PKG/usr/man/man?/*.? + +# Logrotate script +mkdir -p $PKG/etc/logrotate.d +install -m 0644 $CWD/logrotate.asterisk $PKG/etc/logrotate.d/asterisk.new + +# Install a few typical config files for common asterisk servers +for i in \ + asterisk codecs extensions iax indications musiconhold sip zapata modules ; + do + cat $PKG/usr/doc/$PRGNAM-$VERSION/sample_confs/${i}.conf > \ + $PKG/etc/asterisk/${i}.conf.new ; +done + +mkdir -p $PKG/etc/rc.d +install -m 0755 contrib/init.d/rc.slackware.asterisk $PKG/etc/rc.d/rc.asterisk.new + +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +chown -R root:root . # Some files have improper ownership +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/asterisk/asterisk.info b/network/asterisk/asterisk.info new file mode 100644 index 0000000000..4c3829d627 --- /dev/null +++ b/network/asterisk/asterisk.info @@ -0,0 +1,8 @@ +PRGNAM="asterisk" +VERSION="1.4.13" +HOMEPAGE="http://www.asterisk.org" +DOWNLOAD="http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.13.tar.gz" +MD5SUM="49b73114831c21cc9784d3b3f4fb5bec" +MAINTAINER="Alan Hicks" +EMAIL="alan@lizella.net" +APPROVED="rworkman" diff --git a/network/asterisk/doinst.sh b/network/asterisk/doinst.sh new file mode 100644 index 0000000000..f413bbd436 --- /dev/null +++ b/network/asterisk/doinst.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.asterisk.new: +if [ -e etc/rc.d/rc.asterisk ]; then + cp -a etc/rc.d/rc.asterisk etc/rc.d/rc.asterisk.new.incoming + cat etc/rc.d/rc.asterisk.new > etc/rc.d/rc.asterisk.new.incoming + mv etc/rc.d/rc.asterisk.new.incoming etc/rc.d/rc.asterisk.new +fi + +config etc/rc.d/rc.asterisk.new +config etc/logrotate.d/asterisk.new +config etc/asterisk/asterisk.conf.new +config etc/asterisk/codecs.conf.new +config etc/asterisk/extensions.conf.new +config etc/asterisk/iax.conf.new +config etc/asterisk/indications.conf.new +config etc/asterisk/modules.conf.new +config etc/asterisk/musiconhold.conf.new +config etc/asterisk/sip.conf.new +config etc/asterisk/zapata.conf.new + diff --git a/network/asterisk/logrotate.asterisk b/network/asterisk/logrotate.asterisk new file mode 100644 index 0000000000..f2281a71bc --- /dev/null +++ b/network/asterisk/logrotate.asterisk @@ -0,0 +1,8 @@ +/var/log/asterisk/messages /var/log/asterisk/*log { + missingok + rotate 5 + weekly + postrotate + /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null + endscript +} diff --git a/network/asterisk/slack-desc b/network/asterisk/slack-desc new file mode 100644 index 0000000000..200434038a --- /dev/null +++ b/network/asterisk/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler---------------------------------------------------| +asterisk: asterisk (Asterisk Open Source PBX) +asterisk: +asterisk: Asterisk is an Open Source PBX and telephony toolkit. It is, in a +asterisk: sense, middleware between Internet and telephony channels on the +asterisk: bottom, and Internet and telephony applications at the top. For +asterisk: more information on the project itself, please visit the Asterisk +asterisk: home page at http://www.asterisk.org/ +asterisk: +asterisk: +asterisk: +asterisk: |