[ofa-general] [PATCH] management/make.dist: use 'make dist' for tarballs generation

Sasha Khapyorsky sashak at voltaire.com
Wed Sep 19 07:43:09 PDT 2007


Use 'make dist' in components directories for tarballs generation - this
creates "clean" archives. make.dist script functionality and usage still
be same as before.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 make.dist |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/make.dist b/make.dist
index 42e38ce..4f9c2a9 100755
--- a/make.dist
+++ b/make.dist
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-TMPDIR=dist
+TMPDIR=`pwd`/dist
 if [ ! -d $TMPDIR ]; then mkdir $TMPDIR; fi
 
 usage() {
@@ -8,9 +8,9 @@ echo "$0 daily | release [ signed | <key-id> ]"
 echo
 echo "	You must specify either release or daily in order for this script"
 echo "to make tarballs.  If this is a daily release, the tarballs will"
-echo "be named <component>-git.tgz and will overwrite existing tarballs."
+echo "be named <component>-git.tar.gz and will overwrite existing tarballs."
 echo "If this is a release build, then the tarball will be named"
-echo "<component>-<version>.tgz and must be a new file.  In addition,"
+echo "<component>-<version>.tar.gz and must be a new file.  In addition,"
 echo "the script will add a new set of symbolic tags to the git repo"
 echo "that correspond to the <component>-<version> of each tarball."
 echo
@@ -77,8 +77,8 @@ for target in $TARGETS; do
 			exit 0
 		fi
 		# Check versions to make sure that we can proceed
-		if [ -f $TMPDIR/$target-$VERSION.tgz ]; then
-			echo "Target $target-$VERSION.tgz already exists, please update the version on"
+		if [ -f $TMPDIR/$target-$VERSION.tar.gz ]; then
+			echo "Target $target-$VERSION.tar.gz already exists, please update the version on"
 			echo "component $target"
 			exit 2
 		fi
@@ -92,7 +92,7 @@ for target in $TARGETS; do
 # incrementally higher than the last officially released tarball.
 		RELEASE=1
 		echo $RELEASE > $TMPDIR/$target.release
-		TARBALL=$target-$VERSION.tgz
+		TARBALL=$target-$VERSION.tar.gz
 	elif [ "$1" = "daily" ]; then
 		DATE=`date +%Y%m%d`
 		if [ -f $TMPDIR/$target.release ]; then
@@ -103,17 +103,14 @@ for target in $TARGETS; do
 		fi
 		echo $RELEASE > $TMPDIR/$target.release
 		RELEASE=0.${RELEASE}.${DATE}git
-		TARBALL=$target-git.tgz
+		TARBALL=$target-$VERSION-$RELEASE.tar.gz
 	fi
 
-	cp -a $target $target-$VERSION
-	sed -e 's/@VERSION@/'$VERSION'/;s/@RELEASE@/'$RELEASE'/;s/@TARBALL@/'$TARBALL'/' < $target/$target.spec.in > $target-$VERSION/$target.spec
-	cd $target-$VERSION
-	./autogen.sh
-	cd ..
 	echo "Creating $TMPDIR/$TARBALL"
-	tar -czf $TMPDIR/$TARBALL --exclude=.git $target-$VERSION
-	rm -rf $target-$VERSION
+	( cd $target && ./autogen.sh &&
+	  RELEASE=$RELEASE TARBALL=$TARBALL ./configure &&
+	  make dist && mv $target-$VERSION.tar.gz $TMPDIR/$TARBALL ) ||
+	exit $?
 
 	if [ $1 = release ]; then
 		if [ ! -z "$2" ]; then
-- 
1.5.3.rc2.29.gc4640f




More information about the general mailing list