diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-04-23 01:23:12 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2008-04-23 01:23:12 +0000 |
commit | 1262be701e299e12fca8ee67a38c9cc9eb98536b (patch) | |
tree | 934815a762cdcafc1828a137a5e3be6131380b81 /dev | |
parent | e65248d2f3d91fa297489d0d5959874813ad850c (diff) | |
download | slackbuilds-1262be701e299e12fca8ee67a38c9cc9eb98536b.tar.gz slackbuilds-1262be701e299e12fca8ee67a38c9cc9eb98536b.tar.bz2 |
cyrus-sasl: rebuilt from mkbuild
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1732 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'dev')
-rwxr-xr-x | dev/libs/cyrus-sasl/cyrus-sasl.SlackBuild | 316 | ||||
-rw-r--r-- | dev/libs/cyrus-sasl/doinst.sh | 18 | ||||
-rw-r--r-- | dev/libs/cyrus-sasl/slack-desc | 6 |
3 files changed, 200 insertions, 140 deletions
diff --git a/dev/libs/cyrus-sasl/cyrus-sasl.SlackBuild b/dev/libs/cyrus-sasl/cyrus-sasl.SlackBuild index 56eef388..a70a2b29 100755 --- a/dev/libs/cyrus-sasl/cyrus-sasl.SlackBuild +++ b/dev/libs/cyrus-sasl/cyrus-sasl.SlackBuild @@ -1,155 +1,239 @@ #!/bin/bash # -# SlackBuild for Cyrus-SASL-ldap +# cyrus-sasl.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. # -################################## -## Creator: Stefano Stabellini ## -## stefano@stabellini.net ## -## http://www.stabellini.net ## -################################## +# cyrus-sasl.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. # -# small changes by rhatto +# 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 for cyrus-sasl, by Silvio Rhatto +# requires: +# tested: cyrus-sasl-2.1.22 # -if [ -s "slack-required" ]; then - echo Recomended and required packages for building cyrus-sasl 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 -PACKAGE="cyrus-sasl" -VERSION=${VERSION:=2.1.22} +# Set variables +CWD="$(pwd)" +SRC_NAME="cyrus-sasl" +PKG_NAME="cyrus-sasl" ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=2.1.22} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME TMP=${TMP:=/tmp} -SRC_DIR=${SRC:=$CWD} +PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:="--sysconfdir=/etc --with-authdaemond=/usr/sbin/authdaemond"} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=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" +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 -if [ "$ARCH" == "x86_64" ]; then - LIBDIR=/usr/lib64 -else - LIBDIR=/usr/lib -fi +# Clean up any leftovers of previous builds +rm -rf "$PKG_WORK" 2> /dev/null +rm -rf "$PKG" 2> /dev/null -RTOOL="wget" -PACKAGE_EXT="gz" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" -KEY="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/KEYS" -SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" +# 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 + +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" URL="ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/$SRC" -if [ ! -d $TMP ]; then - mkdir -p $TMP # location to build the source +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi -SRC_DIR="$SRC_DIR/$PACKAGE" -mkdir -p $SRC_DIR - -if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then - wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET - wget "$URL.sig" -O "$SRC_DIR/$SRC.sig" || exit $ERROR_WGET +# Import minimized signing key from +if echo ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/KEYS | grep -q -v "SIGNING KEY URL"; then + lynx -dump ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/KEYS | gpg --import || exit $ERROR_GPG +elif echo [[SIGNING KEY ID]] | grep -q -v "SIGNING KEY ID"; then + gpg --recv-keys [[SIGNING KEY ID]] || exit $ERROR_GPG +else + gpg --import << EOKEY || exit $ERROR_GPG +[[SIGNING KEY]] +EOKEY fi -if [ ! -f "$SRC_DIR/$PACKAGE-key.asc" ]; then - wget "$KEY" -O "$SRC_DIR/$PACKAGE-key.asc" && gpg --import $SRC_DIR/$PACKAGE-key.asc || exit $ERROR_WGET +# Download source's signature if necessary and check it +if echo [[SIGNING URL]] | grep -q -v "SIGNING URL"; then + SIGNATURE="`basename [[SIGNING URL]]`" + if [ ! -s "$SRC_DIR/$SIGNATURE" ]; then + wget "[[SIGNING URL]]" -O "$SRC_DIR/$SIGNATURE" || exit $ERROR_WGET + fi +else + if [ -s "$SRC_DIR/$SRC.sig" ]; then + SIGNATURE="$SRC.sig" + elif [ -s "$SRC_DIR/$SRC.asc" ]; then + SIGNATURE="$SRC.asc" + else + echo Trying to get signature file from $URL.sig... + if wget "$URL.sig" -O "$SRC_DIR/$SRC.sig"; then + SIGNATURE="$SRC.sig" + else + rm $SRC_DIR/$SRC.sig + echo Trying to get signature file from $URL.asc... + if wget "$URL.asc" -O "$SRC_DIR/$SRC.asc"; then + SIGNATURE="$SRC.asc" + else + rm $SRC_DIR/$SRC.asc + echo "Error getting source's signature file" + exit $ERROR_GPG + fi + fi + fi fi -gpg --verify $SRC_DIR/$SRC.sig $SRC_DIR/$SRC || exit $ERROR_GPG -sleep 3 +echo Checking $SRC_DIR/$SRC with gpg using $SRC_DIR/$SIGNATURE... +gpg --verify "$SRC_DIR/$SIGNATURE" "$SRC_DIR/$SRC" || exit $ERROR_GPG +echo Success. -if [ "$ARCH" = "i386" ]; then - SLKCFLAGS="-O2 -march=i386 -mcpu=i686" -elif [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mcpu=i686" -elif [ "$ARCH" = "s390" ]; then - SLKCFLAGS="-O2" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2" -fi +# 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 $8 }'`" +cd "$PKG_SRC" -TMP="$TMP/$PACKAGE" -PKG="$TMP/package-$PACKAGE" -rm -rf $TMP -mkdir -p $TMP -cd $TMP - -mkdir -p $PKG/var/state/saslauthd -echo "+=====================+" -echo "| cyrus-sasl-$VERSION |" -echo "+=====================+" -cd $TMP -rm -rf cyrus-sasl-$VERSION -tar xvf $SRC_DIR/cyrus-sasl-$VERSION.tar.gz || exit $ERROR_TAR -cd cyrus-sasl-$VERSION -chown -R root.root . -find . -perm 777 -exec chmod 755 {} \; -find . -perm 775 -exec chmod 755 {} \; -find . -perm 700 -exec chmod 755 {} \; -find . -perm 744 -exec chmod 755 {} \; -find . -perm 666 -exec chmod 644 {} \; -find . -perm 664 -exec chmod 644 {} \; -find . -perm 600 -exec chmod 644 {} \; +# Configure CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -#./configure --enable-login --enable-plain --enable-anon --enable-digest --with-static-sasl --with-bdb-libdir=/usr/lib \ -# --with-bdb-incdir=/usr/include/db4 --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --enable-ldap \ -# --with-ldap=/usr/libexec/openldap --with-authdaemond=/usr/sbin/authdaemond -./configure --prefix=/usr --sysconfdir=/etc --with-authdaemond=/usr/sbin/authdaemond --libdir=$LIBDIR || exit $ERROR_CONF -make || exit $ERROR_MAKE -make install DESTDIR=$PKG || exit $ERROR_INSTALL -strip $PKG/usr/sbin/* -chown -R root.bin $PKG/usr/bin -chown -R root.bin $PKG/usr/sbin -gzip -9 $PKG/usr/man/man3/* -gzip -9 $PKG/usr/man/cat8/* -gzip -9 $PKG/usr/man/man8/* -mkdir -p $PKG/usr/doc/cyrus-sasl-$VERSION -cp AUTHORS $PKG/usr/doc/cyrus-sasl-$VERSION -cp COPYRIGHT $PKG/usr/doc/cyrus-sasl-$VERSION -cp LICENSE $PKG/usr/doc/cyrus-sasl-$VERSION -cp HISTORY $PKG/usr/doc/cyrus-sasl-$VERSION -cp doc/* $PKG/usr/doc/cyrus-sasl-$VERSION -cp ChangeLog $PKG/usr/doc/cyrus-sasl-$VERSION -cp NEWS $PKG/usr/doc/cyrus-sasl-$VERSION -cp README $PKG/usr/doc/cyrus-sasl-$VERSION -cp INSTALL $PKG/usr/doc/cyrus-sasl-$VERSION -cp README $PKG/usr/doc/cyrus-sasl-$VERSION + 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 +) + +# Copy init scripts mkdir -p $PKG/etc/rc.d -cat $CWD/rc.saslauthd.new > $PKG/etc/rc.d/rc.saslauthd.new -mkdir -p $PKG/install -cat $CWD/doinst.sh > $PKG/install/doinst.sh -cat $CWD/slack-desc > $PKG/install/slack-desc -#cat $CWD/slack-conflicts > $PKG/install/slack-conflicts -#cat $CWD/slack-required > $PKG/install/slack-required -#requiredbuilder $PKG -cd $PKG +cp $CWD/rc.* $PKG/etc/rc.d/ + +# Install documentation +DOCS="AUTHORS COPYRIGHT LICENSE HISTORY doc/* ChangeLog NEWS README" +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 + +# 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 +# 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---------------------------------------------------| +cyrus-sasl-ldap: Cyrus-SASL +cyrus-sasl-ldap: +cyrus-sasl-ldap: Cyrus-SASL is a library that implements the SASL athentication +cyrus-sasl-ldap: method. This build supports LDAP (needs openldap). +cyrus-sasl-ldap: +cyrus-sasl-ldap: +cyrus-sasl-ldap: +cyrus-sasl-ldap: +cyrus-sasl-ldap: +cyrus-sasl-ldap: +cyrus-sasl-ldap: +EODESC + +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +mkgroup() { + GROUP="\$1" + if ! grep -qe "^\$GROUP:" etc/group; then + echo Creating group \$GROUP... + chroot . /usr/sbin/groupadd \$GROUP + fi +} + +mkuser() { + USER="\$1" + if [ ! -z "\$2" ]; then + GROUP="\$2" + else + GROUP="\$USER" + fi + if ! grep -qe "^\$USER:" etc/passwd; then + echo Creating user \$USER... + chroot . /usr/sbin/useradd \$USER -g \$GROUP + fi +} -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 +config etc/rc.d/rc.saslauthd.new +EOSCRIPT -makepkg -l y -c n $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz || exit $ERROR_MKPKG +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG +# Delete source and build directories if requested if [ "$CLEANUP" == "yes" ]; then - rm -rf $TMP + rm -rf "$PKG_WORK" "$PKG" fi - diff --git a/dev/libs/cyrus-sasl/doinst.sh b/dev/libs/cyrus-sasl/doinst.sh deleted file mode 100644 index d2810248..00000000 --- a/dev/libs/cyrus-sasl/doinst.sh +++ /dev/null @@ -1,18 +0,0 @@ -## Slackware install script for cyrus-sasl-mysql -## 20050920 Stefano Stabellini -# - -config() { - NEW="$1" - OLD="`dirname $NEW`/`basename $NEW .new`" - # If there's no config file by that name, mv it over: - if [ ! -r $OLD ]; then - mv $NEW $OLD - elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then - # toss the redundant copy - rm $NEW - fi - # Otherwise, we leave the .new copy for the admin to consider... -} - -config etc/rc.d/rc.saslauthd.new diff --git a/dev/libs/cyrus-sasl/slack-desc b/dev/libs/cyrus-sasl/slack-desc deleted file mode 100644 index 17ee2615..00000000 --- a/dev/libs/cyrus-sasl/slack-desc +++ /dev/null @@ -1,6 +0,0 @@ -cyrus-sasl-ldap: Cyrus-SASL -cyrus-sasl-ldap: -cyrus-sasl-ldap: Cyrus-SASL is a library that implements the SASL athentication -cyrus-sasl-ldap: method. This build supports LDAP (needs openldap). -cyrus-sasl-ldap: -cyrus-sasl-ldap: |