summaryrefslogtreecommitdiff
path: root/source/a/logrotate/logrotate.SlackBuild
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2010-05-19 08:58:23 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 22:43:05 +0200
commitb76270bf9e6dd375e495fec92140a79a79415d27 (patch)
tree3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/a/logrotate/logrotate.SlackBuild
parent5a12e7c134274dba706667107d10d231517d3e05 (diff)
downloadcurrent-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy!
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