octave.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/sh
  2. # Slackware build script for octave
  3. # Written by Kyle Guinn <elyk03@gmail.com>
  4. PRGNAM="octave"
  5. VERSION=${VERSION:-3.4.2}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. DOCS="AUTHORS BUGS COPYING ChangeLog INSTALL* NEWS README"
  20. if [ "$ARCH" = "i486" ]; then
  21. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  22. LIBDIRSUFFIX=""
  23. elif [ "$ARCH" = "i686" ]; then
  24. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  25. LIBDIRSUFFIX=""
  26. elif [ "$ARCH" = "x86_64" ]; then
  27. SLKCFLAGS="-O2 -fPIC"
  28. LIBDIRSUFFIX="64"
  29. else
  30. SLKCFLAGS="-O2"
  31. LIBDIRSUFFIX=""
  32. fi
  33. # Default to use ImageMagick (shipped with Slackware) instead of
  34. # GraphicsMagick so that octave will have at least some sort of image
  35. # reading capabilities. ImageMagick limits images to 16bpp, but if you're
  36. # running a multilib environment, it might be easier to accept this limit
  37. # rather than to compile GraphicsMagick. (thanks to Joni Martikainen)
  38. WITH_MAGICK=${WITH_MAGICK:-ImageMagick} # alternatively, "GraphicsMagick"
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$VERSION
  44. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  45. cd $PRGNAM-$VERSION
  46. chown -R root:root .
  47. chmod -R u+w,go+r-w,a-st .
  48. # Several configure checks look for headers in the 'amd' directory
  49. # instead of 'cxsparse', 'camd', 'colamd', and 'ccolamd' directories
  50. # as liboctave/oct-sparse.h expects. Fix the typos and reconfigure.
  51. # Note that camd.h doesn't appear to be included anywhere, but is used
  52. # to determine if the CAMD library is present.
  53. sed -i -e 's| amd/cs\.h| cxsparse/cs.h|' \
  54. -e 's| amd/camd\.h| camd/camd.h|' \
  55. -e 's| amd/colamd\.h| colamd/colamd.h|' \
  56. -e 's| amd/ccolamd\.h| ccolamd/ccolamd.h|' configure.ac
  57. autoreconf -vif
  58. # If you have amd.h in some non-default location (e.g. /usr/include/amd/amd.h)
  59. # now the check for umfpack.h will fail because umfpack.h includes "amd.h"
  60. # instead of "amd/amd.h". The --with-amd-includedir option below fixes this.
  61. CFLAGS="$SLKCFLAGS" \
  62. CXXFLAGS="$SLKCFLAGS" \
  63. FFLAGS="$SLKCFLAGS" \
  64. ./configure \
  65. --prefix=/usr \
  66. --libdir=/usr/lib${LIBDIRSUFFIX} \
  67. --sysconfdir=/etc \
  68. --localstatedir=/var \
  69. --mandir=/usr/man \
  70. --infodir=/usr/info \
  71. --docdir=/usr/doc/$PRGNAM-$VERSION \
  72. --enable-shared \
  73. --disable-static \
  74. --enable-strict-warning-flags \
  75. --with-magick=$WITH_MAGICK \
  76. --with-amd-includedir=/usr/include/amd \
  77. --build=$ARCH-slackware-linux
  78. make
  79. make install-strip DESTDIR=$PKG
  80. find $PKG/usr/man -type f -exec gzip -9 {} \;
  81. rm -f $PKG/usr/info/dir
  82. gzip -9 $PKG/usr/info/*.info*
  83. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  84. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  85. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  86. mkdir -p $PKG/install
  87. cat $CWD/slack-desc > $PKG/install/slack-desc
  88. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  89. cd $PKG
  90. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}