diff options
Diffstat (limited to 'sdk/bin/dist')
-rwxr-xr-x | sdk/bin/dist | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sdk/bin/dist b/sdk/bin/dist new file mode 100755 index 0000000..43c6ef9 --- /dev/null +++ b/sdk/bin/dist @@ -0,0 +1,63 @@ +#!/bin/sh + +if test ! -f config.dist ; then + echo "dist: config.dist missing!" +fi + +# defaults! + +distdir=$1 +config="config.dist config.pkg build" +exclude="*.o *.a config.cc config.cache config *.tar.gz *~ core Makefile" +exclude_exe="true" +exclude_files=".EXCLUDE" + +. ./config.dist + +root=`pwd` +dist=$package'-'$version +cd .. + +if test ! $dist = $root ; then + rm -f $dist + ln -s $root $dist +fi + +xlist=$dist/.EXCLUDE +echo -n >$xlist +for file in $exclude_files ; do + echo $dist/$file >>$xlist +done + +flist="" + +for cfg in $include $config ; do + flist=$flist' '$dist/$cfg +done + +for dir in $examine ; do + flist=$flist' '$dist/$dir + if test $exclude_exe = "true" ; then + find $dist/$dir -perm +1 -type f -follow -print >>$xlist + fi + for deny in $exclude ; do + find $dist/$dir -follow -name $deny -print >>$xlist + done +done + +target=$dist/$dist.tar.gz +if test -d $distdir ; then + rm -f $distdir/${package}*.tar.gz + target=$distdir/$dist.tar.gz + if test -f $dist/$package'.lsm' ; then + cp -f $dist/$package'.lsm' $distdir + fi +fi + +tar -X $xlist -cvhzf $target $flist + +if [ ! $dist = $root ] ; then + rm $dist +fi + + |