ardesia.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. # Slackware build script for ardesia
  3. # Written by Geoff Ritter < geoff dot ritter at gmail dot com >
  4. # Public Domain
  5. # 20220408 bkw: Modified by SlackBuilds.org, BUILD=2:
  6. # - i486 => i586.
  7. # - remove /usr/share/doc.
  8. # - do not litter /root/ with desktop-ey files during the build.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=ardesia
  11. VERSION=${VERSION:-1.1}
  12. BUILD=${BUILD:-2}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i586 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. rm -rf $PRGNAM-$VERSION
  47. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  48. cd $PRGNAM-$VERSION
  49. # thanks arch linux maintainers
  50. patch -p1 < $CWD/010-ardesia-gcc10-fix.patch
  51. chown -R root:root .
  52. find -L . \
  53. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  54. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  55. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  56. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  57. # 20220408 bkw: this thing creates too many files in /root/.local,
  58. # /root/.config, /root/.gnome... setting HOME fixes it, but would break
  59. # ccache if it's in use, so:
  60. mkdir -p .tmphome
  61. export CCACHE_DIR=${CCACHE_DIR:-$HOME/.ccache}
  62. export HOME=$( pwd )/.tmphome
  63. CFLAGS="$SLKCFLAGS" \
  64. CXXFLAGS="$SLKCFLAGS" \
  65. ./autogen.sh \
  66. --prefix=/usr \
  67. --libdir=/usr/lib$LIBDIRSUFFIX \
  68. --mandir=/usr/man \
  69. --docdir=/usr/doc/$PRGNAM-$VERSION \
  70. --build=$ARCH-slackware-linux
  71. make
  72. make install DESTDIR=$PKG
  73. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  74. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  75. find $PKG/usr/man -type f -exec gzip -9 {} \;
  76. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  77. rm -rf $PKG/usr/share/doc
  78. # --docdir is not respected and does not install all of the standard document files
  79. # Alternate Fail safe to the standard.
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. cp -a AUTHORS COPYING ChangeLog NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  82. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  83. mkdir -p $PKG/install
  84. cat $CWD/slack-desc > $PKG/install/slack-desc
  85. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE