summaryrefslogtreecommitdiffstats
path: root/academic/sage-bin/sage-bin.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'academic/sage-bin/sage-bin.SlackBuild')
-rw-r--r--academic/sage-bin/sage-bin.SlackBuild33
1 files changed, 25 insertions, 8 deletions
diff --git a/academic/sage-bin/sage-bin.SlackBuild b/academic/sage-bin/sage-bin.SlackBuild
index 90c381a894..2ff263c6dd 100644
--- a/academic/sage-bin/sage-bin.SlackBuild
+++ b/academic/sage-bin/sage-bin.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for sage-bin
@@ -22,11 +22,16 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=sage-bin
-VERSION=${VERSION:-8.3}
-DEBVERSION=${DEBVERSION:-9}
+VERSION=${VERSION:-9.4}
+DEBVERSION=${DEBVERSION:-11}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+SLK_VERSION=${SLK_VERSION:-$(cat /etc/slackware-version|cut -d' ' -f2)}
+[ $SLK_VERSION = 14.2 ] && PYTHON=python || PYTHON=python2
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -36,7 +41,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -53,6 +65,8 @@ mkdir -p $TMP $PKG $OUTPUT
cd $PKG
mkdir root proc opt
tar xvf $CWD/sage-$VERSION-Debian_GNU_Linux_$DEBVERSION-$ARCH.tar.bz2 -C $PKG/opt
+[ ! -r $CWD/$VERSION.patch ] || patch -p0 < $CWD/$VERSION.patch
+[ ! -r $CWD/${VERSION}_sh ] || . $CWD/${VERSION}_sh
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -61,8 +75,9 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
mkchroot .
-addchroot . python sed util-linux
+addchroot . $PYTHON sed util-linux
chroot . <<////
+export SAGE_BANNER=bare
mount -t proc proc proc
opt/SageMath/sage < /dev/null # Run sage patch system
umount proc
@@ -74,6 +89,7 @@ rm -rf Tools bin dev etc lib64 proc root sbin usr
# and other junk
rm -rf $PKG/opt/SageMath/.git
+mkdir -p $PKG/etc/profile.d
install -D -m0755 $CWD/profile.d/sage.sh $PKG/etc/profile.d
install -D -m0755 $CWD/profile.d/sage.csh $PKG/etc/profile.d
@@ -93,8 +109,9 @@ for res in 16x16 32x32 64x64 128x128 ; do
$PKG/usr/share/icons/hicolor/$res/mimetypes
done
-find $PKG/opt/SageMath/local/share/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/opt/SageMath/local/share/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+# Some man pages and their symlinks are already gzipped
+find $PKG/opt/SageMath/local/share/man -type f ! -name '*.gz' -exec gzip -9 {} \;
+for i in $( find $PKG/opt/SageMath/local/share/man -type l ! -name '*.gz' ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a opt/SageMath/*.{md,txt} $PKG/usr/doc/$PRGNAM-$VERSION
@@ -105,4 +122,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE