diff options
Diffstat (limited to 'net/mail')
-rw-r--r-- | net/mail/dovecot/Manifest | 23 | ||||
-rwxr-xr-x | net/mail/dovecot/dovecot.SlackBuild | 262 |
2 files changed, 195 insertions, 90 deletions
diff --git a/net/mail/dovecot/Manifest b/net/mail/dovecot/Manifest new file mode 100644 index 00000000..f487c787 --- /dev/null +++ b/net/mail/dovecot/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST dovecot-1.1.14.tar.gz 2372939 MD5 60b1deccc0ae77e5669060d2b1894e5e RMD160 c39ab75125a224492f36deaada4c8ab73d51db21 SHA1 a508e6cb69710e5f7fe40ef2559d370678352ad5 SHA256 95aa89b65fd89a42484850bbd33d463601039eea21107febc15175d4f3652c4c SHA512 fb266b1bc07599e02d8d7bebb0c4799fa5289e27a47f383a5a42da68e692cd2f93e815859d0c95687b40789d2ab9f0ac3884da9d2678c38869e54bc7e4ba47a4 +MKBUILD dovecot.mkbuild 5117 MD5 18c35c32836866a3fdcf2570fe949696 RMD160 d5591f9fe09b536f49926bca8120dd1445e7e8eb SHA1 904e9c0df1e724c0c02571959934fa447d7be922 SHA256 d79d53788535943d64b289278f4baa0ac9bbf4915ba204301189eed771698723 SHA512 ca72b859ffa9ca07332bcaa4fe1133824059d21a6a67c9ee0399e98b9766c65adecd549a32606006d6eef2eb47a8ed9e97d29731ed38cb98f6b60934a85d7922 +SLACKBUILD dovecot.SlackBuild 7086 MD5 fb5f8d0e5cd67796048ca2f704171941 RMD160 ddca1628208cb8d7a2641e7229000c7aefe77d72 SHA1 18e852ee1e0b1202fd941e7c8618dd0e102ea22f SHA256 2e5c86635e1c08ac9805543ca251ee6bdff2d63508b5c00c4ce4902f9cc76238 SHA512 e686c2e6fbe33337f769da44ce9ffa51ff5b4c9d700cb4a85c285643cd189d67b8db40709013be4109715df3c08d2ff77b46bd05cb2e67ca0ecb2e6a06511db0 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIbBAEBAgAGBQJJ82ivAAoJEEHL93ESzgeiM2EP9jHlRigPlE7wCN/a0t4vTb5l +v6NanUioUXJD1WcIsfIi6hZNNZM+UyJwGAZFu2LG7m2PTdB8cdumXAcPi8CaQJnk +2LN3McL9gE75gHJ3yMh5w/acJDwxSEbJQQUeiuXbn8FrwJLRm3/jVcrUZQfLg7gG +JB1NTPTETEU9z7YLPhEPOWHF4SIBYp6YeZYkkoJe2YhhrnTRYb1y8y2MuF5jbbzW +TGKCmz++Nur4SJX2X8ZZBk4qgYckUb5QNM+GtWYK1tkFROndOQpUnC7u0rmCO/aI +3d+kSW4Pk9tIyGPD5a6g7HGE+29x7mjTo6+pwf5qlU3w7A2pDPENHjLBLte/tfKF +pf7T2XYLQhKV6JV0XsAYf67yYKuugOIufRq9OvA4fwfvvcaX1PkTd3v5+H15PwxO +wj293qK6l3KGN9jDA/xNs9m10MR/Pt7KqQOHV8heqe2ZebihEDFkxC6vDi4C9MF5 +uWXSnS67si43c/EIETOeVd8TiLb7YNo0ezw+H8KmeyQj4d/k6/vKSDuvvwUg+ho+ +vmJfXNXHcpwN1/T7B4Q4cixCeAvjoPvkJLMiMd3g5maoDs/Z3rT73UoN+V2YWTRC +CksfpnDVQoncgwAmWhs9wz+Qmshx0ELNiWvCjtEc2bDeSBTBPss7KoS1QSsGvM6w +MOkkMaVmaK8uczC0lXI= +=iwrt +-----END PGP SIGNATURE----- diff --git a/net/mail/dovecot/dovecot.SlackBuild b/net/mail/dovecot/dovecot.SlackBuild index 38d47962..e4e36e15 100755 --- a/net/mail/dovecot/dovecot.SlackBuild +++ b/net/mail/dovecot/dovecot.SlackBuild @@ -1,116 +1,204 @@ #!/bin/bash # -# dovecot.SlackBuild is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or any later version. +# dovecot.SlackBuild is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the License, +# or any later version. # -# dovecot.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# dovecot.SlackBuild is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # -# slackbuild script for dovecot -# by rhatto at riseup.net +# slackbuild for dovecot, by Silvio Rhatto +# requires: +# tested: dovecot-1.1.14 +# model: generic.mkSlackBuild $Rev: 805 $ # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building dovecot 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`" - +# Look for slackbuildrc if [ -f ~/.slackbuildrc ]; then source ~/.slackbuildrc elif [ -f /etc/slackbuildrc ]; then source /etc/slackbuildrc fi -# default settings -PACKAGE="dovecot" +# Set variables +CWD="$(pwd)" +SRC_NAME="dovecot" +PKG_NAME="dovecot" ARCH=${ARCH:=i486} -VERSION=${VERSION:=1.0.13} -BUILD=${BUILD:=2rha} -SRC_DIR=${SRC:=$CWD} +SRC_VERSION=${VERSION:=1.1.14} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} - -if [ "$ARCH" == "x86_64" ]; then - export LDFLAGS="-L/lib64 -L/usr/lib64" - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib +SLACKBUILD_PATH=${SLACKBUILD_PATH:="net/mail/dovecot"} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --with-mysql"} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mtune=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" fi -# ------- error codes for createpkg -------------- +# Set error codes (used by 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 +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 +ERROR_MANIFEST=43; -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -URL="http://www.dovecot.org/releases/1.0/$SRC" +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR +# Create directories if necessary +mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR +mkdir -p "$PKG" || exit $ERROR_MKDIR +mkdir -p "$REPOS" || exit $ERROR_MKDIR +mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR -if [ "$RTOOL" == "wget" ]; then - if [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET - fi - if [ ! -f "$SRC_DIR/$SRC.sig" ]; then - wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" || exit $ERROR_WGET - fi +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" +URL="http://www.dovecot.org/releases/1.1/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -gpg --keyserver wwwkeys.pgp.net --recv-keys 40558AC9 -gpg --verify $SRC_DIR/$SRC.sig $SRC_DIR/$SRC || exit $ERROR_GPG +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then -TMP="$TMP/$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP + # Manifest signature checking + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then + echo "Checking Manifest signature..." + gpg --verify $CWD/Manifest + if [ "$?" != "0" ]; then + exit $ERROR_MANIFEST + fi + fi -tar xvf $SRC_DIR/$SRC || exit $ERROR_TAR -cd $PACKAGE-$VERSION + MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`" + + for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do + + MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`" + MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`" + MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`" + + if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then + MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE" + else + MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`" + fi + + if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then + continue + fi + + echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..." + + SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`" + SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`" + + # Check source code size + if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then + echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC" + exit $ERROR_MANIFEST + else + echo "Size match." + fi + + # Check source code integrity + for ALGO in md5 rmd160 sha1 sha256 sha512; do + if [ $ALGO = "rmd160" ]; then + ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`" + else + ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`" + fi + ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`" + ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }') + if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then + echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC" + exit $ERROR_MANIFEST + else + echo "$ALGO match." + fi + done + + done -if [ -f "$CWD/$PACKAGE-$VERSION.diff" ]; then - patch -p1 < $CWD/$PACKAGE-$VERSION.diff || exit $ERROR_PATCH +else + exit $ERROR_MANIFEST fi -./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR --with-mysql || 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 +# Untar +cd "$PKG_WORK" +tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" +cd "$PKG_SRC" + +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# 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 +) + +# Install documentation +DOCS="AUTHORS COPYING COPYING.LGPL COPYING.MIT NEWS README TODO" +mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR +for doc in $DOCS; do + if [ -f "$doc" ]; then + cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" + fi +done -mkdir install -cat << EOF > install/slack-desc +# Add package description (slack-desc) +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +cat << EODESC > "$PKG/install/slack-desc" # HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. Line +# 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 +# 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-----------------------------------------------------| + |-----handy-ruler------------------------------------------------------| dovecot: dovecot dovecot: dovecot: Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like @@ -122,20 +210,14 @@ dovecot: dovecot: dovecot: dovecot: -EOF +EODESC -# docs -mkdir -p usr/doc/$PACKAGE-$VERSION +# Build the package +cd "$PKG" +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG -DOCS="AUTHORS COPYING COPYING.LGPL COPYING.MIT NEWS README TODO" - -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 +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" fi - |