aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xopenldap/openldap.SlackBuild53
1 files changed, 20 insertions, 33 deletions
diff --git a/openldap/openldap.SlackBuild b/openldap/openldap.SlackBuild
index 09771dc9..a3fc4ab0 100755
--- a/openldap/openldap.SlackBuild
+++ b/openldap/openldap.SlackBuild
@@ -1,16 +1,18 @@
#!/bin/bash
#
-# slackbuild script for clamav
+# slackbuild script for openldap
#
CWD="`pwd`"
# default settings
PACKAGE="openldap"
-_VERSION="2.3.24"
-_ARCH="x86_64"
-_BUILD="1rha"
-_TMP="/tmp"
+ARCH=${ARCH:=x86_64}
+VERSION=${VERSION:=2.3.24}
+BUILD=${BUILD:=1rha}
+SRC_DIR=${SRC:=$CWD}
+TMP=${TMP:=/tmp}
+REPOS=${REPOS:=$TMP}
if [ -f "/etc/slackbuildrc" ]; then
source /etc/slackbuildrc
@@ -20,34 +22,12 @@ if [ -f "~/.slackbuildrc" ]; then
source ~/.slackbuildrc
fi
-if [ -z "$VERSION" ]; then
- VERSION="$_VERSION"
-fi
-
-if [ -z "$ARCH" ]; then
- ARCH="$_ARCH"
-fi
-
-if [ -z "$BUILD" ]; then
- BUILD="$_BUILD"
-fi
-
if [ "$ARCH" == "x86_64" ]; then
LIBDIR=/usr/lib64
else
LIBDIR=/usr/lib
fi
-if [ -z "$SRC" ]; then
- SRC_DIR="$CWD"
-else
- SRC_DIR="$SRC"
-fi
-
-if [ -z "$TMP" ]; then
- TMP="$_TMP"
-fi
-
RTOOL="wget"
PACKAGE_EXT="tgz"
SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT"
@@ -61,6 +41,9 @@ else
tarflag="z"
fi
+SRC_DIR="$SRC_DIR/$PACKAGE"
+mkdir -p $SRC_DIR
+
if [ "$RTOOL" == "wget" ] && [ ! -f "$SRC_DIR/$SRC" ]; then
wget "$URL" -O "$SRC_DIR/$SRC"
fi
@@ -71,10 +54,10 @@ else
LIBDIR="/usr/lib"
fi
+TMP="$TMP/$PACKAGE"
+rm -rf $TMP
+mkdir -p $TMP
cd $TMP
-rm -rf package-$PACKAGE
-mkdir package-$PACKAGE
-cd package-$PACKAGE
tar xvf$tarflag $SRC_DIR/$SRC
cd $PACKAGE-$VERSION
@@ -90,7 +73,7 @@ ln -sf /usr/include/db4/db.h /usr/include/db.h
./configure --prefix=/usr --sysconfdir=/etc --libdir=$LIBDIR
make depend
make
-make DESTDIR=$TMP/package-$PACKAGE/$PACKAGE install
+make DESTDIR=$TMP/package-$PACKAGE install
# fix your system
if [ ! -f "$DBINC" ]; then
@@ -101,7 +84,7 @@ fi
CWD="`pwd`"
-cd $TMP/package-$PACKAGE/$PACKAGE
+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
@@ -144,5 +127,9 @@ done
echo '( if [ ! -f "etc/openldap/ldap.conf" ]; then mv etc/openldap/ldap.conf.new etc/openldap/ldap.conf; fi )' > install/doinst.sh
echo '( if [ ! -f "etc/openldap/slapd.conf" ]; then mv etc/openldap/slapd.conf.new etc/openldap/slapd.conf; fi )' >> install/doinst.sh
-makepkg -c y -l y $TMP/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+makepkg -c y -l y $REPOS/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
+
+if [ "$CLEANUP" == "yes" ]; then
+ rm -rf $TMP
+fi