2011-09-03 03:19:20 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for primer3
|
2011-11-08 01:39:00 +01:00
|
|
|
# Written by Petar Petrov, <ppetrov@paju.oulu.fi> and
|
2011-09-03 03:19:20 +02:00
|
|
|
# hereby submitted to the public domain
|
|
|
|
|
2011-11-08 01:39:00 +01:00
|
|
|
# Thanks to Niels Horn for correcting the CFLAGS.
|
|
|
|
|
|
|
|
# THIS SLACKBUILD IS DISTRIBUTETD IN THE HOPE OF BEING
|
|
|
|
# USEFUL BUT WITHOUT ANY WARRANTY. THE AUTHOR IS _NOT_
|
2011-09-03 03:19:20 +02:00
|
|
|
# RESPONSIBLE FOR ANY DAMAGE OR DATA LOSS CAUSED BY IT.
|
|
|
|
|
2011-11-08 01:39:00 +01:00
|
|
|
PRGNAM=primer3
|
2011-09-03 03:19:20 +02:00
|
|
|
VERSION=${VERSION:-2.2.3}
|
2011-11-08 01:39:00 +01:00
|
|
|
BUILD=${BUILD:-2}
|
|
|
|
TAG=${TAG:-_SBo}
|
2011-09-03 03:19:20 +02:00
|
|
|
|
|
|
|
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}
|
|
|
|
|
|
|
|
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-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
|
|
|
cd ./src
|
|
|
|
|
|
|
|
#Use our CFLAGS
|
|
|
|
sed -i "/^CFLAGS/s/=/+=/" Makefile
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2011-11-08 01:39:00 +01:00
|
|
|
make
|
2011-09-03 03:19:20 +02:00
|
|
|
|
2011-11-08 01:39:00 +01:00
|
|
|
# This is recommended, but the tests take a really long time.
|
2011-09-03 03:19:20 +02:00
|
|
|
# Be patient if you uncomment the next line.
|
|
|
|
# make test
|
|
|
|
|
|
|
|
install -D -m755 primer3_core $PKG/usr/bin/primer3_core
|
|
|
|
install -D -m755 long_seq_tm_test $PKG/usr/bin/long_seq_tm_test
|
|
|
|
install -D -m755 ntdpal $PKG/usr/bin/ntdpal
|
|
|
|
install -D -m755 ntthal $PKG/usr/bin/ntthal
|
|
|
|
install -D -m755 oligotm $PKG/usr/bin/oligotm
|
|
|
|
|
2011-11-08 01:39:00 +01:00
|
|
|
# eprimer32 from EMBOSS expects the binary to be called primer32_core
|
|
|
|
ln -s primer3_core $PKG/usr/bin/primer32_core
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
2011-09-03 03:19:20 +02:00
|
|
|
|
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
2011-11-08 01:39:00 +01:00
|
|
|
src/release_notes.txt COPYING.txt example primer3_manual.htm \
|
2011-09-03 03:19:20 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
cat $CWD/References > $PKG/usr/doc/$PRGNAM-$VERSION/References
|
|
|
|
|
|
|
|
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}
|