diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | NP-VERSION-GEN | 19 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | plugins-root/Makefile.am | 10 | ||||
-rw-r--r-- | plugins-scripts/Makefile.am | 10 | ||||
-rw-r--r-- | plugins/Makefile.am | 10 |
6 files changed, 32 insertions, 22 deletions
diff --git a/Makefile.am b/Makefile.am index 3cd939ac..70325781 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -19,7 +19,7 @@ DEFS = -DLOCALEDIR=\"$(localedir)\" | |||
19 | 19 | ||
20 | dist-hook: | 20 | dist-hook: |
21 | make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec | 21 | make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec |
22 | echo ${VERSION} >$(distdir)/version | 22 | echo ${VERSION} >$(distdir)/release |
23 | 23 | ||
24 | install-root: | 24 | install-root: |
25 | cd plugins-root && $(MAKE) $@ | 25 | cd plugins-root && $(MAKE) $@ |
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN index 11697107..f963e637 100755 --- a/NP-VERSION-GEN +++ b/NP-VERSION-GEN | |||
@@ -11,12 +11,8 @@ DEF_VER=1.4.13.git | |||
11 | LF=' | 11 | LF=' |
12 | ' | 12 | ' |
13 | 13 | ||
14 | # First see if there is a version file (included in release tarballs), | 14 | # First try git-describe, then svn info, then default. |
15 | # then try git-describe, then default. | 15 | if test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && |
16 | if test -f $SRC_ROOT/version | ||
17 | then | ||
18 | VN=`cat $SRC_ROOT/version` || VN="$DEF_VER" | ||
19 | elif test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && | ||
20 | VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` && | 16 | VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` && |
21 | case "$VN" in | 17 | case "$VN" in |
22 | *$LF*) (exit 1) ;; | 18 | *$LF*) (exit 1) ;; |
@@ -27,6 +23,17 @@ elif test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && | |||
27 | esac | 23 | esac |
28 | then | 24 | then |
29 | VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`; | 25 | VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`; |
26 | elif test -d $SRC_ROOT/.svn -o -f $SRC_ROOT/.svn && | ||
27 | VN=`cd $SRC_ROOT; svn info 2>/dev/null | grep '^Revision'` && | ||
28 | case "$VN" in | ||
29 | *$LF*) (exit 1) ;; | ||
30 | Revision:*) | ||
31 | VN=`echo $VN | awk '{print $NF}'` | ||
32 | test "`svn status 2>/dev/null | grep '^[AMD]' | wc -l`" = 0 || | ||
33 | VN="$VN-dirty" ;; | ||
34 | esac | ||
35 | then | ||
36 | VN=`echo "trunk.$VN" | sed -e 's/-/./g'`; | ||
30 | else | 37 | else |
31 | VN="$DEF_VER" | 38 | VN="$DEF_VER" |
32 | fi | 39 | fi |
diff --git a/configure.in b/configure.in index 203166e4..8cae5341 100644 --- a/configure.in +++ b/configure.in | |||
@@ -98,6 +98,9 @@ AC_SUBST(PKG_ARCH) | |||
98 | AC_SUBST(REV_DATESTAMP) | 98 | AC_SUBST(REV_DATESTAMP) |
99 | AC_SUBST(REV_TIMESTAMP) | 99 | AC_SUBST(REV_TIMESTAMP) |
100 | 100 | ||
101 | dnl Check if version file is present | ||
102 | AM_CONDITIONAL([RELEASE_PRESENT], [test -f release]) | ||
103 | |||
101 | dnl Checks for programs. | 104 | dnl Checks for programs. |
102 | AC_PATH_PROG(PYTHON,python) | 105 | AC_PATH_PROG(PYTHON,python) |
103 | AC_PATH_PROG(SH,sh) | 106 | AC_PATH_PROG(SH,sh) |
diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am index ba2e9a27..3fb62a24 100644 --- a/plugins-root/Makefile.am +++ b/plugins-root/Makefile.am | |||
@@ -1,13 +1,13 @@ | |||
1 | ## Process this file with automake to produce Makefile.in | 1 | ## Process this file with automake to produce Makefile.in |
2 | 2 | ||
3 | if RELEASE_PRESENT | ||
4 | NP_VERSION = $(PACKAGE_VERSION) | ||
5 | else | ||
3 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE | 6 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE |
4 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN | 7 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN |
5 | .FORCE-NP-VERSION-FILE: | 8 | .FORCE-NP-VERSION-FILE: |
6 | 9 | -include NP-VERSION-FILE | |
7 | ## This is undocumented and could possibly break in future versions of | 10 | endif |
8 | ## automake. See: | ||
9 | ## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036 | ||
10 | @am__include@ @am__quote@NP-VERSION-FILE@am__quote@ | ||
11 | 11 | ||
12 | AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' | 12 | AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' |
13 | 13 | ||
diff --git a/plugins-scripts/Makefile.am b/plugins-scripts/Makefile.am index 19702739..5c073ca4 100644 --- a/plugins-scripts/Makefile.am +++ b/plugins-scripts/Makefile.am | |||
@@ -1,13 +1,13 @@ | |||
1 | ## Process this file with automake to produce Makefile.in | 1 | ## Process this file with automake to produce Makefile.in |
2 | 2 | ||
3 | if RELEASE_PRESENT | ||
4 | NP_VERSION = $(PACKAGE_VERSION) | ||
5 | else | ||
3 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE | 6 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE |
4 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN | 7 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN |
5 | .FORCE-NP-VERSION-FILE: | 8 | .FORCE-NP-VERSION-FILE: |
6 | 9 | -include NP-VERSION-FILE | |
7 | ## This is undocumented and could possibly break in future versions of | 10 | endif |
8 | ## automake. See: | ||
9 | ## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036 | ||
10 | @am__include@ @am__quote@NP-VERSION-FILE@am__quote@ | ||
11 | 11 | ||
12 | SUFFIXES = .pl .sh | 12 | SUFFIXES = .pl .sh |
13 | 13 | ||
diff --git a/plugins/Makefile.am b/plugins/Makefile.am index fb1924fe..0f6fbb60 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am | |||
@@ -1,13 +1,13 @@ | |||
1 | ## Process this file with automake to produce Makefile.in | 1 | ## Process this file with automake to produce Makefile.in |
2 | 2 | ||
3 | if RELEASE_PRESENT | ||
4 | NP_VERSION = $(PACKAGE_VERSION) | ||
5 | else | ||
3 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE | 6 | NP-VERSION-FILE: .FORCE-NP-VERSION-FILE |
4 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN | 7 | @$(SHELL_PATH) $(top_srcdir)/NP-VERSION-GEN |
5 | .FORCE-NP-VERSION-FILE: | 8 | .FORCE-NP-VERSION-FILE: |
6 | 9 | -include NP-VERSION-FILE | |
7 | ## This is undocumented and could possibly break in future versions of | 10 | endif |
8 | ## automake. See: | ||
9 | ## http://article.gmane.org/gmane.comp.sysutils.automake.general/10036 | ||
10 | @am__include@ @am__quote@NP-VERSION-FILE@am__quote@ | ||
11 | 11 | ||
12 | AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' | 12 | AM_CFLAGS = -DNP_VERSION='"$(NP_VERSION)"' |
13 | 13 | ||