makedist.sh improvements
authorAri Johnson <ari@cobramush.org>
Fri, 2 Mar 2007 16:19:55 +0000 (16:19 +0000)
committerAri Johnson <ari@cobramush.org>
Fri, 2 Mar 2007 16:19:55 +0000 (16:19 +0000)
scripts/makedist.sh

index ed0e85c40b9955c04d084a243dda73461edd7b82..97957cfa8c908d29af3a9f0eed59629ce3d927d6 100644 (file)
@@ -5,19 +5,38 @@ DIR=`dirname "$SELF"`
 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"