sfarkxtc.SlackBuild 1.7 KB

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