diff options
author | Eric Hameleers <alien@slackware.com> | 2007-12-22 12:28:12 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2007-12-22 12:28:12 +0000 |
commit | 7fe6ff45ce54831e99f7fa939094c49a201a40e0 (patch) | |
tree | 70bc6424474f1d42b77665088646d7b7becb7b31 /clamav/build/clamav.SlackBuild | |
parent | 1c61db5b12392211c764b1c644e924a69676b2f9 (diff) | |
download | asb-7fe6ff45ce54831e99f7fa939094c49a201a40e0.tar.gz asb-7fe6ff45ce54831e99f7fa939094c49a201a40e0.tar.xz |
Some beautification
Diffstat (limited to 'clamav/build/clamav.SlackBuild')
-rwxr-xr-x | clamav/build/clamav.SlackBuild | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/clamav/build/clamav.SlackBuild b/clamav/build/clamav.SlackBuild index 118f81fb..039c8268 100755 --- a/clamav/build/clamav.SlackBuild +++ b/clamav/build/clamav.SlackBuild @@ -100,7 +100,6 @@ # # ----------------------------------------------------------------------------- -# --- INIT --- # Set initial variables: PRGNAM=clamav @@ -130,7 +129,7 @@ set -u P1=${1:-1} SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" -SRCURL="http://dl.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz" +SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz" ## ## --- with a little luck, you won't have to edit below this point --- ## @@ -164,21 +163,21 @@ case "$ARCH" in ;; esac +# Prepare a sane build environment: mkdir -p $TMP/tmp-$PRGNAM # location to build the source rm -rf $TMP/tmp-$PRGNAM/* # By default we remove the remnants of previous build mkdir -p $PKG # place for the package to be built rm -rf $PKG/* # We always erase old package's contents mkdir -p $OUTPUT # place for the package to be saved -# --- SOURCE FILE AVAILABILITY --- - +# Source file availability: if ! [ -f ${SOURCE} ]; then if ! [ "x${SRCURL}" == "x" ]; then # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/`basename $SOURCE`" echo "Source '${SOURCE}' not available yet... will download now:" - wget -nv --connect-timeout=20 -O "${SOURCE}" "${SRCURL}" || true - if [ $? -ne 0 ]; then + wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true + if [ $? -ne 0 ! -s "${SOURCE}" ]; then echo "Downloading '${SOURCE}' failed... aborting the build." mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 @@ -194,7 +193,6 @@ if [ "$P1" == "--download" ]; then exit 0 fi - # --- PACKAGE BUILDING --- echo "++" @@ -209,9 +207,7 @@ tar -xzvf $SOURCE cd ${PRGNAM}-${VERSION} chown -R root:root * - -# --- BUILDING --- - +# Compiling the package source: echo Building ... # We need the "clamav" user and group to exist at the time of @@ -244,9 +240,7 @@ patch < $SRCDIR/clamd.conf.patch 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log patch < $SRCDIR/freshclam.conf.patch 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}.log cd - -# -# Install all the needed stuff to the package dir -# +# Install all the needed stuff to the package dir; # Use installwatch if available: if $(which installwatch > /dev/null 2>&1); then installwatch -o $OUTPUT/install-${PRGNAM}.log make DESTDIR=$PKG install @@ -269,8 +263,7 @@ cp $SRCDIR/rc.clamav $PKG/etc/rc.d/rc.clamav.new chown root:root $PKG/etc/rc.d/rc.clamav.new chmod 754 $PKG/etc/rc.d/rc.clamav.new -# --- POST-INSTALL SCRIPT --- - +# Add a post-install script: mkdir -p $PKG/install cat <<EOINS > $PKG/install/doinst.sh # Handle the incoming configuration files: @@ -321,12 +314,9 @@ chmod -R 770 usr/share/clamav EOR EOINS - # --- End of 'doinst.sh' script ----------- - -# --- DOCUMENTATION --- - +# Add documentation: cp $SRCDIR/00README.slackware README.slackware cp -a clamav-milter/INSTALL INSTALL.milter DOCS="AUTHORS BUGS COPYING ChangeLog FAQ INSTALL NEWS README TODO UPGRADE \ @@ -338,33 +328,27 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* -# Compress the man page(s) +# Compress the man page(s): find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; -# Strip binaries +# Strip binaries: cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true cd - - -# --- OWNERSHIP, RIGHTS --- - +# Set ownership, attrs: chmod -R o-w $PKG chown -R root:root $PKG - -# --- PACKAGE DESCRIPTION --- - +# Add a package description: mkdir -p $PKG/install cat $SRCDIR/slack-desc > $PKG/install/slack-desc if [ -f $SRCDIR/doinst.sh ]; then cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh fi - # Build the package: - cd $PKG makepkg --linkadd y --chown n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log cd $OUTPUT @@ -372,9 +356,7 @@ md5sum $PRGNAM-$VERSION-$ARCH-$BUILD.tgz > $PRGNAM-$VERSION-$ARCH-$BUILD.tgz.md5 cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD.txt - -# --- CLEANUP --- - +# Cleanup: if [ "$P1" = "--cleanup" ]; then rm -rf $TMP/tmp-$PRGNAM rm -rf $PKG |