diff options
-rwxr-xr-x | mairix/mairix.SlackBuild | 210 |
1 files changed, 210 insertions, 0 deletions
diff --git a/mairix/mairix.SlackBuild b/mairix/mairix.SlackBuild new file mode 100755 index 00000000..19c08d3b --- /dev/null +++ b/mairix/mairix.SlackBuild @@ -0,0 +1,210 @@ +#!/bin/bash +# +# slackbuild script for mairix +# by rhatto at riseup.net +# + +if [ -s "slack-required" ]; then + echo Recomended and required packages for building mairix are: + cat slack-required | sed -e 's/^/\t/' + if [ "$INTERACT" != "no" ]; then + echo If you dont have those installed, press Ctrl-C. Otherwise, hit ENTER. + read crap + else + echo Sleeping 3 seconds... + sleep 3 + fi +fi + +CWD="`pwd`" + +if [ -f "/etc/slackbuildrc" ]; then + source /etc/slackbuildrc +fi + +if [ -f "~/.slackbuildrc" ]; then + source ~/.slackbuildrc +fi + +# default settings +PACKAGE="mairix" +ARCH=${ARCH:=i486} +VERSION=${VERSION:=0.19} +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC:=$CWD} +TMP=${TMP:=/tmp} +REPOS=${REPOS:=$TMP} + +if [ "$ARCH" == "x86_64" ]; then + export LDFLAGS="-L/lib64 -L/usr/lib64" + LIBDIR=/usr/lib64 +else + LIBDIR=/usr/lib +fi + +# ------- error codes for createpkg -------------- +ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 +ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 +ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 +ERROR_PATCH=40 + +RTOOL="wget" +PACKAGE_EXT="gz" +SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" +URL="http://easynews.dl.sourceforge.net/sourceforge/mairix/$SRC" +SIG="$PACKAGE-$VERSION-tar-gz-asc.txt" +SIG_URL="http://www.rpcurnow.force9.co.uk/mairix/$SIG" + +gpg --import << EOF +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.3 (GNU/Linux) + +mQGiBDls5WERBADcHuihXLXH2eOkQ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lwq+xwEQi/M1fqebous++ay3y/tS3x2t+4O4J9hgiezP +Iof3RlN+IjVrQ0gSZMnLew3+UEI5k+G9/fS5ar6ITgQYEQIABgUCOWznKAASCRAg +Cd96p9M97AdlR1BHAAEBNIYAn0tlnu/LIRZGV/gTfFBbED5VDF2vAKCllpFbtTd4 +iyEQhSCBS+wk6SoOgg== +=yT3y +-----END PGP PUBLIC KEY BLOCK----- +EOF + +SRC_DIR="$SRC_DIR/$PACKAGE" +mkdir -p $SRC_DIR + +if [ "$RTOOL" == "wget" ]; then + if [ ! -f "$SRC_DIR/$SRC" ]; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET + fi + if [ ! -f "$SRC_DIR/$SIG" ]; then + wget "$SIG_URL" -O "$SRC_DIR/$SIG" || exit $ERROR_WGET + fi +fi + +gpg --verify $SRC_DIR/$SIG $SRC_DIR/$SRC || exit $ERROR_GPG + +TMP="$TMP/$PACKAGE" +rm -rf $TMP +mkdir -p $TMP +cd $TMP + +tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR +cd $PACKAGE-$VERSION + +if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then + patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH +fi + +./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR || exit $ERROR_CONF +make || exit $ERROR_MAKE +make DESTDIR=$TMP/package-$PACKAGE install || exit $ERROR_INSTALL + +CWD="`pwd`" + +cd $TMP/package-$PACKAGE + +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 + +mkdir install +cat << EOF > install/slack-desc +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-----------------------------------------------------| +mairix: mairix (index and search engine for mail folders) +mairix: +mairix: Mairix is a program for indexing and searching email messages stored +mairix: in Maildir, MH or mbox folders. +mairix: +mairix: +mairix: +mairix: +mairix: +mairix: +mairix: +EOF + +# docs +mkdir -p usr/doc/$PACKAGE-$VERSION + +DOCS="ACKNOWLEDGEMENTS COPYING INSTALL NEWS README" + +for file in $DOCS; do + cp $CWD/$file* usr/doc/$PACKAGE-$VERSION/ +done + +makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG + +if [ "$CLEANUP" == "yes" ]; then + rm -rf $TMP +fi + |