Kaynağa Gözat

Spec file updates and socklen_t fix

Ethan Galstad 22 yıl önce
ebeveyn
işleme
a6a8817048
5 değiştirilmiş dosya ile 71 ekleme ve 12 silme
  1. 38 4
      configure
  2. 13 1
      configure.in
  3. 4 1
      include/config.h.in
  4. 6 6
      include/dh.h
  5. 10 0
      nrpe.spec

+ 38 - 4
configure

@@ -1136,7 +1136,7 @@ EOF
 
 fi
 
-for ac_hdr in ctype.h dirent.h errno.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h
+for ac_hdr in ctype.h dirent.h errno.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h socket.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -2106,6 +2106,40 @@ EOF
 fi
 rm -f conftest*
 
+echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
+echo "configure:2111: checking for socklen_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2116 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  egrep "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_type_socklen_t=yes
+else
+  rm -rf conftest*
+  ac_cv_type_socklen_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_socklen_t" 1>&6
+if test $ac_cv_type_socklen_t = no; then
+  cat >> confdefs.h <<\EOF
+#define socklen_t int
+EOF
+
+fi
+
+
 # Check whether --enable-ssl or --disable-ssl was given.
 if test "${enable_ssl+set}" = set; then
   enableval="$enable_ssl"
@@ -2150,7 +2184,7 @@ fi
 
 if test x$check_for_ssl = xyes; then
 	echo $ac_n "checking for SSL""... $ac_c" 1>&6
-echo "configure:2154: checking for SSL" >&5
+echo "configure:2188: checking for SSL" >&5
 	found_ssl=no
 	for dir in $ssl_inc_dir /usr/local/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
 		ssldir="$dir"
@@ -2193,7 +2227,7 @@ EOF
 	fi
 
 		echo $ac_n "checking for Kerberos include files""... $ac_c" 1>&6
-echo "configure:2197: checking for Kerberos include files" >&5
+echo "configure:2231: checking for Kerberos include files" >&5
 	found_kerberos=no
 	for dir in $kerberos_inc_dir /usr/kerberos/include; do
 		kerbdir="$dir"
@@ -2263,7 +2297,7 @@ fi
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2267: checking for $ac_word" >&5
+echo "configure:2301: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else

+ 13 - 1
configure.in

@@ -26,7 +26,7 @@ dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
+AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h socket.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -104,6 +104,18 @@ AC_TRY_COMPILE([#include <stdlib.h>
 [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)],
 [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)])
 
+dnl Stolen from Python code: loewis@users.sourceforge.net
+AC_CHECK_TYPE(socklen_t,int,
+	AC_DEFINE(socklen_t,int,
+	Define to `int' if <sys/socket.h> does not define.),[
+	#ifdef HAVE_SYS_TYPES_H
+	#include <sys/types.h>
+	#endif
+	#ifdef HAVE_SYS_SOCKET_H
+	#include <sys/socket.h>
+	#endif
+	])
+
 dnl Does user want to check for SSL?
 AC_ARG_ENABLE(ssl,--enable-ssl enables native SSL support,[
 	if test x$enableval = xyes; then

+ 4 - 1
include/config.h.in

@@ -2,7 +2,7 @@
  *
  * NRPE Common Header File
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
- * Last Modified: 10-13-2003
+ * Last Modified: 11-12-2003
  *
  * License:
  *
@@ -165,6 +165,9 @@ typedef int int32_t;
 #include <sys/socket.h>
 #endif
 
+/* Define to 'int' if <sys/socket.h> does not define */
+#undef socklen_t
+
 #undef HAVE_SOCKET_H
 #ifdef HAVE_SOCKET_H
 #include <socket.h>

+ 6 - 6
include/dh.h

@@ -4,12 +4,12 @@
 DH *get_dh512()
 	{
 	static unsigned char dh512_p[]={
-		0xAE,0x63,0x22,0x35,0x42,0xB6,0xE3,0x9D,0x7E,0x19,0x82,0x86,
-		0x4E,0x35,0x2E,0xB6,0xC6,0xCB,0xEE,0x31,0x12,0xC7,0x65,0xB1,
-		0x2E,0xFD,0x0D,0x5D,0x2E,0xED,0x68,0xF8,0x8F,0x34,0xFB,0x00,
-		0x78,0x12,0xCA,0x21,0x18,0x04,0x5F,0x27,0x25,0x29,0x9D,0x30,
-		0x44,0xF1,0xD4,0xC1,0x2F,0x69,0x51,0x40,0xB1,0x0C,0x09,0xA8,
-		0x3C,0x41,0x5C,0x73,
+		0xB0,0x05,0xA8,0x33,0xE4,0xDF,0x5B,0x07,0x46,0xD8,0x39,0xC4,
+		0x02,0xE7,0xE9,0xCF,0xE7,0x73,0xD1,0x49,0x8E,0x07,0xAA,0xC7,
+		0xB3,0x5D,0xCB,0xDB,0x72,0x16,0x53,0x92,0xC6,0x89,0xF9,0x42,
+		0x65,0xDC,0x78,0x61,0x0A,0x8D,0x2B,0x8E,0x12,0xA3,0x87,0xB8,
+		0x61,0x2E,0x34,0x86,0x85,0x58,0x67,0x69,0x4F,0xE3,0x50,0x49,
+		0xD0,0xED,0x31,0xBB,
 		};
 	static unsigned char dh512_g[]={
 		0x02,

+ 10 - 0
nrpe.spec

@@ -55,6 +55,13 @@ This package provides the nrpe plugin for Nagios-related applications.
 
 
 %pre
+# Create `nagios' group on the system if necessary
+if grep ^nagios: /etc/group; then
+	: # group already exists
+else
+	/usr/sbin/groupadd %{nsgrp} || %nnmmsg Unexpected error adding group "%{nsgrp}". Aborting install process.
+fi
+
 # Create `nagios' user on the system if necessary
 if id %{nsusr} ; then
 	: # user already exists
@@ -140,6 +147,9 @@ rm -rf $RPM_BUILD_ROOT
 %doc Changelog LEGAL README
 
 %changelog
+* Wed Nov 12 2003 Ingimar Robertsson <iar@skyrr.is>
+- Added adding of nagios group if it does not exist.
+
 * Tue Jan 07 2003 James 'Showkilr' Peterson <showkilr@showkilr.com>
 - Removed the lines which removed the nagios user and group from the system
 - changed the patch release version from 3 to 1