#!/bin/sh CWD=`pwd` TMP=/tmp PKG=$TMP/package-asterisk VERSION=1.4.21.2 ADDVERSION=1.4.7 ARCH=alpha BUILD=1 TARGET=$ARCH-alphaslack-linux rm -rf $PKG mkdir -p $PKG ( cd $TMP rm -rf asterisk-$VERSION tar xzf $CWD/asterisk-$VERSION.tar.gz cd asterisk-$VERSION chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; ./configure \ --prefix=/usr \ --mandir=/usr/man \ --build=$TARGET || exit 1 make || exit 1 # spam your root for asterisk-addons make install make DESTDIR=$PKG install make DESTDIR=$PKG samples mkdir -p $PKG/usr/doc/asterisk-$VERSION cp -a BUGS C* H* READM* SECURITY LICENSE $PKG/usr/doc/asterisk-$VERSION cd $TMP rm -rf asterisk-addons-$ADDVERSION tar xzf $CWD/asterisk-addons-$ADDVERSION.tar.gz cd asterisk-addons-$ADDVERSION chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; ./configure \ --prefix=/usr \ --build=$TARGET || exit 1 make || exit 1 make DESTDIR=$PKG install make DESTDIR=$PKG samples cp -a C* doc/cdr* $PKG/usr/doc/asterisk-$ADDVERSION cd $TMP rm -rf asterisk-sounds-1.2.1 tar xzf $CWD/asterisk-sounds-1.2.1.tar.gz cd asterisk-sounds-1.2.1 chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 664 -exec chmod 644 {} \; make DESTDIR=$PKG install cp -a README.txt sounds-extra.txt $PKG/usr/doc/asterisk-$VERSION cp -a $CWD/{astguiclient_1.1.12-3.zip,astguiclient_2.0.4.zip} $PKG/usr/doc/asterisk-$VERSION chown -R root.bin $PKG/usr/bin $PKG/usr/sbin ( 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 ) gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/asterisk-$VERSION-$ARCH-$BUILD.tgz ) 2>&1 | tee $TMP/asterisk.build.log