zaptel.SlackBuild 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. # Copyright 2006, Alan Hicks, Lizella, GA
  3. # All rights reserved.
  4. #
  5. # Redistribution and use of this script, with or without modification, is
  6. # permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  12. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  14. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  16. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  17. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  18. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  19. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  20. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. # Modified by Robby Workman <rworkman@slackbuilds.org> with a few things
  22. # related to udev rules and such
  23. set -e
  24. PRGNAM="zaptel"
  25. VERSION="1.4.11"
  26. ARCH=${ARCH:-i486}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG="$TMP/package-$PRGNAM"
  32. OUTPUT=${OUTPUT:-/tmp}
  33. rm -rf $PKG $TMP/$PRGNAM-$VERSION
  34. mkdir -p $TMP $PKG $OUTPUT
  35. cd $TMP
  36. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  37. cd $PRGNAM-$VERSION
  38. chown -R root:root .
  39. chmod -R a-s,u+w,go+r-w .
  40. # There's no ./configure script here. "make" has to be run once to
  41. # configure the system and even when everything is ok, make will
  42. # exit with a non-zero status the first time. We have to kludge this
  43. # so the script doesn't bail when called with "set -e".
  44. make || true
  45. make
  46. make install DESTDIR=$PKG
  47. ( cd $PKG
  48. find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  49. find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  50. )
  51. mkdir -p $PKG/install $PKG/usr/doc/$PRGNAM-$VERSION $PKG/etc/rc.d
  52. cp -a ChangeLog LICENSE README* $PKG/usr/doc/$PRGNAM-$VERSION/
  53. cat $CWD/zaptel.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/zaptel.SlackBuild
  54. find $PKG/usr/doc -type f -exec chmod 0644 {} \;
  55. chown -R root:root $PKG/usr/doc
  56. # Fix up the manpages
  57. mv $PKG/usr/share/man $PKG/usr/man
  58. gzip -9 $PKG/usr/man/man?/*.?
  59. # Add this directory. zaptel/asterisk will complain if it
  60. # is not present
  61. mkdir -p $PKG/var/lock/subsys
  62. # Don't clobber config file and init script
  63. mv $PKG/etc/zaptel.conf $PKG/etc/zaptel.conf.new
  64. install -m 0755 $CWD/rc.zaptel $PKG/etc/rc.d/rc.zaptel.new
  65. # udev handles device node creation
  66. rm -fr $PKG/dev
  67. # hotplug is dead
  68. rm -rf $PKG/etc/hotplug
  69. # rename udev rules file
  70. mv $PKG/etc/udev/rules.d/xpp.rules $PKG/etc/udev/rules.d/96-xpp.rules
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  73. cd $PKG
  74. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz