gcolor2.SlackBuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/bin/sh
  2. # Slackware build script for gcolor2
  3. # Written by slakmagik <jsun@freeshell.org>
  4. # Released under the WTFPL
  5. PRGNAM=gcolor2
  6. VERSION=0.4
  7. ARCH=${ARCH:-i486}
  8. BUILD=${BUILD:-2}
  9. TAG=${TAG:-_SBo}
  10. CWD=$(pwd)
  11. TMP=${TMP:-/tmp/SBo}
  12. PKG=$TMP/package-$PRGNAM
  13. OUTPUT=${OUTPUT:-/tmp}
  14. if [ "$ARCH" = "i486" ]; then
  15. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  16. elif [ "$ARCH" = "i686" ]; then
  17. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  18. fi
  19. set -e
  20. rm -rf $PKG
  21. mkdir -p $TMP $PKG $OUTPUT
  22. cd $TMP
  23. rm -rf $PRGNAM-$VERSION
  24. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  25. cd $PRGNAM-$VERSION
  26. chown -R root:root .
  27. find . \
  28. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  29. -exec chmod 755 {} \; -o \
  30. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
  31. -o -perm 400 \) -exec chmod 644 {} \;
  32. # gcolor2 prefills the saved colors with the contents of rgb.txt - which it
  33. # can't find without this patch.
  34. patch -p1 < $CWD/rgb.patch
  35. CFLAGS="$SLKCFLAGS" \
  36. CXXFLAGS="$SLKCFLAGS" \
  37. ./configure \
  38. --prefix=/usr
  39. make
  40. make DESTDIR=$PKG install-strip
  41. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  42. # the NEWS and README files are empty, so this doesn't include them
  43. cp -a [ACI]* $PKG/usr/doc/$PRGNAM-$VERSION
  44. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  45. mkdir -p $PKG/usr/share/applications
  46. cat $CWD/gcolor2.desktop > $PKG/usr/share/applications/gcolor2.desktop
  47. mkdir -p $PKG/install
  48. cat $CWD/slack-desc > $PKG/install/slack-desc
  49. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  50. cd $PKG
  51. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz