#!/bin/sh # Set initial variables: set -e CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi VERSION=2.2.0 ARCH=${ARCH:-x86_64} BUILD=${BUILD:-1} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" fi PKG=$TMP/package-mpfr rm -rf $PKG mkdir -p $PKG # Determine patchlevel: PATCHLEVEL=$(/bin/ls $CWD/patches/* 2> /dev/null | rev | cut -f 1 -d / | cut -b4- | rev | cut -b6- | tail -n 1 ) if [ "$PATCHLEVEL" = "" ]; then PATCHLEVEL=0 fi cd $TMP rm -rf mpfr-$VERSION tar xjvf $CWD/mpfr-$VERSION.tar.bz2 cd mpfr-$VERSION chown -R root:root . for file in $CWD/patches/* ; do ( zcat $file 2> /dev/null | patch -p1 --verbose --batch || exit 1 ) if [ ! $? = 0 ]; then exit 1 fi done LDFLAGS="-L/usr/lib64" \ CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --enable-static=yes \ --enable-shared=yes \ --libdir=/usr/lib64 \ $ARCH-slackware-linux make -j30 make install DESTDIR=$PKG ( 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 ) # Hardly a savings doing this... #strip -g $PKG/usr/lib/*.a rm -f $PKG/usr/info/dir gzip -9 $PKG/usr/info/* mkdir -p $PKG/usr/doc/mpfr-$VERSION cp -a \ AUTHORS BUGS COPYING COPYING.LIB FAQ.html INSTALL NEWS README TODO VERSION \ $PKG/usr/doc/mpfr-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG if [ -d usr/lib64/pkgconfig ]; then mkdir -p usr/lib; mv usr/lib64/pkgconfig usr/lib fi makepkg -l y -c n $TMP/mpfr-${VERSION}p${PATCHLEVEL}-${ARCH}-${BUILD}.tgz