Patches to get Nagios header files also installed

Tobias Mucke tobias.mucke at googlemail.com
Sun Apr 13 22:21:48 CEST 2008


Dear Nagios developers,

since I am programming a Nagios event broker module I have a proposal
to ease the distribution and building of NEB modules for developers
and users of Nagios.

>From my point of view it would be nice if Nagios would get installed
with its header files, so a user can build NEB modules against it and
a NEB developer don't have to package actual header files with his
NEB.

To accomplish this I made some simple changes to configure.in and
Makefile.in. Besides that I create a new file called
include/Makefile.in using the include/Makefile as a starting point.

Here are the diffs respectively the new file include/Makefile.in.

###################################################################
diff -U 3 nagios-3.0.1-orig/Makefile.in nagios-3.0.1/Makefile.in
--- nagios-3.0.1-orig/Makefile.in       2008-01-24 19:58:01.000000000 +0100
+++ nagios-3.0.1/Makefile.in    2008-04-13 22:01:03.000000000 +0200
@@ -28,6 +28,7 @@
 CGIDIR=@sbindir@
 LIBEXECDIR=@libexecdir@
 HTMLDIR=@datadir@
+INCLUDEDIR=@includedir@
 INSTALL=@INSTALL@
 INSTALL_OPTS=@INSTALL_OPTS@
 COMMAND_OPTS=@COMMAND_OPTS@
@@ -180,6 +181,7 @@
        cd $(SRC_BASE) && $(MAKE) $@
        cd $(SRC_CGI) && $(MAKE) $@
        cd $(SRC_HTM) && $(MAKE) $@
+       cd $(SRC_INCLUDE) && $(MAKE) $@
        $(MAKE) install-basic

 install-unstripped:
@@ -189,6 +191,7 @@
        $(MAKE) install-basic

 install-basic:
+       $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(INCLUDEDIR)
        $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
        $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR)
        $(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LOGDIR)/archives
###################################################################

###################################################################
diff -U 3 nagios-3.0.1-orig/configure.in nagios-3.0.1/configure.in
--- nagios-3.0.1-orig/configure.in      2008-04-01 21:32:04.000000000 +0200
+++ nagios-3.0.1/configure.in   2008-04-13 21:57:53.000000000 +0200
@@ -763,7 +763,7 @@
 AC_SUBST(USE_EVENTBROKER)

 AC_PATH_PROG(PERL,perl)
-AC_OUTPUT(Makefile subst pkginfo base/Makefile common/Makefile
contrib/Makefile cgi/Makefile html/Makefile module/Makefile
xdata/Makefile daemon-init html/index.html html/side.html)
+AC_OUTPUT(Makefile subst pkginfo base/Makefile common/Makefile
contrib/Makefile cgi/Makefile html/Makefile include/Makefile
module/Makefile xdata/Makefile daemon-init html/index.html
html/side.html)


 perl subst include/locations.h
###################################################################

###################################################################
cat nagios-3.0.1/include/Makefile.in
###############################
# Makefile for Include Files
#
# Last Modified: 10-18-2007
# Last Modified: 04-13-2008
###############################

prefix=@prefix@
INCLUDEDIR=@includedir@
INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@

clean:
        rm -f *~

distclean: clean
        rm -f cgiutils.h config.h locations.h snprintf.h

devclean: distclean

install:
        $(MAKE) install-basic

install-basic:
        $(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(INCLUDEDIR)
        for file in *.h; do \
                if test "x${file}" != "xconfig.h" -a "x${file}" !=
"xsnprintf.h" -a "x${file}" != "xcgiutils.h" ; then \
                        $(INSTALL) -m 644 $(INSTALL_OPTS) $$file
$(DESTDIR)$(INCLUDEDIR); \
                fi; \
        done
###################################################################

I have tested these changes on my Linux box with the newest Nagios
version available (3.0.1). The shell code used in include/Makefile.in
is copied from Makefiles.in generated with automake so it is as
portable as possible. Please use your version of autoconf to update
your configure script after patching.

Any comments greatly appreciated.

Thanks.

Tobias

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone




More information about the Developers mailing list