wmsystemtray.SlackBuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # Slackware build script for wmsystemtray
  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. # 20170210 bkw:
  8. # - Take over maintenance
  9. # - Update for v1.4
  10. # - i486 => i586
  11. # - cosmetic fixes to script, README, slack-desc
  12. cd $(dirname $0) ; CWD=$(pwd)
  13. PRGNAM=wmsystemtray
  14. VERSION=${VERSION:-1.4}
  15. BUILD=${BUILD:-1}
  16. TAG=${TAG:-_SBo}
  17. PKGTYPE=${PKGTYPE:-tgz}
  18. if [ -z "$ARCH" ]; then
  19. case "$( uname -m )" in
  20. i?86) ARCH=i586 ;;
  21. arm*) ARCH=arm ;;
  22. *) ARCH=$( uname -m ) ;;
  23. esac
  24. fi
  25. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  26. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  27. exit 0
  28. fi
  29. TMP=${TMP:-/tmp/SBo}
  30. PKG=$TMP/package-$PRGNAM
  31. OUTPUT=${OUTPUT:-/tmp}
  32. if [ "$ARCH" = "i586" ]; then
  33. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "x86_64" ]; then
  39. SLKCFLAGS="-O2 -fPIC"
  40. LIBDIRSUFFIX="64"
  41. else
  42. SLKCFLAGS="-O2"
  43. LIBDIRSUFFIX=""
  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.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. CFLAGS="$SLKCFLAGS" \
  56. CXXFLAGS="$SLKCFLAGS" \
  57. ./configure \
  58. --prefix=/usr \
  59. --libdir=/usr/lib${LIBDIRSUFFIX} \
  60. --sysconfdir=/etc \
  61. --localstatedir=/var \
  62. --mandir=/usr/man \
  63. --build=$ARCH-slackware-linux
  64. make
  65. make install-strip DESTDIR=$PKG
  66. gzip $PKG/usr/man/man1/$PRGNAM.1
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cp -a COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  69. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  70. mkdir -p $PKG/install
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE