cd "$DIR"
cd ..
-# Step 1: make it distribution-ready
-echo "Preparing distribution..."
-. ./scripts/preparedist.sh
+# Step 1: make sure it is distribution-ready
+echo "Ensure that you run preparedist.sh before makedist.sh to ensure"
+echo "that all files are up-to-date"
# Step 2: determine version
echo "Determining version..."
VERSION=`grep VERSION hdrs/version.h | sed 's/^.*"\(.*\)".*$/\1/'`
echo "Version is $VERSION"
-# Step 3: make tarball
+# Step 3: copy everything into a temporary directory
+WD=`pwd`
+TMPDIR=`mktemp -d "cobramush.dist.XXXXXX"`
+cd "$TMPDIR"
+mkdir cobramush
+split -l 50 "$WD/MANIFEST"
+for i in x?? ; do
+ for j in `cat $i` ; do
+ mkdir -p cobramush/`dirname "$j"`
+ cp "$WD/$j" cobramush/`dirname "$j"`
+ done
+done
+rm x??
+
+# Step 4: make tarball
echo "Making tarball..."
TARBALL="cobramush-$VERSION.tar.gz"
-tar -czf "$TARBALL" `cat MANIFEST`
+tar -czf "$WD/$TARBALL" cobramush
+
+# Step 5: clean up
+echo "Cleaning up..."
+cd "$WD"
+rm -r "$TMPDIR"
-echo "Tarball $TARBALL created"
+echo "$TARBALL created"