mypaint-brushes2.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. # Slackware build script for mypaint-brushes
  3. # Copyright 2022 Klaatu <klaatu@member.fsf.org>
  4. # GNU All-Permissive License
  5. # Copying and distribution of this file, with or without modification,
  6. # are permitted in any medium without royalty provided the copyright
  7. # notice and this notice are preserved. This file is offered as-is,
  8. # without any warranty.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=mypaint-brushes2
  11. SRCNAM=mypaint-brushes
  12. VERSION=${VERSION:-2.0.2}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. # If the variable PRINT_PACKAGE_NAME is set, then this script reports what
  24. # the name of the created package would be, and then exit. This information
  25. # could be useful to other scripts.
  26. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  27. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  28. exit 0
  29. fi
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. if [ "$ARCH" = "i586" ]; then
  34. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "i686" ]; then
  37. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-O2 -fPIC"
  41. LIBDIRSUFFIX="64"
  42. else
  43. SLKCFLAGS="-O2"
  44. LIBDIRSUFFIX=""
  45. fi
  46. ARCH=noarch
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $SRCNAM-$VERSION
  52. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  53. cd $SRCNAM-$VERSION
  54. chown -R root:root .
  55. find -L . \
  56. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  57. -o -perm 511 \) -exec chmod 755 {} \; -o \
  58. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  59. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  60. aclocal
  61. autoconf
  62. automake --add-missing
  63. #CFLAGS="$SLKCFLAGS" \
  64. #CXXFLAGS="$SLKCFLAGS" \
  65. ./configure \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --sysconfdir=/etc \
  69. --localstatedir=/var \
  70. --docdir=/usr/doc/$PRGNAM-$VERSION \
  71. --disable-static \
  72. --build=$ARCH-slackware-linux
  73. make
  74. make install-strip DESTDIR=$PKG
  75. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  76. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  77. mkdir -p $PKG/install
  78. cat $CWD/slack-desc > $PKG/install/slack-desc
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE