lapack95.SlackBuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/sh
  2. # Slackware build script for lapack95
  3. # Written by Pablo Santamaría (pablosantamaria@gmail.com)
  4. PRGNAM=lapack95
  5. VERSION=${VERSION:-3.0}
  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. if [ "$ARCH" = "i486" ]; then
  20. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  21. LIBDIRSUFFIX=""
  22. elif [ "$ARCH" = "i686" ]; then
  23. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  24. LIBDIRSUFFIX=""
  25. elif [ "$ARCH" = "x86_64" ]; then
  26. SLKCFLAGS="-O2 -fPIC"
  27. LIBDIRSUFFIX="64"
  28. else
  29. SLKCFLAGS="-O2"
  30. LIBDIRSUFFIX=""
  31. fi
  32. set -e
  33. rm -rf $PKG
  34. mkdir -p $TMP $PKG $OUTPUT
  35. cd $TMP
  36. rm -rf $PRGNAM-$VERSION
  37. tar xvf $CWD/$PRGNAM.tgz
  38. cd LAPACK95
  39. chown -R root:root .
  40. find -L . \
  41. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  42. -exec chmod 755 {} \; -o \
  43. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  44. -exec chmod 644 {} \;
  45. # Copy the pre-configured make.inc file but put in the correct LIBDIR
  46. sed "s%@LIBDIR@%/usr/lib${LIBDIRSUFFIX}%" $CWD/make.inc > make.inc
  47. # Make single and double precision, complex and double complex
  48. # static library.
  49. cd SRC
  50. make -j1 clean
  51. make -j1 OPTS0="$SLKCFLAGS" single_double_complex_dcomplex
  52. cd ..
  53. # Install lib
  54. mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
  55. cp $PRGNAM.a $PKG/usr/lib${LIBDIRSUFFIX}/lib$PRGNAM.a
  56. # Install modules
  57. mkdir -p $PKG/usr/include/lapack95
  58. cp lapack95_modules/* $PKG/usr/include/lapack95
  59. # Install config script
  60. mkdir -p $PKG/usr/bin
  61. sed "s%@VERSION@%$VERSION%" $CWD/lapack95-config > $PKG/usr/bin/lapack95-config
  62. chmod 755 $PKG/usr/bin/lapack95-config
  63. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  64. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a README $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}