gcompris-qt.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/bash
  2. # Slackware build script for gcompris-qt
  3. # Copyright 2020-2023 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. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM=gcompris-qt
  28. VERSION=${VERSION:-3.1}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31. PKGTYPE=${PKGTYPE:-tgz}
  32. if [ -z "$ARCH" ]; then
  33. ARCH="$( uname -m )"
  34. fi
  35. case "$ARCH" in
  36. i?86)
  37. ARCH=i586
  38. SRCARCH=32
  39. ;;
  40. x86_64)
  41. ARCH=x86_64
  42. SRCARCH=64
  43. ;;
  44. *)
  45. echo "Unsupported architecture"
  46. exit 1
  47. ;;
  48. esac
  49. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  50. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  51. exit 0
  52. fi
  53. TMP=${TMP:-/tmp/SBo}
  54. PKG=$TMP/package-$PRGNAM
  55. OUTPUT=${OUTPUT:-/tmp}
  56. set -e
  57. rm -rf $PKG
  58. mkdir -p $PKG/opt/gcompris-qt $OUTPUT
  59. cd $PKG/opt/gcompris-qt
  60. sh $CWD/$PRGNAM-$VERSION-Linux${SRCARCH}.sh \
  61. --prefix=$PKG/opt/gcompris-qt \
  62. --exclude-subdir \
  63. --skip-license
  64. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  65. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  66. find -L $PKG \
  67. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  68. -o -perm 511 \) -exec chmod 755 {} \; -o \
  69. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  70. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  71. install -D -m644 $CWD/gcompris-qt.desktop \
  72. $PKG/usr/share/applications/gcompris-qt.desktop
  73. install -D -m644 $CWD/gcompris-qt.png \
  74. $PKG/usr/share/icons/hicolor/256x256/apps/gcompris-qt.png
  75. install -D -m755 $CWD/gcompris-qt $PKG/usr/bin/gcompris-qt
  76. # move this here to catch anything that may not have proper ownership
  77. chown -R root:root $PKG
  78. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  79. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  83. cd $PKG
  84. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE