luna-wallpapers.SlackBuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #!/bin/bash
  2. # Slackware build script for luna-wallpapers
  3. # Written by Niki Kovacs <info@microlinux.fr>
  4. #
  5. # Thanks to Antonio Hernàndez Blas for contributing to the wallpaper preview.
  6. #
  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. cd $(dirname $0) ; CWD=$(pwd)
  26. PRGNAM=luna-wallpapers
  27. VERSION=${VERSION:-0.2}
  28. BUILD=${BUILD:-3}
  29. TAG=${TAG:-_SBo}
  30. PKGTYPE=${PKGTYPE:-tgz}
  31. ARCH=noarch
  32. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  33. # the name of the created package would be, and then exit. This information
  34. # could be useful to other scripts.
  35. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  36. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  37. exit 0
  38. fi
  39. TMP=${TMP:-/tmp/SBo}
  40. PKG=$TMP/package-$PRGNAM
  41. OUTPUT=${OUTPUT:-/tmp}
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. # Xfce 4.10
  47. mkdir -p $PKG/usr/share/xfce4/backdrops
  48. # Xfce 4.12
  49. mkdir -p $PKG/usr/share/backgrounds/xfce
  50. # MATE
  51. mkdir -p $PKG/usr/share/backgrounds/mate/luna
  52. # KDE
  53. mkdir -p $PKG/usr/share/wallpapers
  54. # Xfce default
  55. ( cd $PKG/usr/share/xfce4/backdrops/
  56. tar xvf $CWD/elementary-wallpapers*ubuntu*.tar.gz
  57. cp -f elementary-wallpapers*/*.jpg elementary-wallpapers*/extra/*.jpg .
  58. rm -rf elementary-wallpapers*/
  59. )
  60. ( cd $PKG/usr/share/xfce4/backdrops/
  61. tar xvf $CWD/$PRGNAM.tar.gz
  62. ls -1 *.* | while read file; do
  63. newfile=$(echo $file | tr ' ' '_')
  64. if [ ! -f "$newfile" ]; then
  65. mv "$file" "$newfile"
  66. fi
  67. done
  68. )
  69. chown -R root:root $PKG
  70. find -L $PKG \
  71. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  72. -o -perm 511 \) -exec chmod 755 {} \; -o \
  73. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  74. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  75. # Wallpaper preview for KDE
  76. ( cd $PKG/usr/share/wallpapers
  77. ls -1 ../xfce4/backdrops/*.* | while read file; do
  78. ln -s "$file" .
  79. done
  80. )
  81. # Wallpaper preview for MATE
  82. ( cd $PKG/usr/share/backgrounds/mate/luna
  83. ls -1 ../../../xfce4/backdrops/*.* | while read file; do
  84. ln -s "$file" .
  85. done
  86. mkdir -p $PKG/usr/share/mate-background-properties
  87. cat << EOF > $PKG/usr/share/mate-background-properties/mate-luna.xml
  88. <?xml version="1.0" encoding="UTF-8"?>
  89. <!DOCTYPE wallpapers SYSTEM "mate-wp-list.dtd">
  90. <wallpapers>
  91. EOF
  92. ls -1 *.* | while read file; do
  93. cat << EOF >> $PKG/usr/share/mate-background-properties/mate-luna.xml
  94. <wallpaper deleted="false">
  95. <name>$file</name>
  96. <filename>/usr/share/backgrounds/mate/luna/$file</filename>
  97. <pcolor>#27587E</pcolor>
  98. <scolor>#627F5A</scolor>
  99. <options>zoom</options>
  100. </wallpaper>
  101. EOF
  102. done
  103. cat << EOF >> $PKG/usr/share/mate-background-properties/mate-luna.xml
  104. </wallpapers>
  105. EOF
  106. )
  107. # Wallpaper preview for Xfce 4.12
  108. ( cd $PKG/usr/share/backgrounds/xfce
  109. ls -1 ../../xfce4/backdrops/*.* | while read file; do
  110. ln -s "$file" .
  111. done
  112. )
  113. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  114. mv $PKG/usr/share/xfce4/backdrops/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
  115. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  116. mkdir -p $PKG/install
  117. cat $CWD/slack-desc > $PKG/install/slack-desc
  118. cd $PKG
  119. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE