[Nagiosplug-checkins] SF.net SVN: nagiosplug:[2101] nagiosplug/trunk
dermoth at users.sourceforge.net
dermoth at users.sourceforge.net
Wed Nov 26 11:49:25 CET 2008
Revision: 2101
http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2101&view=rev
Author: dermoth
Date: 2008-11-26 10:49:25 +0000 (Wed, 26 Nov 2008)
Log Message:
-----------
Disable dynamic versionning for releases, and allow generating version out of subversion.
This should be a definitive fix for systems with non-compilant make programs as the version will be taken from $(PACKAGE_VERSION) instead.
At the same time I added code for generating svn-based version strings.
Modified Paths:
--------------
nagiosplug/trunk/Makefile.am
nagiosplug/trunk/NP-VERSION-GEN
nagiosplug/trunk/configure.in
nagiosplug/trunk/plugins/Makefile.am
nagiosplug/trunk/plugins-root/Makefile.am
nagiosplug/trunk/plugins-scripts/Makefile.am
Modified: nagiosplug/trunk/Makefile.am
===================================================================
--- nagiosplug/trunk/Makefile.am 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/Makefile.am 2008-11-26 10:49:25 UTC (rev 2101)
@@ -19,7 +19,7 @@
dist-hook:
make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec
- echo ${VERSION} >$(distdir)/version
+ echo ${VERSION} >$(distdir)/release
install-root:
cd plugins-root && $(MAKE) $@
Modified: nagiosplug/trunk/NP-VERSION-GEN
===================================================================
--- nagiosplug/trunk/NP-VERSION-GEN 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/NP-VERSION-GEN 2008-11-26 10:49:25 UTC (rev 2101)
@@ -11,12 +11,8 @@
LF='
'
-# First see if there is a version file (included in release tarballs),
-# then try git-describe, then default.
-if test -f $SRC_ROOT/version
-then
- VN=`cat $SRC_ROOT/version` || VN="$DEF_VER"
-elif test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git &&
+# First try git-describe, then svn info, then default.
+if test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git &&
VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` &&
case "$VN" in
*$LF*) (exit 1) ;;
@@ -27,6 +23,17 @@
esac
then
VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`;
+elif test -d $SRC_ROOT/.svn -o -f $SRC_ROOT/.svn &&
+ VN=`cd $SRC_ROOT; svn info 2>/dev/null | grep '^Revision'` &&
+ case "$VN" in
+ *$LF*) (exit 1) ;;
+ Revision:*)
+ VN=`echo $VN | awk '{print $NF}'`
+ test "`svn status 2>/dev/null | grep '^[AMD]' | wc -l`" = 0 ||
+ VN="$VN-dirty" ;;
+ esac
+then
+ VN=`echo "trunk.$VN" | sed -e 's/-/./g'`;
else
VN="$DEF_VER"
fi
Modified: nagiosplug/trunk/configure.in
===================================================================
--- nagiosplug/trunk/configure.in 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/configure.in 2008-11-26 10:49:25 UTC (rev 2101)
@@ -98,6 +98,9 @@
AC_SUBST(REV_DATESTAMP)
AC_SUBST(REV_TIMESTAMP)
+dnl Check if version file is present
+AM_CONDITIONAL([RELEASE_PRESENT], [test -f release])
+
dnl Checks for programs.
AC_PATH_PROG(PYTHON,python)
AC_PATH_PROG(SH,sh)
Modified: nagiosplug/trunk/plugins/Makefile.am
===================================================================
--- nagiosplug/trunk/plugins/Makefile.am 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/plugins/Makefile.am 2008-11-26 10:49:25 UTC (rev 2101)
@@ -1,14 +1,14 @@
## Process this file with automake to produce Makefile.in
+if RELEASE_PRESENT
+NP_VERSION = $(PACKAGE_VERSION)
+else
NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
@$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
-## This is undocumented and could possibly break in future versions of
-## automake. See:
-## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036
- at am__include@ @am__quote at NP-VERSION-FILE@am__quote@
-
AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
Modified: nagiosplug/trunk/plugins-root/Makefile.am
===================================================================
--- nagiosplug/trunk/plugins-root/Makefile.am 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/plugins-root/Makefile.am 2008-11-26 10:49:25 UTC (rev 2101)
@@ -1,14 +1,14 @@
## Process this file with automake to produce Makefile.in
+if RELEASE_PRESENT
+NP_VERSION = $(PACKAGE_VERSION)
+else
NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
@$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
-## This is undocumented and could possibly break in future versions of
-## automake. See:
-## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036
- at am__include@ @am__quote at NP-VERSION-FILE@am__quote@
-
AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"'
VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t $(srcdir)
Modified: nagiosplug/trunk/plugins-scripts/Makefile.am
===================================================================
--- nagiosplug/trunk/plugins-scripts/Makefile.am 2008-11-25 13:53:23 UTC (rev 2100)
+++ nagiosplug/trunk/plugins-scripts/Makefile.am 2008-11-26 10:49:25 UTC (rev 2101)
@@ -1,14 +1,14 @@
## Process this file with automake to produce Makefile.in
+if RELEASE_PRESENT
+NP_VERSION = $(PACKAGE_VERSION)
+else
NP-VERSION-FILE: .FORCE-NP-VERSION-FILE
@$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN
.FORCE-NP-VERSION-FILE:
+-include NP-VERSION-FILE
+endif
-## This is undocumented and could possibly break in future versions of
-## automake. See:
-## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036
- at am__include@ @am__quote at NP-VERSION-FILE@am__quote@
-
SUFFIXES = .pl .sh
VPATH=$(top_srcdir) $(top_srcdir)/plugins-scripts $(top_srcdir)/plugins-scripts/t
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list