trayer-srg.SlackBuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #!/bin/bash
  2. # Slackware build script for trayer-srg
  3. # Copyright 2013 Bojan Popovic Belgrade Serbia
  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. # Now maintained by B. Watson (yalhcru@gmail.com)
  23. # 20210907 bkw: BUILD=2, spelling/grammar fixes in docs.
  24. # 20180612 bkw: updated for v1.1.8.
  25. # 20170708 bkw:
  26. # - updated for v1.1.7.
  27. # - stop installing INSTALL in doc dir.
  28. # 20170122 bkw:
  29. # - updated for latest git.
  30. # 20150111 bkw:
  31. # - Updated for latest git. Switching from git hash as version number to the
  32. # date of the last commit as found by 'git log'. At least you can compare
  33. # dates just by looking at them.
  34. # - Upstream now uses a (non-autotools) ./configure script.
  35. cd $(dirname $0) ; CWD=$(pwd)
  36. PRGNAM=trayer-srg
  37. VERSION=${VERSION:-1.1.8}
  38. BUILD=${BUILD:-2}
  39. TAG=${TAG:-_SBo}
  40. PKGTYPE=${PKGTYPE:-tgz}
  41. if [ -z "$ARCH" ]; then
  42. case "$( uname -m )" in
  43. i?86) ARCH=i586 ;;
  44. arm*) ARCH=arm ;;
  45. *) ARCH=$( uname -m ) ;;
  46. esac
  47. fi
  48. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  49. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  50. exit 0
  51. fi
  52. TMP=${TMP:-/tmp/SBo}
  53. PKG=$TMP/package-$PRGNAM
  54. OUTPUT=${OUTPUT:-/tmp}
  55. if [ "$ARCH" = "i586" ];then
  56. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  57. LIBDIRSUFFIX=""
  58. elif [ "$ARCH" = "i686" ];then
  59. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  60. LIBDIRSUFFIX=""
  61. elif [ "$ARCH" = "x86_64" ]; then
  62. SLKCFLAGS="-O2 -fPIC"
  63. LIBDIRSUFFIX="64"
  64. else
  65. SLKCFLAGS="-O2"
  66. LIBDIRSUFFIX=""
  67. fi
  68. set -e
  69. #TARNAM="${PRGNAM}-trayer" # for old versions
  70. TARNAM="${PRGNAM}-trayer"
  71. rm -rf $PKG
  72. mkdir -p $TMP $PKG $OUTPUT
  73. cd $TMP
  74. rm -rf $TARNAM-$VERSION
  75. tar xvf $CWD/$TARNAM-$VERSION.tar.?z*
  76. cd $TARNAM-$VERSION
  77. chown -R root:root .
  78. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  79. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  80. patch -p1 < $CWD/spelling_grammar_fixes.diff
  81. # not a real (autotools) configure script, notice non-canonical use
  82. # of --prefix here!
  83. ./configure --prefix=/usr/bin
  84. CFLAGS="$SLKCFLAGS" make # This will also strip the executable
  85. # Instead of patching the Makefile, let's install it manually:
  86. mkdir -p $PKG/usr/bin
  87. install -m 0755 trayer $PKG/usr/bin
  88. mkdir -p $PKG/usr/man/man1
  89. gzip -c man/trayer.1 > $PKG/usr/man/man1/trayer.1.gz
  90. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  91. cp -a CHANGELOG COPYING CREDITS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  92. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  93. mkdir -p $PKG/install
  94. cat $CWD/slack-desc > $PKG/install/slack-desc
  95. cd $PKG
  96. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE