slackbuilds_ponce/academic/R/R.SlackBuild

87 lines
2.1 KiB
Text
Raw Normal View History

2010-05-12 23:27:35 +02:00
#!/bin/sh
# Slackware build script for R
# Written by Joel J. Adamson
# Modified by SlackBuilds.org
PRGNAM=R
VERSION=2.9.0
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
2010-05-12 23:27:35 +02:00
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
2010-05-13 00:19:44 +02:00
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
2010-05-12 23:27:35 +02:00
SLKCFLAGS="-O2 -fPIC"
2010-05-13 00:19:44 +02:00
LIBDIRSUFFIX="64"
2010-05-12 23:27:35 +02:00
fi
2010-05-13 00:19:44 +02:00
set -e
2010-05-12 23:27:35 +02:00
rm -rf $PKG
2010-05-13 00:19:44 +02:00
mkdir -p $TMP $PKG $OUTPUT
2010-05-12 23:27:35 +02:00
rm -rf $TMP/$PRGNAM-$VERSION
2010-05-13 00:19:44 +02:00
cd $TMP
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
2010-05-12 23:27:35 +02:00
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
2010-05-13 00:19:44 +02:00
# Adjust the path variable; you need pdflatex to build the LaTeX documentation
PATH="$PATH:/usr/share/texmf/bin"
2010-05-12 23:27:35 +02:00
CFLAGS="$SLKCFLAGS" \
2010-05-13 00:19:44 +02:00
./configure \
2010-05-12 23:27:35 +02:00
--prefix=/usr \
2010-05-13 00:19:44 +02:00
--libdir=/usr/lib${LIBDIRSUFFIX} \
2010-05-12 23:27:35 +02:00
--sysconfdir=/etc \
--localstatedir=/var \
2010-05-13 00:19:44 +02:00
--mandir=/usr/man \
2010-05-12 23:27:35 +02:00
--with-perl=/usr/bin/perl \
--enable-R-shlib \
2010-05-13 00:19:44 +02:00
--build=$ARCH-slackware-linux
2010-05-12 23:27:35 +02:00
2010-05-13 00:19:44 +02:00
make
make install DESTDIR=$PKG
2010-05-12 23:27:35 +02:00
2010-04-20 21:43:56 +02:00
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
2010-05-12 23:27:35 +02:00
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/usr/doc
2010-05-13 00:19:44 +02:00
mv $PKG/usr/lib${LIBDIRSUFFIX}/R/doc $PKG/usr/doc/$PRGNAM-$VERSION
2010-05-12 23:27:35 +02:00
cp -a INSTALL README $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
chown -R root:root $PKG/usr/doc
2010-05-13 00:19:44 +02:00
( cd $PKG/usr/lib${LIBDIRSUFFIX}/R ; ln -s /usr/doc/$PRGNAM-$VERSION doc )
2010-05-12 23:27:35 +02:00
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
2010-05-13 00:19:44 +02:00
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}