vtwm.SlackBuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/bash
  2. # Slackware build script for vtwm
  3. # Written by Andrew Rowland <darowland@ieee.org>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=vtwm
  6. VERSION=${VERSION:-5.5.0_rc8}
  7. SRCVERSION=$(echo $VERSION | tr '_' '-')
  8. SRCVERSION2=20120316
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. rm -rf $PRGNAM-$SRCVERSION2
  47. tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.gz
  48. cd $PRGNAM-$SRCVERSION2
  49. chown -R root:root .
  50. find -L . \
  51. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  52. -exec chmod 755 {} \; -o \
  53. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  54. -exec chmod 644 {} \;
  55. sed -i Imakefile \
  56. -e 's:-L/usr/local/lib::g' \
  57. -e 's:-I/usr/local/include::g'
  58. xmkmf
  59. make CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" -j1
  60. make install DESTDIR=$PKG
  61. mkdir -p $PKG/usr/share/vtwm
  62. cp -r contrib/vtwmrc $PKG/usr/share/vtwm
  63. cp contrib/support/sysrc_add_apps.sh $PKG/usr/share/vtwm
  64. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  65. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  66. find $PKG/usr/man -type f -exec gzip -9 {} \;
  67. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  68. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  69. cp -a \
  70. doc/*ANNOUNCE doc/*README doc/*FUTURE doc/BUGS doc/CHANGELOG doc/HISTORY doc/INSTALL doc/SOUND doc/WISHLIST \
  71. $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE