[Nagios-devel] Nagios 4: Call for testing

Sven Nierlein Sven.Nierlein at consol.de
Mon Sep 17 08:14:42 UTC 2012


On 9/14/12 0:00, Andreas Ericsson wrote:
>
> So spedang! and get your hack on, folks :)
>

Hi Andreas,

please consider the attached patch which adds a "dist" make target to create a test/release tarball in a sane way.

Thanks,
  Sven
-------------- next part --------------
From d0cc9a2e0b84a1515a310399be165cc183229842 Mon Sep 17 00:00:00 2001
From: Sven Nierlein <sven at nierlein.de>
Date: Mon, 17 Sep 2012 09:54:54 +0200
Subject: [PATCH] added dist make target

make-tarball now optionally updates version. Otherwise create the tarball only.

Signed-off-by: Sven Nierlein <sven at nierlein.de>
---
 Makefile.in  |    3 +++
 make-tarball |   34 +++++++++++++++++-----------------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 1940e82..597f1d9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -393,5 +393,8 @@ pkgset: nagios.SPARC.pkg.tar.gz
 pkgclean:
 	rm -rf pkg Prototype nagios.SPARC.pkg.tar.gz
 
+dist: distclean
+	./make-tarball
+
 # Targets that always get built
 .PHONY:	indent clean clean distclean dox
diff --git a/make-tarball b/make-tarball
index 960e9d7..f191f0d 100755
--- a/make-tarball
+++ b/make-tarball
@@ -1,25 +1,25 @@
 #! /bin/sh
-if [ "x$1" = "x" ]
-then
-	echo "Usage: $0 <release number>"
-	exit 1
+if [ "x$1" = "x" ]; then
+    VERSION=$(grep ^PKG_VERSION configure.in | awk -F= {' print $2 '} | tr -d '"')
+else
+    # Update version number and modification date in code
+    ./update-version $1
+    VERSION=$1
+    if test -e Makefile; then
+        make distclean
+    fi
 fi
 
-if test -e Makefile; then
-  make distclean
-fi
 autoconf
 
-# Update version number and modification date in code
-./update-version $1
-
 PWDSAVE=`pwd`
 PACKAGE=nagios
-pushd ..
-if [ ! -d $PACKAGE-$1 ]; then
-  ln -s `basename $PWDSAVE` $PACKAGE-$1
+cd ..
+if [ ! -d $PACKAGE-$VERSION ]; then
+  ln -s `basename $PWDSAVE` $PACKAGE-$VERSION
 fi
-tar zhcvf $PACKAGE-$1.tar.gz --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .\#* $PACKAGE-$1
-#rm $PACKAGE-$1
-popd
-
+tar zhcf $PACKAGE-$VERSION.tar.gz --exclude RCS --exclude CVS --exclude build-* --exclude *~ --exclude .\#* --exclude .git* $PACKAGE-$VERSION
+rm $PACKAGE-$VERSION
+cd -
+mv ../$PACKAGE-$VERSION.tar.gz .
+echo "$PACKAGE-$VERSION.tar.gz created"
-- 
1.7.0.4


More information about the Nagios-devel mailing list