ent.SlackBuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/sh
  2. # Slackware build script for ent
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://sam.zoy.org/wtfpl/ for details.
  5. PRGNAM=ent
  6. VERSION=${VERSION:-20080128}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. ARCHIVE=random.zip
  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. CWD=$(pwd)
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. if [ "$ARCH" = "i486" ]; then
  22. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "i686" ]; then
  25. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "x86_64" ]; then
  28. SLKCFLAGS="-O2 -fPIC"
  29. LIBDIRSUFFIX="64"
  30. else
  31. SLKCFLAGS="-O2"
  32. LIBDIRSUFFIX=""
  33. fi
  34. set -e
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM
  39. mkdir -p $PRGNAM
  40. cd $PRGNAM
  41. unzip $CWD/$ARCHIVE
  42. chown -R root:root .
  43. find -L . \
  44. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  45. -exec chmod 755 {} \; -o \
  46. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  47. -exec chmod 644 {} \;
  48. make CC=gcc CFLAGS="$SLKCFLAGS"
  49. strip $PRGNAM
  50. mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/usr/doc/$PRGNAM-$VERSION
  51. cp $PRGNAM $PKG/usr/bin
  52. # The man page comes with the SlackBuild, not the source
  53. # (because I converted the HTML page to troff, hope it's OK)
  54. # ## Sure, that's fine :) --rworkman
  55. gzip -9c $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  56. cp -a $PRGNAM.html entitle.gif $PKG/usr/doc/$PRGNAM-$VERSION
  57. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  58. mkdir -p $PKG/install
  59. cat $CWD/slack-desc > $PKG/install/slack-desc
  60. cd $PKG
  61. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}