mypaint.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for mypaint
  3. # Copyright 2013-22 klaatu klaatu@member.fsf.org
  4. # All rights reserved.
  5. #
  6. # GNU All-Permissive License
  7. # Copying and distribution of this file, with or without modification,
  8. # are permitted in any medium without royalty provided the copyright
  9. # notice and this notice are preserved. This file is offered as-is,
  10. # without any warranty.
  11. cd $(dirname $0) ; CWD=$(pwd)
  12. PRGNAM=mypaint
  13. VERSION=${VERSION:-2.0.1}
  14. BUILD=${BUILD:-1}
  15. TAG=${TAG:-_SBo}
  16. PKGTYPE=${PKGTYPE:-tgz}
  17. if [ -z "$ARCH" ]; then
  18. case "$( uname -m )" in
  19. i?86) ARCH=i586 ;;
  20. arm*) ARCH=arm ;;
  21. *) ARCH=$( uname -m ) ;;
  22. esac
  23. fi
  24. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  25. # the name of the created package would be, and then exit. This information
  26. # could be useful to other scripts.
  27. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  28. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  29. exit 0
  30. fi
  31. TMP=${TMP:-/tmp/SBo}
  32. PKG=$TMP/package-$PRGNAM
  33. OUTPUT=${OUTPUT:-/tmp}
  34. if [ "$ARCH" = "i586" ]; then
  35. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "x86_64" ]; then
  41. SLKCFLAGS="-O2 -fPIC"
  42. LIBDIRSUFFIX="64"
  43. else
  44. SLKCFLAGS="-O2"
  45. LIBDIRSUFFIX=""
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$VERSION
  52. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  53. cd $PRGNAM-$VERSION
  54. chown -R root:root .
  55. find -L . \
  56. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  57. -exec chmod 755 {} \; -o \
  58. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  59. -exec chmod 644 {} \;
  60. python3 setup.py build
  61. python3 setup.py install --prefix=/usr --root=$PKG
  62. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  63. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a BUILDING.md CODE_OF_CONDUCT.md CONTRIBUTING.md \
  66. COPYING Changelog.md DEBUGGING.md ISSUE_TEMPLATE.md \
  67. Licenses.dep5 Licenses.md README.md \
  68. $PKG/usr/doc/$PRGNAM-$VERSION
  69. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  70. mkdir -p $PKG/install
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  73. cd $PKG
  74. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE