2013-11-23 15:18:36 +01:00
|
|
|
#!/bin/sh
|
2011-11-26 16:42:55 +01:00
|
|
|
|
|
|
|
# Slackware build script for Scilab
|
|
|
|
|
2014-04-15 02:26:51 +02:00
|
|
|
# Copyright 2011-2014 Fridrich von Stauffenberg <cancellor2@gmail.com>
|
2011-11-26 16:42:55 +01:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
PRGNAM=scilab
|
2014-04-15 02:26:51 +02:00
|
|
|
VERSION=${VERSION:-5.5.0}
|
2012-12-10 16:21:27 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2011-11-26 16:42:55 +01:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i686 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" != "i686" ] && [ "$ARCH" != "x86_64" ]; then
|
2012-12-10 16:21:27 +01:00
|
|
|
printf "\n\n$ARCH is not supported...\n"
|
2011-11-26 16:42:55 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-12-10 16:21:27 +01:00
|
|
|
set -e
|
2011-11-26 16:42:55 +01:00
|
|
|
|
2012-05-05 18:28:29 +02:00
|
|
|
rm -rf $PKG
|
2012-12-10 16:21:27 +01:00
|
|
|
mkdir -p $OUTPUT $TMP $PKG/opt/$PRGNAM
|
|
|
|
cd $PKG/opt/$PRGNAM
|
2014-04-15 02:26:51 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.bin.linux-$ARCH.tar.gz --strip-components=1
|
2012-12-10 16:21:27 +01:00
|
|
|
chown -R root:root .
|
2011-11-26 16:42:55 +01:00
|
|
|
|
2014-04-15 02:26:51 +02:00
|
|
|
sed -i "/^prefix/s/=.*\$/=\/opt\/$PRGNAM/" lib/pkgconfig/$PRGNAM.pc
|
2011-11-26 16:42:55 +01:00
|
|
|
|
|
|
|
mkdir -p $PKG/etc/profile.d
|
2012-12-10 16:21:27 +01:00
|
|
|
cat $CWD/profile.d/$PRGNAM.sh > $PKG/etc/profile.d/$PRGNAM.sh
|
|
|
|
cat $CWD/profile.d/$PRGNAM.csh > $PKG/etc/profile.d/$PRGNAM.csh
|
2011-11-26 16:42:55 +01:00
|
|
|
chmod 0755 $PKG/etc/profile.d/*
|
|
|
|
|
2012-12-10 16:21:27 +01:00
|
|
|
mkdir -p $PKG/usr/lib $PKG/usr/share
|
|
|
|
mv lib/pkgconfig $PKG/usr/lib
|
|
|
|
mv share/applications share/icons share/mime $PKG/usr/share/
|
2011-11-26 16:42:55 +01:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-04-15 02:26:51 +02:00
|
|
|
mv *.txt ACKNOWLEDGE* CHANGES* COPYING* README* RELEASE* \
|
2012-12-10 16:21:27 +01:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2011-11-26 16:42:55 +01:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2012-12-10 16:21:27 +01:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|