numix-icon-theme.SlackBuild 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #!/bin/bash
  2. #
  3. # Slackware build script for numix-icon-theme.
  4. #
  5. # Copyright 2015-2018 Edinaldo P. Silva, Rio de Janeiro, Brazil.
  6. # Copyright 2020 Isaac Yu <isaacyu1@isaacyu1.com>
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. # 20200406 bkw: modified by SlackBuilds.org
  26. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM="numix-icon-theme"
  28. VERSION=${VERSION:-20200320}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31. PKGTYPE=${PKGTYPE:-tgz}
  32. ARCH=noarch
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. SRCVER=${SRCVER:-20.03.20}
  44. set -e
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $PRGNAM-$SRCVER
  49. tar xvf $CWD/${PRGNAM}-${SRCVER}.tar.gz
  50. cd $PRGNAM-$SRCVER
  51. chown -R root:root .
  52. mkdir -p $PKG/usr/share/icons
  53. cp -r Numix Numix-Light $PKG/usr/share/icons
  54. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  55. cp license readme.md $PKG/usr/doc/$PRGNAM-$VERSION
  56. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  57. mkdir -p $PKG/install
  58. cat $CWD/slack-desc > $PKG/install/slack-desc
  59. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  60. # 20200406 bkw: create doinst.sh. Normally makepkg does this, but it's
  61. # *painfully* slow and we have over 17,000 symlinks to process. It takes
  62. # 15 minutes for makepkg to run on my test system. The find command
  63. # below runs in 1.5 seconds and creates an identical doinst.sh. This is
  64. # a 1000x speedup.
  65. cd $PKG
  66. find . -type l \
  67. -printf '( cd %h ; rm -rf %f )\n( cd %h ; ln -sf %l %f )\n' -delete | \
  68. sed 's,cd \./,cd ,' >> $PKG/install/doinst.sh
  69. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE