soundmodem.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/sh
  2. # Slackbuild for soundmodem
  3. # Written by JK Wood joshuakwood@gmail.com
  4. # Slackbuild is released under the Dog-on-Fire License:
  5. # If use of this script causes your dog to catch on fire,
  6. # you agree to send me five dollars. Or a picture
  7. # of the dog on fire.
  8. # Otherwise, you're on your own. I've tested the script
  9. # on my own computer, and it hasn't broken anything.
  10. # So if it does it on your computer, that falls in
  11. # the realm of "Not my problem."
  12. #
  13. # Of course, if you'll send a bug report to the above
  14. # email address, I may be able to see what you did
  15. # wrong and prevent it from happening in the future.
  16. # In which case, I may just send YOU five dollars.
  17. PRGNAM=soundmodem
  18. VERSION=${VERSION:-0.18}
  19. BUILD=${BUILD:-1}
  20. TAG=${TAG:-_SBo}
  21. if [ -z "$ARCH" ]; then
  22. case "$( uname -m )" in
  23. i?86) ARCH=i486 ;;
  24. arm*) ARCH=arm ;;
  25. *) ARCH=$( uname -m ) ;;
  26. esac
  27. fi
  28. CWD=$(pwd)
  29. TMP=${TMP:-/tmp/SBo}
  30. PKG=$TMP/package-$PRGNAM
  31. OUTPUT=${OUTPUT:-/tmp}
  32. if [ "$ARCH" = "i486" ]; then
  33. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "x86_64" ]; then
  39. SLKCFLAGS="-O2 -fPIC"
  40. LIBDIRSUFFIX="64"
  41. else
  42. SLKCFLAGS="-O2"
  43. LIBDIRSUFFIX=""
  44. fi
  45. set -e
  46. rm -rf $PKG
  47. mkdir -p $TMP $PKG $OUTPUT
  48. cd $TMP
  49. rm -rf $PRGNAM-$VERSION
  50. tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
  51. cd $PRGNAM-$VERSION
  52. chown -R root:root .
  53. find -L . \
  54. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  55. -o -perm 511 \) -exec chmod 755 {} \; -o \
  56. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  57. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  58. CFLAGS="$SLKCFLAGS" \
  59. CXXFLAGS="$SLKCFLAGS" \
  60. ./configure \
  61. --prefix=/usr \
  62. --sysconfdir=/etc \
  63. --localstatedir=/var \
  64. --libdir=/usr/${LIBDIRSUFFIX} \
  65. --mandir=/usr/man \
  66. --build=$ARCH-slackware-linux
  67. make
  68. make install DESTDIR=$PKG
  69. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  70. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  71. find $PKG/usr/man -type f -exec gzip -9 {} \;
  72. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a AUTHORS COPYING* INSTALL NEWS README* doc/*.sgml $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. find $PKG/usr/doc -name "Makefile" -exec rm {} \;
  77. find $PKG/usr/doc -type f -exec chmod 644 {} \;
  78. # Config files
  79. mkdir -p $PKG/etc/ax25
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. #cat $CWD/doinst.sh > $PKG/install/doinst.sh
  83. cd $PKG
  84. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}