diff options
author | William Harrington <kb0iic@berzerkula.org> | 2025-01-14 16:06:02 -0600 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2025-01-14 16:06:02 -0600 |
commit | 0cc9b20c15460213e488bf5e70963b941482f628 (patch) | |
tree | bb0143245583ec846630f39bfa2258dba640ccd7 /sdk/bin/dist | |
parent | 0e084ade5069756d487b5c948c48b777e37c00c9 (diff) |
Add source.
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 + + |