mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-18 22:06:04 +01:00
85 lines
1.9 KiB
Text
85 lines
1.9 KiB
Text
|
#!/bin/sh
|
||
|
|
||
|
# Slackware build script for CHOLMOD
|
||
|
# Written by Kyle Guinn <elyk03@gmail.com>
|
||
|
|
||
|
PRGNAM=CHOLMOD
|
||
|
VERSION=${VERSION:-1.7.1}
|
||
|
BUILD=${BUILD:-1}
|
||
|
TAG=${TAG:-_SBo}
|
||
|
|
||
|
if [ -z "$ARCH" ]; then
|
||
|
case "$(uname -m)" in
|
||
|
i?86) ARCH=i486 ;;
|
||
|
arm*) ARCH=arm ;;
|
||
|
*) ARCH=$(uname -m) ;;
|
||
|
esac
|
||
|
fi
|
||
|
|
||
|
CWD=$(pwd)
|
||
|
TMP=${TMP:-/tmp/SBo}
|
||
|
PKG=$TMP/package-$PRGNAM
|
||
|
OUTPUT=${OUTPUT:-/tmp}
|
||
|
|
||
|
DOCS="README.txt Doc/ChangeLog Core/lesser.txt Modify/gpl.txt"
|
||
|
MODULE_DOCS="Core/License.txt Check/License.txt Cholesky/License.txt Partition/License.txt MatrixOps/License.txt Modify/License.txt Supernodal/License.txt"
|
||
|
|
||
|
if [ "$ARCH" = "i486" ]; then
|
||
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||
|
LIBDIRSUFFIX=""
|
||
|
elif [ "$ARCH" = "i686" ]; then
|
||
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||
|
LIBDIRSUFFIX=""
|
||
|
elif [ "$ARCH" = "x86_64" ]; then
|
||
|
SLKCFLAGS="-O2 -fPIC"
|
||
|
LIBDIRSUFFIX="64"
|
||
|
else
|
||
|
SLKCFLAGS="-O2"
|
||
|
LIBDIRSUFFIX=""
|
||
|
fi
|
||
|
|
||
|
set -e
|
||
|
|
||
|
rm -rf $PKG
|
||
|
mkdir -p $TMP $PKG $OUTPUT
|
||
|
cd $TMP
|
||
|
rm -rf $PRGNAM
|
||
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
||
|
cd $PRGNAM
|
||
|
chown -R root:root .
|
||
|
chmod -R u+w,go+r-w,a-st .
|
||
|
|
||
|
patch -p1 < $CWD/autotoolize.diff
|
||
|
if [ -e Include/cholmod_config.h ]; then
|
||
|
# patch can't handle git-diff renames
|
||
|
mv Include/cholmod_config.h Include/cholmod_config.h.in
|
||
|
fi
|
||
|
autoreconf -vif
|
||
|
|
||
|
CFLAGS="$SLKCFLAGS" \
|
||
|
CXXFLAGS="$SLKCFLAGS" \
|
||
|
./configure \
|
||
|
--prefix=/usr \
|
||
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
||
|
--sysconfdir=/etc \
|
||
|
--localstatedir=/var \
|
||
|
--mandir=/usr/man \
|
||
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
||
|
--build=$ARCH-slackware-linux
|
||
|
|
||
|
make
|
||
|
make install-strip DESTDIR=$PKG
|
||
|
|
||
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
||
|
for i in $MODULE_DOCS; do
|
||
|
cp -a $i $PKG/usr/doc/$PRGNAM-$VERSION/$(echo $i | tr / _)
|
||
|
done
|
||
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||
|
|
||
|
mkdir -p $PKG/install
|
||
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||
|
|
||
|
cd $PKG
|
||
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|