qstat.SlackBuild 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/sh
  2. # Slackware build script for qstat
  3. # Copyright 2007 David Somero <dsomero@hotmail.com>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. # Modified by SlackBuilds.org
  23. set -e
  24. PRGNAM=qstat
  25. VERSION=2.11
  26. ARCH=${ARCH:-i486}
  27. BUILD=${BUILD:-1}
  28. TAG=${TAG:-_SBo}
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. if [ "${ARCH}" = "i486" ]; then
  34. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. fi
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $PRGNAM-$VERSION
  42. tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
  43. cd $PRGNAM-$VERSION
  44. chown -R root:root .
  45. chmod -R a-s,u+w,go+r-w .
  46. CFLAGS="${SLKCFLAGS}" \
  47. CXXFLAGS="${SLKCFLAGS}" \
  48. ./configure \
  49. --prefix=/usr \
  50. --sysconfdir=/etc \
  51. --localstatedir=/var \
  52. --mandir=/usr/man \
  53. --program-prefix="" \
  54. --program-suffix="" \
  55. --with-docdir=/usr/doc/$PRGNAM-$VERSION
  56. make
  57. make install DESTDIR=$PKG
  58. ( cd $PKG
  59. find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  60. find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  61. )
  62. # If there are docs in /usr/share, move them:
  63. if [ -d $PKG/usr/share/doc ]; then
  64. mkdir -p $PKG/usr/doc/
  65. mv $PKG/usr/share/doc/* $PKG/usr/doc
  66. rmdir $PKG/usr/share/doc
  67. fi
  68. # Don't clobber existing config
  69. mv $PKG/etc/qstat.cfg $PKG/etc/qstat.cfg.new
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a LICENSE.txt CHANGES.txt ChangeLog COMPILE.txt $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/qstat.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/qstat.SlackBuild
  73. mkdir -p $PKG/install
  74. cat $CWD/slack-desc > $PKG/install/slack-desc
  75. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz