lcdtest.SlackBuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # Slackware build script for lcdtest
  3. # Written by Taxis taxis@gmx.us
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=lcdtest
  6. VERSION=${VERSION:-1.18}
  7. BUILD=${BUILD:-2}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i486 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. set -e
  28. rm -rf $PKG
  29. mkdir -p $TMP $PKG $OUTPUT
  30. cd $TMP
  31. rm -rf $PRGNAM-$VERSION
  32. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  33. cd $PRGNAM-$VERSION
  34. chown -R root:root .
  35. find -L . \
  36. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  37. -exec chmod 755 {} \; -o \
  38. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  39. -exec chmod 644 {} \;
  40. # Undebianize the font path
  41. patch -p1 < $CWD/font-path.diff
  42. scons --prefix=/usr --mandir=man --install-sandbox=$PKG install
  43. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  44. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  45. find $PKG/usr/man -type f -exec gzip -9 {} \;
  46. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  47. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  48. cp -a COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  49. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  50. mkdir -p $PKG/install
  51. cat $CWD/slack-desc > $PKG/install/slack-desc
  52. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  53. cd $PKG
  54. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE