From c77ffcedc423655621be9803b7f710c758a959b7 Mon Sep 17 00:00:00 2001
From: Karl DeBisschop <kdebisschop@users.sourceforge.net>
Date: Thu, 14 Nov 2002 18:25:10 +0000
Subject: fix bug with gettimeofday test, improve version/release handling,
 update rpm spec

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@200 f882894a-f735-0410-b71e-b25c423dba1c

diff --git a/Makefile.am b/Makefile.am
index 9e0415e..808e1a7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,7 +6,7 @@ EXTRA_DIST = REQUIREMENTS acconfig.h subst.in subst.sh Helper.pm	\
 contrib nagios-plugins.spec.in getloadavg.m4
 
 dist-hook:
-	sed "s/PACKAGE_VERSION/@PACKAGE_VERSION@/;s/PACKAGE_RELEASE/@PACKAGE_RELEASE@/;" $(srcdir)/nagios-plugins.spec.in > $(distdir)/nagios-plugins.spec
+	sed "s/%%{VER}/@VER@/;s/%%{REL}/@REL@/;" $(srcdir)/nagios-plugins.spec.in > $(distdir)/nagios-plugins.spec
 
 test:
 	cd plugins; $(MAKE) test
diff --git a/acconfig.h b/acconfig.h
index b283039..f2fe07b 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -15,6 +15,7 @@
 #undef HAVE_VA_COPY
 #undef HAVE_VASPRINTF
 #undef HAVE_VSNPRINTF
+#undef NEED_GETTIMEOFDAY
 #undef NSLOOKUP_COMMAND
 #undef HOST_COMMAND
 #undef PACKAGE_VERSION
diff --git a/configure.in b/configure.in
index c673018..509b623 100644
--- a/configure.in
+++ b/configure.in
@@ -3,11 +3,15 @@ include(`aclocal.m4')
 include(`getloadavg.m4')
 AC_REVISION ($Revision$)
 AC_INIT(Helper.pm)
-PACKAGE_VERSION="1.3.0"
+VER=1.3.0
+REL=beta2
+AC_SUBST(VER)
+AC_SUBST(REL)
+PACKAGE_VERSION="${VER}-${REL}"
 AC_SUBST(PACKAGE_VERSION)
 PACKAGE_RELEASE="alpha1"
 AC_SUBST(PACKAGE_RELEASE)
-AM_INIT_AUTOMAKE(nagios-plugins,${PACKAGE_VERSION}-${PACKAGE_RELEASE})
+AM_INIT_AUTOMAKE(nagios-plugins,${PACKAGE_VERSION})
 AM_CONFIG_HEADER(plugins/config.h plugins/common.h plugins/version.h plugins/netutils.h plugins/utils.h plugins/popen.h)
 
 AC_PREFIX_DEFAULT(/usr/local/nagios)
@@ -366,12 +370,15 @@ AC_TRY_COMPILE([#include <getopt.h>
                 DEPLIBS="$DEPLIBS libgetopt.a"])
 
 AC_TRY_COMPILE([#include <sys/time.h>],
-               [struct timeval *foo;],
-               [AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])])
-
-AC_TRY_COMPILE([#include <sys/time.h>],
-               [gettimeofday(NULL, NULL);],
-               AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]))
+               [struct timeval *tv;
+                struct timezone *tz;],
+               AC_DEFINE(HAVE_STRUCT_TIMEVAL,1,[Define if we have a timeval structure])
+               AC_TRY_COMPILE([#include <sys/time.h>],
+                              [struct timeval *tv;
+                               struct timezone *tz;
+                               gettimeofday(tv, tz);],
+                              AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define if gettimeofday is found]),
+                              AC_DEFINE(NEED_GETTIMEOFDAY,1,[Define if gettimeofday is needed])))
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS(memmove select socket strdup strstr strtod strtol strtoul)
diff --git a/nagios-plugins.spec.in b/nagios-plugins.spec.in
index f8b9ee6..a4e734c 100644
--- a/nagios-plugins.spec.in
+++ b/nagios-plugins.spec.in
@@ -8,8 +8,8 @@
 %define name %{archive}
 %endif
 
-%define version PACKAGE_VERSION
-%define release PACKAGE_RELEASE
+%define version %%{VER}
+%define release %%{REL}
 %define source %{archive}-%{version}
 
 Name: %{name}
@@ -95,6 +95,7 @@ rm -rf $RPM_BUILD_ROOT
 %else
 %{_prefix}/lib/nagios/plugins/check_by_ssh
 %{_prefix}/lib/nagios/plugins/check_breeze
+%{_prefix}/lib/nagios/plugins/check_dig
 %{_prefix}/lib/nagios/plugins/check_disk
 %{_prefix}/lib/nagios/plugins/check_disk_smb
 %{_prefix}/lib/nagios/plugins/check_dns
@@ -102,10 +103,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_prefix}/lib/nagios/plugins/check_flexlm
 %{_prefix}/lib/nagios/plugins/check_ftp
 %{_prefix}/lib/nagios/plugins/check_http
+%{_prefix}/lib/nagios/plugins/check_ifoperstatus
+%{_prefix}/lib/nagios/plugins/check_ifstatus
 %{_prefix}/lib/nagios/plugins/check_imap
 %{_prefix}/lib/nagios/plugins/check_ircd
 %{_prefix}/lib/nagios/plugins/check_load
 %{_prefix}/lib/nagios/plugins/check_log
+%{_prefix}/lib/nagios/plugins/check_mailq
 %{_prefix}/lib/nagios/plugins/check_mrtg
 %{_prefix}/lib/nagios/plugins/check_mrtgtraf
 %{_prefix}/lib/nagios/plugins/check_nagios
@@ -130,6 +134,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_prefix}/lib/nagios/plugins/check_users
 %{_prefix}/lib/nagios/plugins/check_vsz
 %{_prefix}/lib/nagios/plugins/check_wave
+%{_prefix}/lib/nagios/plugins/negate
 %{_prefix}/lib/nagios/plugins/utils.pm
 %{_prefix}/lib/nagios/plugins/utils.sh
 %{_prefix}/lib/nagios/plugins/urlize
diff --git a/plugins/utils.c b/plugins/utils.c
index bf6af88..10d544c 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -316,7 +316,7 @@ is_option (char *str)
 
 
 
-#ifndef HAVE_GETTIMEOFDAY
+#ifdef NEED_GETTIMEOFDAY
 int
 gettimeofday (struct timeval *tv, struct timezone *tz)
 {
-- 
cgit v0.10-9-g596f

