l-smash.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/bin/bash
  2. # Slackware build script for l-smash
  3. # Copyright 2015, Andrew Strong, Blue Mountains Australia.
  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 <urchlay@slackware.uk>
  23. # 20220411 bkw: BUILD=3, put README in right place (not /install!)
  24. # 20210910 bkw: include our own README since there are no docs
  25. # 20180215 bkw: update for 2.14.5
  26. # 20170302 bkw: use long-format github URL
  27. # 20160817 bkw:
  28. # - take over maintenance
  29. # - update for 2.9.1
  30. # - actually use SLKCFLAGS
  31. # - i486 => i586
  32. cd $(dirname $0) ; CWD=$(pwd)
  33. PRGNAM=l-smash
  34. VERSION=${VERSION:-2.14.5}
  35. BUILD=${BUILD:-3}
  36. TAG=${TAG:-_SBo}
  37. PKGTYPE=${PKGTYPE:-tgz}
  38. if [ -z "$ARCH" ]; then
  39. case "$( uname -m )" in
  40. i?86) ARCH=i586 ;;
  41. arm*) ARCH=arm ;;
  42. *) ARCH=$( uname -m ) ;;
  43. esac
  44. fi
  45. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  46. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  47. exit 0
  48. fi
  49. TMP=${TMP:-/tmp/SBo}
  50. PKG=$TMP/package-$PRGNAM
  51. OUTPUT=${OUTPUT:-/tmp}
  52. if [ "$ARCH" = "i586" ]; then
  53. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  54. LIBDIRSUFFIX=""
  55. elif [ "$ARCH" = "i686" ]; then
  56. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  57. LIBDIRSUFFIX=""
  58. elif [ "$ARCH" = "x86_64" ]; then
  59. SLKCFLAGS="-O2 -fPIC"
  60. LIBDIRSUFFIX="64"
  61. else
  62. SLKCFLAGS="-O2"
  63. LIBDIRSUFFIX=""
  64. fi
  65. set -e
  66. rm -rf $PKG
  67. mkdir -p $TMP $PKG $OUTPUT
  68. cd $TMP
  69. rm -rf $PRGNAM-$VERSION
  70. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  71. cd $PRGNAM-$VERSION
  72. chown -R root:root .
  73. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  74. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  75. # -Wl,-s = strip binaries at link time.
  76. ./configure \
  77. --prefix=/usr \
  78. --libdir=/usr/lib${LIBDIRSUFFIX} \
  79. --disable-static \
  80. --enable-shared \
  81. --extra-cflags="$SLKCFLAGS" \
  82. --extra-ldflags="-Wl,-s"
  83. make
  84. make install DESTDIR=$PKG
  85. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  86. cp -a LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
  87. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  88. # 20210910 bkw: upstream didn't bother with any docs other than --help
  89. # messages. Include our own README, which at least tells the user the
  90. # names of the binaries (hint: none of them are called l-smash!), and
  91. # tells him to use the --help option.
  92. cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README
  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