maxima.SlackBuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. #!/bin/bash
  2. # Slackware build script for maxima
  3. # Copyright 2021 Judah Milgram <milgram@cgpp.com>
  4. # Copyright 2017 Dhaby Xiloj <slack.dhabyx@gmail.com>
  5. # All rights reserved.
  6. # Based on work of Robby and others slackers.
  7. # Copyright 2006-2007 Robby Workman (http://rlworkman.net)
  8. # All rights reserved.
  9. #
  10. # Redistribution and use of this script, with or without modification, is
  11. # permitted provided that the following conditions are met:
  12. #
  13. # 1. Redistributions of this script must retain the above copyright
  14. # notice, this list of conditions and the following disclaimer.
  15. #
  16. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  17. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. # Modified by João Medeiros as needed to build maxima instead of octave
  27. # Modified by the SlackBuilds.org project
  28. # Modified by Ken Milmore 2009
  29. # Modified by Glenn Becker to update to version 5.28.0
  30. # Glenn Becker -> update to version 5.38.1
  31. # JM -> update version 5.39 -> 5.44
  32. cd $(dirname $0) ; CWD=$(pwd)
  33. PRGNAM=maxima
  34. VERSION=${VERSION:-5.44.0}
  35. BUILD=${BUILD:-1}
  36. TAG=${TAG:-_SBo}
  37. PKGTYPE=${PKGTYPE:-tgz}
  38. if [ -z "$ARCH" ]; then
  39. case "$( uname -m )" in
  40. i?86) ARCH=i586 ;;
  41. arm*) ARCH=arm ;;
  42. *) ARCH=$( uname -m ) ;;
  43. esac
  44. fi
  45. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  46. # the name of the created package would be, and then exit. This information
  47. # could be useful to other scripts.
  48. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  49. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  50. exit 0
  51. fi
  52. TMP=${TMP:-/tmp/SBo}
  53. PKG=$TMP/package-$PRGNAM
  54. OUTPUT=${OUTPUT:-/tmp}
  55. if [ "$ARCH" = "i586" ]; then
  56. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  57. LIBDIRSUFFIX=""
  58. elif [ "$ARCH" = "i686" ]; then
  59. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  60. LIBDIRSUFFIX=""
  61. elif [ "$ARCH" = "x86_64" ]; then
  62. SLKCFLAGS="-O2 -fPIC"
  63. LIBDIRSUFFIX="64"
  64. else
  65. SLKCFLAGS="-O2"
  66. LIBDIRSUFFIX=""
  67. fi
  68. set -e
  69. rm -rf $PKG
  70. mkdir -p $TMP $PKG $OUTPUT
  71. cd $TMP
  72. rm -rf $PRGNAM-$VERSION
  73. tar -zxvf $CWD/$PRGNAM-$VERSION.tar.gz
  74. cd $PRGNAM-$VERSION
  75. chown -R root:root .
  76. find -L . \
  77. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  78. -o -perm 511 \) -exec chmod 755 {} \; -o \
  79. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  80. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  81. CFLAGS="$SLKCFLAGS" \
  82. CXXFLAGS="$SLKCFLAGS" \
  83. ./configure \
  84. --prefix=/usr \
  85. --libdir=/usr/lib${LIBDIRSUFFIX} \
  86. --mandir=/usr/man \
  87. --infodir=/usr/info \
  88. --sysconfdir=/etc \
  89. --localstatedir=/var
  90. make
  91. make install DESTDIR=$PKG
  92. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  93. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  94. find $PKG/usr/man -type f -exec gzip -9 {} \;
  95. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  96. # NOTE: Do not compress the info pages; they are needed by Maxima's help facility.
  97. rm -rf $PKG/usr/info/dir
  98. # gzip -9 $PKG/usr/info/*.info*
  99. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  100. cp -a AUTHORS COPYING ChangeLog* INSTALL* NEWS README* \
  101. $PKG/usr/doc/$PRGNAM-$VERSION
  102. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  103. mkdir -p $PKG/install
  104. cat $CWD/slack-desc > $PKG/install/slack-desc
  105. cd $PKG
  106. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE