Surfn.SlackBuild 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. # Slackware build script for Surfn
  3. # Copyright 2018-2020 Leonardo Citrolo, Italy
  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. # 20220312 bkw: Modified by SlackBuilds.org: fix VERSION/SRCVER mess.
  23. # VERSION must be a constant, and must match VERSION in the .info file.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=Surfn
  26. VERSION=${VERSION:-20.12_7}
  27. SRCVER=${SRCVER:-$( echo $VERSION | tr _ -)}
  28. BUILD=${BUILD:-1}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. ARCH=noarch
  32. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  33. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  34. exit 0
  35. fi
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$SRCVER
  44. # It's better not to be verbose, there's an awful lot of files to extract
  45. echo "Extracting files..."
  46. tar xf $CWD/$PRGNAM-$SRCVER.tar.gz
  47. cd $PRGNAM-$SRCVER
  48. chown -R root:root .
  49. mkdir -p $PKG/usr/share/icons
  50. cp -a surfn-icons/$PRGNAM* $PKG/usr/share/icons
  51. find $PKG/usr/share/icons \
  52. \( -name CREDITS \
  53. -o -name LICENSE \
  54. -o -name create-new-icon-theme.cache.sh \
  55. -o -name icon-theme.cache \) -exec rm -f {} \;
  56. rm -f $PKG/usr/share/icons/Surfn/changelog \
  57. $PKG/usr/share/icons/Surfn/LICENSE.txt
  58. find $PKG/usr/share/icons -type d -exec chmod 755 {} \;
  59. find $PKG/usr/share/icons -type f -exec chmod 644 {} \;
  60. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  61. cp -a surfn-icons/Surfn/{changelog,CREDITS,LICENSE.txt} README.md \
  62. $PKG/usr/doc/$PRGNAM-$VERSION
  63. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cd $PKG
  67. # 20200407 bkw: makepkg's symlink search and doinst.sh creation doesn't
  68. # scale well. This makes the build complete much faster, and create an
  69. # identical doinst.sh.
  70. find . -type l \
  71. -printf '( cd %h ; rm -rf %f )\n( cd %h ; ln -sf %l %f )\n' -delete | \
  72. sed 's,cd \./,cd ,' >> $PKG/install/doinst.sh
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE