gcompris-qt.SlackBuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #!/bin/bash
  2. # Slackware build script for gcompris-qt
  3. # Copyright 2020 Willy Sudiarto Raharjo <willysr@slackbuilds.org>
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without modification,
  7. # are permitted provided that the following conditions are met:
  8. #
  9. # * Redistributions of source code must retain the above copyright notice,
  10. # this list of conditions and the following disclaimer.
  11. # * Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  19. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  21. # TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  22. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  23. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  24. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. # This software is licensed under the GNU GENERAL PUBLIC LICENSE Version 3,
  27. # 29 June 2007
  28. #
  29. # You should have received a copy of the GNU General Public License
  30. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  31. cd $(dirname $0) ; CWD=$(pwd)
  32. PRGNAM=gcompris-qt
  33. VERSION=${VERSION:-2.4}
  34. BUILD=${BUILD:-1}
  35. TAG=${TAG:-_SBo}
  36. PKGTYPE=${PKGTYPE:-tgz}
  37. if [ -z "$ARCH" ]; then
  38. ARCH="$( uname -m )"
  39. fi
  40. case "$ARCH" in
  41. i?86)
  42. ARCH=i586
  43. SRCARCH=32
  44. ;;
  45. x86_64)
  46. ARCH=x86_64
  47. SRCARCH=64
  48. ;;
  49. *)
  50. echo "Unsupported architecture"
  51. exit 1
  52. ;;
  53. esac
  54. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  55. # the name of the created package would be, and then exit. This information
  56. # could be useful to other scripts.
  57. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  58. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  59. exit 0
  60. fi
  61. TMP=${TMP:-/tmp/SBo}
  62. PKG=$TMP/package-$PRGNAM
  63. OUTPUT=${OUTPUT:-/tmp}
  64. set -e
  65. rm -rf $PKG
  66. mkdir -p $PKG/opt/gcompris-qt $OUTPUT
  67. cd $PKG/opt/gcompris-qt
  68. sh $CWD/$PRGNAM-$VERSION-Linux${SRCARCH}.sh \
  69. --prefix=$PKG/opt/gcompris-qt \
  70. --exclude-subdir \
  71. --skip-license
  72. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  73. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  74. find -L $PKG \
  75. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  76. -o -perm 511 \) -exec chmod 755 {} \; -o \
  77. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  78. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  79. install -D -m644 $CWD/gcompris-qt.desktop \
  80. $PKG/usr/share/applications/gcompris-qt.desktop
  81. install -D -m644 $CWD/gcompris-qt.png \
  82. $PKG/usr/share/icons/hicolor/256x256/apps/gcompris-qt.png
  83. install -D -m755 $CWD/gcompris-qt $PKG/usr/bin/gcompris-qt
  84. # move this here to catch anything that may not have proper ownership
  85. chown -R root:root $PKG
  86. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  87. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  88. mkdir -p $PKG/install
  89. cat $CWD/slack-desc > $PKG/install/slack-desc
  90. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE