wmtime.SlackBuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. # Slackware build script for wmtime
  3. # Originally written by Pablo Santamaria (email removed)
  4. # Now maintained by B. Watson <yalhcru@gmail.com>. Original version
  5. # had no license, modified version released under the WTFPL. See
  6. # http://www.wtfpl.net/txt/copying/ for details.
  7. # 20210219 bkw: update for v1.4. This adds libdockapp as a dep, and
  8. # greatly simplifies the locale support. Also upstream added a man page,
  9. # so get rid of mine.
  10. # 20170211 bkw:
  11. # - Add man page, BUILD=3
  12. # 20170210 bkw:
  13. # - Take over maintenance, BUILD=2
  14. # - i486 => i586
  15. # - Make the language stuff work, support LANGUAGE variable
  16. # - Add Spanish, French, German language support.
  17. cd $(dirname $0) ; CWD=$(pwd)
  18. PRGNAM=wmtime
  19. VERSION=${VERSION:-1.4}
  20. BUILD=${BUILD:-1}
  21. TAG=${TAG:-_SBo}
  22. PKGTYPE=${PKGTYPE:-tgz}
  23. if [ -z "$ARCH" ]; then
  24. case "$( uname -m )" in
  25. i?86) ARCH=i586 ;;
  26. arm*) ARCH=arm ;;
  27. *) ARCH=$( uname -m ) ;;
  28. esac
  29. fi
  30. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  31. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  32. exit 0
  33. fi
  34. TMP=${TMP:-/tmp/SBo}
  35. PKG=$TMP/package-$PRGNAM
  36. OUTPUT=${OUTPUT:-/tmp}
  37. if [ "$ARCH" = "i586" ]; then
  38. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "i686" ]; then
  41. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  42. LIBDIRSUFFIX=""
  43. elif [ "$ARCH" = "x86_64" ]; then
  44. SLKCFLAGS="-O2 -fPIC"
  45. LIBDIRSUFFIX="64"
  46. else
  47. SLKCFLAGS="-O2"
  48. LIBDIRSUFFIX=""
  49. fi
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. # The top-level dir is named dockapps-<githash>, force it to decompress to
  56. # a sanely-named directory:
  57. mkdir -p $PRGNAM-$VERSION
  58. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -C $PRGNAM-$VERSION --strip-components=1
  59. cd $PRGNAM-$VERSION
  60. chown -R root:root .
  61. chmod 644 *
  62. make CFLAGS="$SLKCFLAGS" LDFLAGS="-Wl,-s" PREFIX=/usr
  63. make install DESTDIR=$PKG PREFIX=/usr MANDIR=/usr/man/man1
  64. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a CHANGES COPYING HINTS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE