slack-wallpapers.SlackBuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for slack-wallpapers
  3. # Copyright 2012-2016 Petar Petrov slackalaxy@gmail.com
  4. # Copyright 2017-2018 Skaendo <skaendo@linuxmail.org>
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. cd $(dirname $0) ; CWD=$(pwd)
  24. PRGNAM=slack-wallpapers
  25. VERSION=${VERSION:-1.0}
  26. BUILD=${BUILD:-2}
  27. TAG=${TAG:-_SBo}
  28. PKGTYPE=${PKGTYPE:-tgz}
  29. ARCH=noarch
  30. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  31. # the name of the created package would be, and then exit. This information
  32. # could be useful to other scripts.
  33. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  34. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  35. exit 0
  36. fi
  37. TMP=${TMP:-/tmp/SBo}
  38. PKG=$TMP/package-$PRGNAM
  39. OUTPUT=${OUTPUT:-/tmp}
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. cd $PRGNAM-$VERSION
  47. # I know this is probably some bad hackery, but it works.
  48. # Suggestions are welcome.
  49. for i in dated deviantart salix srbija; do
  50. if [ -e $CWD/$PRGNAM-$i-$VERSION.tar.gz ]; then
  51. tar xvf $CWD/$PRGNAM-$i-$VERSION.tar.gz
  52. mv ./*/wallpapers/* ./wallpapers
  53. else
  54. continue
  55. fi
  56. done
  57. chown -R root:root .
  58. find -L . \
  59. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  60. -o -perm 511 \) -exec chmod 755 {} \; -o \
  61. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  62. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  63. mkdir -p $PKG/usr/share/wallpapers
  64. cp -vr ./wallpapers/* $PKG/usr/share/wallpapers
  65. # Option to add backgrounds for LiLo.
  66. if [ "${LILO:-no}" = "yes" ]; then
  67. mkdir -p $PKG/boot/images
  68. cp -vr ./lilo-images/* $PKG/boot/images
  69. fi
  70. # Option to add symlinks for MATE.
  71. if [ "${MATE:-no}" = "yes" ]; then
  72. mkdir -p $PKG/usr/share/backgrounds/mate
  73. cd $PKG/usr/share/wallpapers/
  74. for i in *; do
  75. ln -s /usr/share/wallpapers/$i $PKG/usr/share/backgrounds/mate/.
  76. done
  77. fi
  78. # Option to add symlinks for XFCE.
  79. if [ "${XFCE:-no}" = "yes" ]; then
  80. mkdir -p $PKG/usr/share/backgrounds/xfce
  81. cd $PKG/usr/share/wallpapers/
  82. for i in *; do
  83. ln -s /usr/share/wallpapers/$i $PKG/usr/share/backgrounds/xfce/.
  84. done
  85. fi
  86. cd $TMP/$PRGNAM-$VERSION
  87. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  88. cp -a ChangeLog Contributing README \
  89. $PKG/usr/doc/$PRGNAM-$VERSION
  90. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  91. mkdir -p $PKG/install
  92. cat $CWD/slack-desc > $PKG/install/slack-desc
  93. cd $PKG
  94. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE