slackbuilds_ponce/libraries/libvmime/libvmime.SlackBuild
2010-05-13 00:58:59 +02:00

73 lines
1.8 KiB
Bash

#!/bin/sh
# Slackware build script for libvmime:
# a library for working with MIME messages
# Written by Niels Horn - niels.horn@gmail.com
# revision date 2009/12/17
PRGNAM=libvmime
VERSION=0.9.0
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
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"
fi
set -e
rm -rf $TMP/$PRGNAM-$VERSION $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
# Patch "configure" to accept gnutls-2.8 (Security patch in Slackware 13.0)
# (Based on: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529834)
patch -p1 < $CWD/gnutls-28.patch
# Force "configure" to respect our CFLAGS / CXXFLAGS
patch -p1 < $CWD/flags.patch
CFLAGS=$SLKCFLAGS \
CXXFLAGS=$SLKCFLAGS \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--mandir=/usr/man \
--build=$ARCH-slackware-linux
make docdir=/usr/doc/$PRGNAM-$VERSION
make docdir=/usr/doc/$PRGNAM-$VERSION install DESTDIR=$PKG
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
xargs strip --strip-unneeded 2> /dev/null || true
)
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}