ggobi.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # Slackware build script for ggobi
  3. # Written by Pedro Mendes pedro@gepasi.org
  4. # hereby put in the public domain
  5. # 20220308 bkw: Modified by SlackBuilds.org: fix build on 15.0,
  6. # by upgrading to v2.1.11.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=ggobi
  9. VERSION=${VERSION:-2.1.11}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i586 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -eu
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . \
  49. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  50. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  51. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  52. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  53. CXXFLAGS="$SLKCFLAGS" \
  54. CFLAGS="$SLKCFLAGS" \
  55. ./configure \
  56. --prefix=/usr \
  57. --libdir=/usr/lib$LIBDIRSUFFIX \
  58. --sysconfdir=/etc \
  59. --localstatedir=/var/lib \
  60. --mandir=/usr/man \
  61. --infodir=/usr/info \
  62. --disable-static \
  63. --with-all-plugins \
  64. --build=$ARCH-slackware-linux
  65. make
  66. make install-strip DESTDIR=$PKG
  67. make ggobirc
  68. mkdir -p $PKG/etc/xdg/ggobi
  69. cp ggobirc $PKG/etc/xdg/ggobi/ggobirc
  70. rm -f $PKG/usr/info/dir
  71. # 20220308 bkw: PDF docs go in the regular doc dir, we don't use /usr/share/doc
  72. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  73. mkdir -p $PKGDOC
  74. mv $PKG/usr/share/doc/$PRGNAM/* $PKGDOC
  75. rm -rf $PKG/usr/share/doc
  76. cp -a AUTHORS COPYING CPLicense.txt ChangeLog NEWS README $PKGDOC
  77. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  78. rm -f $PKG/usr/lib*/*.la
  79. mkdir -p $PKG/install
  80. cat $CWD/slack-desc > $PKG/install/slack-desc
  81. cd $PKG
  82. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE