summaryrefslogtreecommitdiff
path: root/source/a/logrotate/logrotate.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/logrotate/logrotate.SlackBuild')
-rwxr-xr-xsource/a/logrotate/logrotate.SlackBuild73
1 files changed, 54 insertions, 19 deletions
diff --git a/source/a/logrotate/logrotate.SlackBuild b/source/a/logrotate/logrotate.SlackBuild
index 6b6284b7..76cc34ab 100755
--- a/source/a/logrotate/logrotate.SlackBuild
+++ b/source/a/logrotate/logrotate.SlackBuild
@@ -20,25 +20,42 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-VERSION=${VERSION:-3.7.4}
-ARCH=${ARCH:-x86_64}
+VERSION=${VERSION:-3.7.8}
BUILD=${BUILD:-1}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-logrotate
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG
-
-# Explode the package framework:
-cd $PKG
-explodepkg $CWD/_logrotate.tar.gz
-
cd $TMP
rm -rf logrotate-$VERSION
-tar xzvf $CWD/logrotate-$VERSION.tar.gz
+tar xvf $CWD/logrotate-$VERSION.tar.?z* || exit 1
cd logrotate-$VERSION
chown -R root:root .
find . \
@@ -47,25 +64,43 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-zcat $CWD/logrotate.slackware.diff.gz | patch -p1
+# Fixup a few things:
+zcat $CWD/logrotate.slackware.diff.gz | patch -p1 || exit 1
+
make clean
-make || exit 1
+make EXTRA_CFLAGS="$SLKCFLAGS" || exit 1
strip logrotate
+
+mkdir -p $PKG/usr/sbin
cat logrotate > $PKG/usr/sbin/logrotate
+chmod 0755 $PKG/usr/sbin/logrotate
+
+mkdir -p $PKG/usr/man/man8
cat logrotate.8 | gzip -9c > $PKG/usr/man/man8/logrotate.8.gz
+
+# Create the logrotate.d directory and install the config file
+mkdir -p $PKG/etc/logrotate.d
+zcat $CWD/logrotate.conf.gz > $PKG/etc/logrotate.conf.new
+
+# Make logrotate run from cron every day
+mkdir -p $PKG/etc/cron.daily
+zcat $CWD/logrotate.cron.gz > $PKG/etc/cron.daily/logrotate
+chmod 0755 $PKG/etc/cron.daily/logrotate
+
+# Create the state directory
+mkdir -p $PKG/var/lib/logrotate
+
mkdir -p $PKG/usr/doc/logrotate-$VERSION
cp -a \
CHANGES COPYING READM* \
- $PKG/usr/doc/logrotate-$VERSION
+ $PKG/usr/doc/logrotate-$VERSION
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-# Build the package:
+mkdir -p $PKG/install
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
cd $PKG
-makepkg -l y -c n $TMP/logrotate-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/logrotate-$VERSION-$ARCH-$BUILD.txz
-# Clean up the extra stuff:
-if [ "$1" = "--cleanup" ]; then
- rm -rf $TMP/logrotate-$VERSION
- rm -rf $PKG
-fi