summaryrefslogtreecommitdiff
path: root/source/n/mutt/mutt.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/mutt/mutt.SlackBuild')
-rwxr-xr-xsource/n/mutt/mutt.SlackBuild105
1 files changed, 72 insertions, 33 deletions
diff --git a/source/n/mutt/mutt.SlackBuild b/source/n/mutt/mutt.SlackBuild
index e9ca3275..3de6e307 100755
--- a/source/n/mutt/mutt.SlackBuild
+++ b/source/n/mutt/mutt.SlackBuild
@@ -1,6 +1,5 @@
#!/bin/sh
-
-# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2002-2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,47 +19,64 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+PKGNAM=mutt
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
-VERSION=1.4.2.3
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-2}
-
+TMP=${TMP:-/tmp}
+CWD=`pwd`
NUMJOBS=${NUMJOBS:-" -j7 "}
-if [ "$ARCH" = "i486" ]; then
+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"
+else
+ SLKCFLAGS="-O2"
fi
-CWD=$(pwd)
-TMP=${TMP:-/tmp}
PKG=$TMP/package-mutt
rm -rf $PKG
-mkdir -p $TMP $PKG
+mkdir $PKG
cd $TMP
-rm -rf $(basename mutt-$VERSION i)
-tar xvf $CWD/mutt-$VERSION.tar.bz2 || exit 1
-cd $(basename mutt-$VERSION i) || exit 1
-
+rm -rf mutt-$VERSION
+tar xvf $CWD/mutt-$VERSION.tar.?z* || exit 1
+cd mutt-$VERSION || exit 1
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 {} \;
+
+# "error creating gpgme context: Not operational?" bugfix
+# http://dev.mutt.org/trac/ticket/3300
+zcat $CWD/mutt.gpgme.diff.gz | patch -p1 --verbose || exit 1
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--mandir=/usr/man \
+ --docdir=/usr/doc/mutt-$VERSION \
+ --with-docdir=/usr/doc/mutt-$VERSION \
--sysconfdir=/etc/mutt \
--with-mailpath=/var/spool/mail \
--enable-pop \
--enable-imap \
--with-ssl \
+ --with-sasl \
+ --enable-smtp \
+ --enable-gpgme \
+ --enable-hcache \
--enable-locales-fix \
--without-wc-funcs \
--build=$ARCH-slackware-linux
@@ -68,26 +84,49 @@ CFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
-find $PKG | xargs file | grep -e "executable" -e "shared object" \
- | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+# Strip binaries:
+( 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
+)
+
+# Compress and link manpages, if any:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
-gzip -9 $PKG/usr/man/man?/*
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
-# Don't mv the mutt docs directory, because mutt uses 'em.
-# Make a link instead.
-( cd $PKG/usr/doc ; rm -rf mutt-$VERSION ; ln -sf mutt mutt-$VERSION )
# This stuff is redundant or not useful to most people, IMHO.
# If you want it, use the source, Luke.
-rm -rf \
- $PKG/usr/doc/mutt/html \
- $PKG/usr/doc/mutt/ChangeLog
+rm -f $PKG/usr/doc/mutt-$VERSION/*.html
+rm -f $PKG/etc/mutt/*.dist
+
+# This is an ancient artifact
+rm -f $PKG/usr/doc/mutt-$VERSION/samples/ca-bundle.crt
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
mv $PKG/etc/mutt/Muttrc $PKG/etc/mutt/Muttrc.new
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
-
cd $PKG
-/sbin/makepkg -l y -c n $TMP/mutt-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n ../mutt-$VERSION-$ARCH-$BUILD.txz