wmmon.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. # Slackware build script for wmmon
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20191211 bkw: Update for v1.4. Script can no longer build the old version.
  6. # - add libdockapp dep
  7. # - get rid of patches (no longer needed)
  8. # - add icon (to go with upstream's new .desktop file)
  9. # - s/clock/window in man page, also document -c option
  10. # 20170224 bkw:
  11. # - BUILD=2
  12. # - install /etc/wmmonrc as a proper .new config
  13. # - make doinst.sh treat /etc/wmmonrc.new correctly
  14. # - don't install INSTALL in package docdir
  15. # - added notes (to myself) about version numbers, to stop myself
  16. # from trying to "upgrade" to 1.2b1.
  17. # - actually mention windowmaker in the README (derp!)
  18. cd $(dirname $0) ; CWD=$(pwd)
  19. PRGNAM=wmmon
  20. VERSION=${VERSION:-1.4}
  21. BUILD=${BUILD:-1}
  22. TAG=${TAG:-_SBo}
  23. PKGTYPE=${PKGTYPE:-tgz}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. elif [ "$ARCH" = "i686" ]; then
  41. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  42. elif [ "$ARCH" = "x86_64" ]; then
  43. SLKCFLAGS="-O2 -fPIC"
  44. fi
  45. set -e
  46. rm -rf $PKG
  47. mkdir -p $TMP $PKG $OUTPUT
  48. cd $TMP
  49. rm -rf $PRGNAM-$VERSION
  50. tar xvf $CWD/${PRGNAM}_${VERSION}.orig.tar.gz
  51. cd $PRGNAM-$VERSION
  52. chown -R root:root .
  53. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  54. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  55. # Man page taken from Debian, slightly corrected, and -c option added.
  56. cat $CWD/$PRGNAM.1 > $PRGNAM.1
  57. CFLAGS="$SLKCFLAGS" \
  58. CXXFLAGS="$SLKCFLAGS" \
  59. ./configure \
  60. --prefix=/usr \
  61. --libdir=/usr/lib${LIBDIRSUFFIX} \
  62. --sysconfdir=/etc \
  63. --localstatedir=/var \
  64. --mandir=/usr/man \
  65. --docdir=/usr/doc/$PRGNAM-$VERSION \
  66. --build=$ARCH-slackware-linux
  67. make
  68. make install-strip DESTDIR=$PKG
  69. gzip $PKG/usr/man/man1/*.1
  70. mkdir -p $PKG/etc
  71. cat $CWD/wmmonrc > $PKG/etc/wmmonrc.new
  72. # Icon created from wmmon-master.xpm + some overlaid text. If you
  73. # think it's ugly, you're right: PLEASE send me a nicer looking one.
  74. # I never claimed to be a graphic designer.
  75. mkdir -p $PKG/usr/share/pixmaps
  76. cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
  77. # Make .desktop reference the icon.
  78. echo 'Icon=/usr/share/pixmaps/wmmon.png' >> \
  79. $PKG/usr/share/applications/$PRGNAM.desktop
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. cp -a BUGS CHANGES COPYING HINTS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  82. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  83. mkdir -p $PKG/install
  84. cat $CWD/slack-desc > $PKG/install/slack-desc
  85. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE