#!/bin/sh ##NEED:linux_src #DEP:popt # Set initial variables: CWD=`pwd` if [ "$TMP" = "" ]; then TMP=/tmp fi PKG=$TMP/package-logrotate NAME=logrotate VERSION=3.6.8 ARCH=`arch` BUILD=1DatuX if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source fi rm -rf $PKG mkdir -p $PKG # place for the package to be built cd $TMP rm -rf logrotate-$VERSION tar xzvf $CWD/logrotate-$VERSION.tar.gz cd logrotate-$VERSION chown -R root.root . make clean || exit 1 make || exit 1 strip logrotate mkdir -p $PKG/usr/sbin cat logrotate > $PKG/usr/sbin/logrotate mkdir -p $PKG/usr/man/man8 cat logrotate.8 | gzip -9c > $PKG/usr/man/man8/logrotate.8.gz mkdir -p $PKG/usr/doc/logrotate-$VERSION cp -a \ CHANGES COPYING READM* \ $PKG/usr/doc/logrotate-$VERSION chmod 644 $PKG/usr/doc/logrotate-$VERSION/* chmod 755 $PKG/usr/sbin/* mkdir -p $PKG/install mkdir -p $PKG/etc/cron.daily cp $CWD/logrotate.d $PKG/etc chmod 644 $PKG/etc/logrotate.d/* cp $CWD/logrotate.conf $PKG/etc cp $CWD/logrotate $PKG/etc/cron.daily chmod 644 $PKG/etc/logrotate.conf $PKG/etc/cron.daily chown -R root:root $PKG/etc/* #maak alle configfiles eindigend op .new find $PKG/etc -follow -type f -exec mv "{}" "{}.new" \; || exit 1 # Build the package: cd $PKG #makepkg -l y -c n $TMP/logrotate-$VERSION-$ARCH-$BUILD.tgz makepkg -l y -c n $CWD/$NAME.pkg > /dev/null && echo $VERSION > $CWD/$NAME.version && arch > $CWD/$NAME.arch #mv $TMP/logrotate-$VERSION-$ARCH-$BUILD.tgz $CWD