wmMoonClock.SlackBuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. # Slackware build script for wmMoonClock
  3. # Written by Cezary M. Kruk (c.kruk@bigfoot.com)
  4. #
  5. # Modified by the SlackBuilds.org project.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=wmMoonClock
  8. VERSION=${VERSION:-1.27}
  9. BUILD=${BUILD:-2}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i486 ;;
  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" = "i486" ]; then
  30. SLKCFLAGS="-O2 -march=i486 -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-$VERSION
  47. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  48. patch -p0 < $CWD/SouthernHemisphere.patch
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . \
  52. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  53. -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  55. -exec chmod 644 {} \;
  56. cd Src
  57. mkdir -p $PKG/usr/{bin,man/man1}
  58. make \
  59. CFLAGS="$SLKCFLAGS -fcommon" \
  60. INCDIR="-I/usr/include/X11" \
  61. LIBDIR="-L/usr/lib${LIBDIRSUFFIX}/X11"
  62. make install DESTDIR=$PKG/usr
  63. cd -
  64. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  65. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  66. ( cd $PKG/usr/man
  67. find . -type f -exec gzip -9 {} \;
  68. for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  69. )
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a BUGS COPYING $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