Code

Added pst3 into distribution (Jason Kau - 1476451)
[nagiosplug.git] / plugins-root / Makefile.am
1 ## Process this file with automake to produce Makefile.in
3 VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t 
5 INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl -I$(top_srcdir)/plugins @SSLINCLUDE@
7 datadir = @datadir@
8 localedir = $(datadir)/locale
9 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
10 LIBS = @LIBINTL@ @LIBS@ @SSLLIBS@
12 libexec_PROGRAMS = check_dhcp check_icmp @EXTRAS_ROOT@
14 EXTRA_PROGRAMS = pst3
16 EXTRA_DIST = pst3.c
18 BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a
19 NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
20 NETLIBS = $(NETOBJS) $(SOCKETLIBS)
22 TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
24 TESTS = @PLUGIN_TEST@
26 test:
27         perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
29 setuid_root_mode = 4550
31 group = nagios
33 # /* Author Coreutils team - see ACKNOWLEDGEMENTS */
35 INSTALL_SUID = \
36         for f in $(EXTRA_PROGRAMS) ; do \
37         p=$$f; \
38         echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
39         $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
40         echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
41         chown root $(DESTDIR)$(libexecdir)/$$p; \
42         echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
43         chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
44         done
46 install-root: $(EXTRA_PROGRAMS)
47         @$(INSTALL_SUID)
49 install-exec-local: $(EXTRA_PROGRAMS)
50         @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
51         rm -f $$TMPFILE; \
52         echo > $$TMPFILE; \
53         ## See if we can create a setuid root executable in $(libexecdir).
54         ## If not, then don't even try to install setuid plugins.
55         can_create_suid_root_executable=no; \
56         chown root $$TMPFILE > /dev/null 2>&1 \
57           && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
58           && can_create_suid_root_executable=yes; \
59         rm -f $$TMPFILE; \
60         if test $$can_create_suid_root_executable = yes; then \
61           $(INSTALL_SUID); \
62         else \
63           echo "WARNING: insufficient access; not installing setuid plugins"; \
64           echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
65         fi
67 # /* Author Coreutils team sub-citation */
69 ##############################################################################
70 # the actual targets
71 check_dhcp_LDADD = $(NETLIBS)
72 check_icmp_LDADD = $(SOCKETLIBS)
74 check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS) 
75 check_icmp_DEPENDENCIES = check_icmp.c