cwstation.SlackBuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/sh
  2. # Slackware build script for cwstation
  3. # Written by G. Schoenmakers <gschoen@iinet.net.au>
  4. PRGNAM=cwstation
  5. VERSION=${VERSION:-0.1}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. AUTOMAKE=/usr/share/automake-1.11
  20. if [ "$ARCH" = "i486" ]; then
  21. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  22. LIBDIRSUFFIX=""
  23. elif [ "$ARCH" = "i686" ]; then
  24. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  25. LIBDIRSUFFIX=""
  26. elif [ "$ARCH" = "x86_64" ]; then
  27. SLKCFLAGS="-O2 -fPIC"
  28. LIBDIRSUFFIX="64"
  29. else
  30. SLKCFLAGS="-O2"
  31. LIBDIRSUFFIX=""
  32. fi
  33. set -e
  34. rm -rf $PKG
  35. mkdir -p $TMP $PKG $OUTPUT
  36. cd $TMP
  37. rm -rf $PRGNAM-$VERSION
  38. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  39. cd $PRGNAM-$VERSION
  40. # Delete links to /usr/share/automake-1.8
  41. rm COPYING
  42. rm INSTALL
  43. rm depcomp
  44. rm install-sh
  45. rm missing
  46. chown -R root:root .
  47. find -L . \
  48. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  49. -exec chmod 755 {} \; -o \
  50. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  51. -exec chmod 644 {} \;
  52. # Create links to /usr/share/automake-1.11
  53. ln -s $AUTOMAKE/COPYING COPYING
  54. ln -s $AUTOMAKE/INSTALL INSTALL
  55. ln -s $AUTOMAKE/depcomp depcomp
  56. ln -s $AUTOMAKE/install-sh install-sh
  57. ln -s $AUTOMAKE/missing missing
  58. # The Makefile expects "mkinstalldirs" to be in the application source directory
  59. # A simple link to /bin/mkdir suffices.
  60. ln -s /bin/mkdir mkinstalldirs
  61. CFLAGS="$SLKCFLAGS" \
  62. CXXFLAGS="$SLKCFLAGS" \
  63. ./configure \
  64. --prefix=/usr \
  65. --libdir=/usr/lib${LIBDIRSUFFIX} \
  66. --sysconfdir=/etc \
  67. --localstatedir=/var \
  68. --build=$ARCH-slackware-linux
  69. make LDFLAGS="-lm"
  70. make install DESTDIR=$PKG
  71. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  72. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a AUTHORS README $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}