summaryrefslogtreecommitdiffstats
path: root/plugins-root/Makefile.am
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2005-09-21 10:06:37 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2005-09-21 10:06:37 (GMT)
commitfb1936ca4f9ed6aef99fab9f41f806b79b0a533f (patch)
tree50b5e6ef86af697fd243d2d7418ac6462aabbb07 /plugins-root/Makefile.am
parent635ac19a4ef66b3091210335e8eb4afbaac801dd (diff)
downloadmonitoring-plugins-fb1936ca4f9ed6aef99fab9f41f806b79b0a533f.tar.gz
Separation of root setuid plugins into plugins-root/
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1233 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-root/Makefile.am')
-rw-r--r--plugins-root/Makefile.am74
1 files changed, 74 insertions, 0 deletions
diff --git a/plugins-root/Makefile.am b/plugins-root/Makefile.am
new file mode 100644
index 0000000..aae9adb
--- /dev/null
+++ b/plugins-root/Makefile.am
@@ -0,0 +1,74 @@
1## Process this file with automake to produce Makefile.in
2
3VPATH = $(top_srcdir) $(top_srcdir)/lib $(top_srcdir)/plugins $(top_srcdir)/plugins/t
4
5INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
6
7datadir = @datadir@
8localedir = $(datadir)/locale
9DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
10LIBS = @LIBINTL@ @LIBS@ @SSLINCLUDE@
11
12EXTRA_PROGRAMS = check_dhcp check_icmp
13
14BASEOBJS = ../plugins/utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a
15NETOBJS = ../plugins/netutils.o $(BASEOBJS) $(EXTRA_NETOBJS)
16NETLIBS = $(NETOBJS) $(SOCKETLIBS)
17
18TESTS_ENVIRONMENT = perl -I $(top_builddir) -I $(top_srcdir)
19
20TESTS = @PLUGIN_TEST@
21
22test:
23 perl -I $(top_builddir) -I $(top_srcdir) ../test.pl
24
25all-local: $(EXTRA_PROGRAMS)
26
27setuid_root_mode = 4550
28
29group = nagios
30
31# /* Author Coreutils team - see ACKNOWLEDGEMENTS */
32
33INSTALL_SUID = \
34 for f in $(EXTRA_PROGRAMS) ; do \
35 p=$$f; \
36 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p"; \
37 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$p; \
38 echo " chown root $(DESTDIR)$(libexecdir)/$$p"; \
39 chown root $(DESTDIR)$(libexecdir)/$$p; \
40 echo " chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p"; \
41 chmod $(setuid_root_mode) $(DESTDIR)$(libexecdir)/$$p; \
42 done
43
44install-root: $(EXTRA_PROGRAMS)
45 @$(INSTALL_SUID)
46
47install-exec-local: $(EXTRA_PROGRAMS)
48 @TMPFILE=$(DESTDIR)$(libexecdir)/.setuid-$$$$; \
49 rm -f $$TMPFILE; \
50 echo > $$TMPFILE; \
51 ## See if we can create a setuid root executable in $(libexecdir).
52 ## If not, then don't even try to install setuid plugins.
53 can_create_suid_root_executable=no; \
54 chown root $$TMPFILE > /dev/null 2>&1 \
55 && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \
56 && can_create_suid_root_executable=yes; \
57 rm -f $$TMPFILE; \
58 if test $$can_create_suid_root_executable = yes; then \
59 $(INSTALL_SUID); \
60 else \
61 echo "WARNING: insufficient access; not installing setuid plugins"; \
62 echo "NOTE: to install setuid plugins, run 'make install-root' as root"; \
63 fi
64
65# /* Author Coreutils team sub-citation */
66
67##############################################################################
68# the actual targets
69check_dhcp_LDADD = $(NETLIBS)
70check_icmp_LDADD = $(SOCKETLIBS)
71
72check_dhcp_DEPENDENCIES = check_dhcp.c $(NETOBJS) $(DEPLIBS)
73check_icmp_DEPENDENCIES = check_icmp.c
74