summaryrefslogtreecommitdiffstats
path: root/foremost
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2008-01-09 20:37:22 +0000
committer Eric Hameleers <alien@slackware.com>2008-01-09 20:37:22 +0000
commit983c29d352e1644083b2ed03d94407153b0929c9 (patch)
tree49769100a64ae2850df747638e7cf6604538cd0d /foremost
parent8ce104e2a1dd233d162a31eb13e4873b8caddcd1 (diff)
downloadasb-983c29d352e1644083b2ed03d94407153b0929c9.tar.gz
asb-983c29d352e1644083b2ed03d94407153b0929c9.tar.xz
Fixed installation location of the binary...
Diffstat (limited to 'foremost')
-rwxr-xr-xforemost/build/foremost.SlackBuild34
1 files changed, 30 insertions, 4 deletions
diff --git a/foremost/build/foremost.SlackBuild b/foremost/build/foremost.SlackBuild
index fd7ba6b3..0acda6fe 100755
--- a/foremost/build/foremost.SlackBuild
+++ b/foremost/build/foremost.SlackBuild
@@ -155,22 +155,48 @@ cd ${PRGNAM}-${VERSION}
echo Building ...
export LDFLAGS="$SLKLDFLAGS"
export CFLAGS="$SLKCFLAGS"
-make BIN=/usr MAN=/usr/man/man1 CONF=/etc 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
+make BIN=/usr/bin MAN=/usr/man/man1 CONF=/etc 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
# Create destination directories:
-mkdir -p $PKG/usr/man/man1 $PKG/etc
+mkdir -p $PKG/usr/bin $PKG/usr/man/man1 $PKG/etc
# Install all the needed stuff to the package dir
# Use installwatch if available, to produce a logfile of the installation
# process that is more easily readable:
if $(which installwatch > /dev/null 2>&1); then
installwatch -o $OUTPUT/install-${PRGNAM}.log \
- make BIN=$PKG/usr MAN=$PKG/usr/man/man1 CONF=$PKG/etc install
+ make BIN=$PKG/usr/bin MAN=$PKG/usr/man/man1 CONF=$PKG/etc install
else
- make BIN=$PKG/usr MAN=$PKG/usr/man/man1 CONF=$PKG/etc install \
+ make BIN=$PKG/usr/bin MAN=$PKG/usr/man/man1 CONF=$PKG/etc install \
2>&1 |tee $OUTPUT/install-${PRGNAM}.log
fi
+# Make the configuration file upgrade-safe:
+mv $PKG/etc/foremost.conf{,.new}
+
+# Add this to the doinst.sh:
+! [ -d $PKG/install ] && mkdir -p $PKG/install
+cat <<EOINS >> $PKG/install/doinst.sh
+# Handle the incoming configuration files:
+config() {
+ for infile in \$1; do
+ NEW="\$infile"
+ OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r \$OLD ]; then
+ mv \$NEW \$OLD
+ elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
+ # toss the redundant copy
+ rm \$NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+ done
+}
+
+config etc/foremost.conf.new
+
+EOINS
+
# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true