#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild and on crux port of R # http://clc.morpheus.net/portdb/?command=viewfile&repo=yhafri&port=r&file=Pkgfile # Requirements: readline, tcl, tk, zlib, libpng, libjpeg, libpcre, blas, lapack # http://www.r-project.org/ NAME=r-project VERSION=2.5.0 ARCH=${ARCH:-i486} BUILD=1lu SOURCE=http://microarrays.unife.it/CRAN/src/base/R-2/R-2.5.0.tar.gz CWD=`pwd` #wget -c $SOURCE if ["$TMP" = ""]; then TMP=/tmp fi PKG=$TMP/package-$NAME if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi mkdir -p $PKG/usr cd $TMP tar xzvf $CWD/R-$VERSION.tar.gz cd R-$VERSION CFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --mandir=/usr/man \ --enable-R-shlib \ --with-system-zlib \ --with-system-bzlib \ --with-system-pcre \ --with-blas \ --with-lapack \ --with-x make make prefix=$PKG/usr install sed -i -e "s/R_HOME_DIR=.*$/R_HOME_DIR=\/usr\/lib\/R/" $PKG/usr/bin/R sed -i "s|/tmp/package-r-project||g" $PKG/usr/bin/R sed -i "s|/tmp/package-r-project||g" $PKG/usr/lib/R/bin/R sed -i -e "s/R_HOME_DIR=.*$/R_HOME_DIR=\/usr\/lib\/R/" $PKG/usr/lib/R/bin/R ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) gzip -9 $PKG/usr/man/*/* chmod 755 $PKG/usr/bin/* mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $CWD mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a *.SlackBuild slack-desc $PKG/usr/doc/$NAME-$VERSION cd $PKG chown -R root:root . requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP/R-$VERSION rm -rf $PKG fi