#!/bin/sh [ -z $PREPKG ] && exit 1 PACKAGE=xfstt VERSION=1.7 FILES=$(cd $(dirname $0) ; pwd) mkdir -p $PREPKG/{install,etc/rc.d,usr/doc/$PACKAGE-$VERSION}/ chmod -R g-s . chown -R root:root . CXXFLAGS="-O2 -march=i486 -mtune=i686" \ ./configure \ --prefix=/usr \ --localstatedir=/var \ --build=i486-slackware-linux &> configure.output || exit 1 make $MAKEJOBS &> make.output || exit 1 make DESTDIR=$PREPKG install &> make_install.output || exit 1 cp -a doc/examples/ doc/FAQ doc/xfstt.lsm ABOUT-NLS \ CHANGES COPYING* INSTALL README THANKS TODO \ $PREPKG/usr/doc/$PACKAGE-$VERSION/ gzip -r9 $PREPKG/usr/man/ cp $FILES/rc.xfstt.new $PREPKG/etc/rc.d/ cat << EOF > $PREPKG/install/doinst.sh config() { NEW="\$1" 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... } config etc/rc.d/rc.xfstt.new EOF cp $FILES/slack-desc $PREPKG/install/ find $PREPKG -exec file {} \; \ | awk -F : '/ ELF / {print $1}' \ | xargs strip -p --strip-unneeded