wmclock.SlackBuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Slackware build script for wmclock
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20151110 bkw:
  6. # - finally got around to upgrading to 1.0.14.
  7. # - added default language in slack-desc.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=wmclock
  10. VERSION=${VERSION:-1.0.14}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i586 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  50. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  51. # Set the default language with LANGUAGE=<language> in the environment
  52. # Default is english. It's still possible to display in other
  53. # languages using the -monthxpm and -weekdayxpm options.
  54. LANGUAGE=${LANGUAGE:-english}
  55. ./configure --lang $LANGUAGE
  56. make CDEBUGFLAGS="$SLKCFLAGS" PREFIX=/usr
  57. mkdir -p $PKG/usr/bin
  58. install -s -m0755 -o root -g root $PRGNAM $PKG/usr/bin
  59. make install.share DESTDIR=$PKG PREFIX=/usr
  60. mkdir -p $PKG/usr/man/man1
  61. gzip -9c $PRGNAM.man > $PKG/usr/man/man1/$PRGNAM.1.gz
  62. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  63. cp README COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  64. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  65. mkdir -p $PKG/install
  66. sed "s,@LANGUAGE@,$LANGUAGE," $CWD/slack-desc > $PKG/install/slack-desc
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE