2010-05-13 01:00:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for OfflineIMAP
|
2011-07-15 06:38:28 +02:00
|
|
|
# Home Page https://github.com/nicolas33/offlineimap
|
2010-05-13 01:00:10 +02:00
|
|
|
|
2011-12-17 17:38:15 +01:00
|
|
|
# Copyright (c) 2008-2011, Nishant Limbachia, Hoffman Estates, IL, USA
|
|
|
|
# <nishant _AT_ mnspace _DOT_ net>
|
2010-05-13 01:00:10 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of script must retain the above copyright notice,
|
|
|
|
# this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
|
|
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
|
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2011-12-17 17:38:15 +01:00
|
|
|
SRCNAM="nicolas33-offlineimap-v6.4.0-0-gc1120c9"
|
2011-07-15 06:38:28 +02:00
|
|
|
PRGNAM="offlineimap"
|
2011-12-17 17:38:15 +01:00
|
|
|
VERSION=${VERSION:-6.4.0}
|
2010-05-13 01:00:10 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2011-07-15 06:38:28 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-13 01:00:10 +02:00
|
|
|
|
2010-05-22 18:56:47 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2010-06-04 07:13:35 +02:00
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
2010-05-22 18:56:47 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 01:00:10 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
set -e # Exit on most errors
|
|
|
|
|
2011-12-17 17:38:15 +01:00
|
|
|
# In case the source was fetched with wget or some other downloader:
|
|
|
|
[ -e v${VERSION} ] && mv v${VERSION} $SRCNAM.tar.gz
|
|
|
|
|
2010-05-22 18:56:47 +02:00
|
|
|
rm -fr $TMP/$PRGNAM-$VERSION $PKG
|
2010-05-13 01:00:10 +02:00
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2011-07-15 06:38:28 +02:00
|
|
|
tar xvf $CWD/$SRCNAM.tar.gz
|
2011-12-17 17:38:15 +01:00
|
|
|
mv nicolas33-offlineimap-b1bff15 $PRGNAM-$VERSION
|
2010-05-22 18:56:47 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
2011-07-15 06:38:28 +02:00
|
|
|
|
2010-05-13 01:00:10 +02:00
|
|
|
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 {} \;
|
|
|
|
|
2011-10-08 15:23:18 +02:00
|
|
|
### Patch makefile to disable building dev docs
|
2011-12-17 17:38:15 +01:00
|
|
|
patch -p0 < $CWD/patches/Makefile.doc.patch
|
2011-10-08 15:23:18 +02:00
|
|
|
|
|
|
|
### build and install
|
2011-07-15 06:38:28 +02:00
|
|
|
python setup.py install --root=$PKG
|
2010-05-13 01:00:10 +02:00
|
|
|
|
2011-10-08 15:23:18 +02:00
|
|
|
### make and install docs
|
|
|
|
make doc
|
|
|
|
mkdir -p $PKG/usr/{man/man1,doc/$PRGNAM-$VERSION/html} $PKG/etc
|
|
|
|
|
|
|
|
### install config file
|
2010-05-13 01:00:10 +02:00
|
|
|
install -m 0644 -D $PRGNAM.conf $PKG/etc/$PRGNAM.conf.new
|
|
|
|
|
2011-10-08 15:23:18 +02:00
|
|
|
### make and install man page and html docs
|
|
|
|
( cd docs; make man && make html )
|
|
|
|
|
|
|
|
install -m 0644 docs/$PRGNAM.1 $PKG/usr/man/man1
|
2010-05-13 01:00:10 +02:00
|
|
|
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
|
|
|
|
|
|
|
|
cp -a \
|
2011-10-08 15:23:18 +02:00
|
|
|
COPYING COPYRIGHT $PRGNAM.conf* \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a readme.html docs/FAQ.html docs/INSTALL.html docs/MANUAL.html \
|
|
|
|
docs/UPGRADE.html $PKG/usr/doc/$PRGNAM-$VERSION/html
|
2010-05-13 01:00:10 +02:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|