xbanish.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Copyright (c) 2013-2018 LEVAI Daniel
  3. # Copyright (c) 2020 B. Watson
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. # * Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # * Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. # * Neither the name of the <organization> nor the
  14. # names of its contributors may be used to endorse or promote products
  15. # derived from this software without specific prior written permission.
  16. #
  17. # THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY
  18. # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
  21. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. # Build script for xbanish
  28. # 20200720 bkw: update for v1.7
  29. # 20200129 bkw:
  30. # - take over maintenance
  31. # - update for v1.6
  32. # - i486 => i586
  33. # - use proper github download URL
  34. cd $(dirname $0) ; CWD=$(pwd)
  35. PRGNAM=xbanish
  36. VERSION=${VERSION:-1.7}
  37. BUILD=${BUILD:-1}
  38. TAG=${TAG:-_SBo}
  39. PKGTYPE=${PKGTYPE:-tgz}
  40. if [ -z "$ARCH" ]; then
  41. case "$( uname -m )" in
  42. i?86) ARCH=i586 ;;
  43. arm*) ARCH=arm ;;
  44. *) ARCH=$( uname -m ) ;;
  45. esac
  46. fi
  47. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  48. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  49. exit 0
  50. fi
  51. TMP=${TMP:-/tmp/SBo}
  52. PKG=$TMP/package-$PRGNAM
  53. OUTPUT=${OUTPUT:-/tmp}
  54. if [ "$ARCH" = "i586" ];then
  55. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  56. LIBDIRSUFFIX=""
  57. elif [ "$ARCH" = "i686" ]; then
  58. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  59. LIBDIRSUFFIX=""
  60. elif [ "$ARCH" = "x86_64" ]; then
  61. SLKCFLAGS="-O2 -fPIC"
  62. LIBDIRSUFFIX="64"
  63. else
  64. SLKCFLAGS="-O2"
  65. LIBDIRSUFFIX=""
  66. fi
  67. set -e
  68. rm -rf $PKG
  69. mkdir -p $TMP $PKG $OUTPUT
  70. cd $TMP
  71. rm -rf $PRGNAM-$VERSION
  72. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  73. cd $PRGNAM-$VERSION
  74. chown -R root:root .
  75. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  76. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  77. CFLAGS="$SLKCFLAGS" make
  78. make install PREFIX=/usr DESTDIR=$PKG # already stripped
  79. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
  81. cp -a README* $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. cd $PKG
  86. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE