#!/bin/sh # Add the directory of this script to PATH. PATH=$PATH:$(dirname $0) while [ ! -z "$1" ] ; do PACKAGE=$1 ; shift # Ensure that /tmp/package is empty in preparation for making a new squashfs. rm -fR /tmp/package mkdir -p /tmp/package # Make $PACKAGE. ./make_$PACKAGE.sh $PACKAGE echo ============================================================ echo echo The following files were installed in /usr/local: echo find /usr/local -not -type d -cnewer /tmp/TIMESTAMP echo echo ============================================================ echo echo The following files were copied to /tmp/package: echo ( cd /tmp/package; find usr/local -not -type d -cnewer /tmp/TIMESTAMP ) echo echo ============================================================ # Strip files that are executable and and unstripped. find /tmp/package | xargs file | grep ELF | grep "not stripped" | \ cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null # Make of squashfs of the contents of /tmp/package. rm -f /tmp/$PACKAGE.tcz ( cd /tmp ; mksquashfs package $PACKAGE.tcz -info) # Build $PACKAGE.tcz.md5.txt. ( cd /tmp ; md5sum $PACKAGE.tcz >$PACKAGE.tcz.md5.txt ) # Build $PACKAGE.tcz.list. ( cd /tmp/package ; find usr -not -type d >/tmp/$PACKAGE.tcz.list ) # Add the size to $PACKAGE.tcz.info ( cd /tmp sed -i s/SiZeK/"$(du -sh $PACKAGE.tcz | cut -f1)"/ $PACKAGE.tcz.info ) # Copy the files into $PACKAGE.tar cp $0 $(dirname $0)/make_$PACKAGE.sh /tmp ( cd /tmp ; rm -f /tmp/$PACKAGE.tar tar c $PACKAGE.tcz* $(basename $0) make_$PACKAGE.sh >$PACKAGE.tar ) echo ============================================================ echo echo The following files were copied into $PACKAGE.tar: echo tar tvf /tmp/$PACKAGE.tar sleep 1 echo echo ============================================================ # bcrypt $PACKAGE.tar done