nagios-nrpe/Makefile.in

202 lines
6.8 KiB
Makefile
Raw Permalink Normal View History

2016-06-24 12:21:25 +02:00
###############################
#
2017-11-02 09:55:48 +01:00
# NRPE Makefile
#
2016-06-24 12:21:25 +02:00
###############################
# Source code directories
SRC_BASE=./src/
SRC_INCLUDE=./include/
2017-05-04 11:53:58 +02:00
# Mainly used for rpmbuild
# DESTDIR=
2016-06-24 12:21:25 +02:00
CC=@CC@
CFLAGS=@CFLAGS@ @DEFS@
LDFLAGS=@LDFLAGS@ @LIBS@
INSTALL=@INSTALL@
2017-05-04 11:53:58 +02:00
GREP=@GREP@
EGREP=@EGREP@
prefix=$(DESTDIR)@prefix@
exec_prefix=$(DESTDIR)@exec_prefix@
CFGDIR=$(DESTDIR)@pkgsysconfdir@
BINDIR=$(DESTDIR)@bindir@
SBINDIR=$(DESTDIR)@sbindir@
LIBEXECDIR=$(DESTDIR)@libexecdir@
2016-06-24 12:21:25 +02:00
NAGIOS_INSTALL_OPTS=@NAGIOS_INSTALL_OPTS@
NRPE_INSTALL_OPTS=@NRPE_INSTALL_OPTS@
2017-05-04 11:53:58 +02:00
OPSYS=@opsys@
DIST=@dist_type@
NRPE_USER=@nrpe_user@
NRPE_GROUP=@nrpe_group@
NAGIOS_USER=@nagios_user@
NAGIOS_GROUP=@nagios_group@
INIT_TYPE=@init_type@
INIT_DIR=$(DESTDIR)@initdir@
2016-06-24 12:21:25 +02:00
INIT_OPTS=-o root -g root
2017-05-04 11:53:58 +02:00
INIT_FILE=@initname@
INETD_TYPE=@inetd_type@
INETD_DIR=$(DESTDIR)@inetddir@
INETD_FILE=@inetdname@
SRC_INETD=@src_inetd@
SRC_INIT=@src_init@
default:
@echo;\
echo Please enter 'make [option]' where [option] is one of:;\
echo;\
echo " all builds nrpe and check_nrpe";\
echo " nrpe builds nrpe only";\
echo " check_nrpe builds check_nrpe only";\
echo " install-groups-users add the users and groups if they do not exist";\
echo " install install nrpe and check_nrpe";\
echo " install-plugin install the check_nrpe plugin";\
echo " install-daemon install the nrpe daemon";\
echo " install-config install the nrpe configuration file";\
echo " install-inetd install the startup files for inetd, launchd, etc.";\
echo " install-init install the startup files for init, systemd, etc.";\
echo
2016-06-24 12:21:25 +02:00
all:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE)
@echo "";\
echo "*** Compile finished ***";\
echo "";\
echo "You can now continue with the installation or upgrade process.";\
echo "";\
2017-05-13 13:05:54 +02:00
echo "Read the PDF documentation (docs/NRPE.pdf) for information on the next";\
2017-05-04 11:53:58 +02:00
echo "steps you should take to complete the installation or upgrade.";\
echo ""
2016-06-24 12:21:25 +02:00
nrpe:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE)
2016-06-24 12:21:25 +02:00
check_nrpe:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE)
2016-06-24 12:21:25 +02:00
install-plugin:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE) $@
2016-06-24 12:21:25 +02:00
install-daemon:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE) $@
2016-06-24 12:21:25 +02:00
install:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE) $@
2016-06-24 12:21:25 +02:00
2017-05-04 11:53:58 +02:00
install-init:
@if test $(SRC_INIT) = unknown; then \
echo No init file to install; \
exit 1; \
fi
@if test $(INIT_TYPE) = upstart; then\
echo $(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
echo initctl reload-configuration; \
initctl reload-configuration; \
elif test $(INIT_TYPE) = systemd; then\
echo $(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
elif test $(INIT_TYPE) = smf10 -o $(INIT_TYPE) = smf11; then \
echo $(INSTALL) -m 775 -g sys -d $(INIT_DIR);\
$(INSTALL) -m 775 -g sys -d $(INIT_DIR);\
echo $(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
$(INSTALL) -m 644 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
echo svccfg import $(INIT_DIR)/$(INIT_FILE); \
svccfg import $(INIT_DIR)/$(INIT_FILE); \
echo "*** Run 'svcadm enable nrpe' to start it"; \
2017-11-02 09:55:48 +01:00
elif test $(INIT_TYPE) = gentoo; then\
$(INSTALL) -m 755 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
echo rc-update add nrpe default; \
rc-update add nrpe default; \
2017-05-04 11:53:58 +02:00
else\
echo $(INSTALL) -m 755 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
$(INSTALL) -m 755 startup/$(SRC_INIT) $(INIT_DIR)/$(INIT_FILE); \
if test $(INIT_TYPE) = newbsd; then\
if test $(DIST) = openbsd; then\
echo "# nrpe@bsd_enable@=NO" >> /etc/rc.conf;\
echo "nrpe@bsd_enable@=\"-d -c $(CFGDIR)/nrpe.cfg\"" >> /etc/rc.conf;\
echo "Make sure to enable the nrpe daemon";\
else\
echo "nrpe@bsd_enable@=YES" >> /etc/rc.conf;\
echo "nrpe_configfile=$(CFGDIR)/nrpe.cfg" >> /etc/rc.conf;\
fi;\
elif test $(INIT_TYPE) = launchd; then\
launchctl load $(INIT_DIR)/$(INIT_FILE); \
else\
if test -f /sbin/chkconfig ; then \
2017-05-13 13:05:54 +02:00
case "$(DESTDIR)" in */rpmbuild/*) break;; \
*)/sbin/chkconfig nrpe on;; \
esac; \
2017-05-04 11:53:58 +02:00
else\
echo "Make sure to enable the nrpe daemon";\
fi;\
fi;\
fi
install-inetd:
@if test $(SRC_INETD) = unknown; then \
echo No inetd file to install; \
exit 1; \
fi
@if test $(INETD_TYPE) = inetd; then \
$(EGREP) -q "^\W*nrpe\s+" $(INETD_DIR)/$(INETD_FILE) 2>/dev/null || \
cat startup/$(SRC_INETD) >> $(INETD_DIR)/$(INETD_FILE); \
elif test $(INETD_TYPE) = systemd; then \
SRC_INETD_FILE=`echo "$(SRC_INETD)" | sed -e 's/socket/socket-svc/'`; \
echo $(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
$(INSTALL) -m 644 startup/$$SRC_INETD_FILE $(INETD_DIR)/$(INIT_FILE); \
elif test $(INETD_TYPE) = smf10 -o $(INETD_TYPE) = smf11; then \
echo $(INSTALL) -m 775 -g sys -d $(INETD_DIR);\
$(INSTALL) -m 775 -g sys -d $(INETD_DIR);\
echo $(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
$(INSTALL) -m 775 -d $(INETD_DIR);\
echo svccfg import $(INETD_DIR)/$(INETD_FILE); \
svccfg import $(INETD_DIR)/$(INETD_FILE); \
echo "*** Run 'svcadm enable nrpe' to start it"; \
elif test $(INIT_TYPE) = launchd; then\
$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
launchctl load $(INETD_DIR)/$(INETD_FILE); \
else\
echo $(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
$(INSTALL) -m 644 startup/$(SRC_INETD) $(INETD_DIR)/$(INETD_FILE); \
fi
@$(EGREP) -q "^nrpe[\t ]+@nrpe_port@/tcp" /etc/services || \
echo "***** MAKE SURE 'nrpe @nrpe_port@/tcp' IS IN YOUR /etc/services FILE"
2016-06-24 12:21:25 +02:00
2017-05-04 11:53:58 +02:00
install-config:
$(INSTALL) -m 775 $(NAGIOS_INSTALL_OPTS) -d $(CFGDIR)
$(INSTALL) -m 644 $(NRPE_INSTALL_OPTS) sample-config/nrpe.cfg $(CFGDIR)
2016-06-24 12:21:25 +02:00
2017-05-04 11:53:58 +02:00
install-groups-users:
@macros/add_group_user $(DIST) $(NAGIOS_USER) $(NAGIOS_GROUP)
@if test "$(NAGIOS_USER)" != "$(NRPE_USER)" -o "$(NAGIOS_GROUP)" != "$(NRPE_GROUP)"; then\
macros/add_group_user $(DIST) $(NRPE_USER) $(NRPE_GROUP);\
2016-06-24 12:21:25 +02:00
fi
clean:
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE) $@; cd ..
2016-06-24 12:21:25 +02:00
rm -f core
rm -f *~ */*~
distclean: clean
2017-05-04 11:53:58 +02:00
cd $(SRC_BASE); $(MAKE) $@; cd ..
rm -rf autom4te.cache
rm -f config.log config.status config.cache sample-config/nrpe.cfg $(SRC_INCLUDE)/config.h
rm -f startup/bsd-init startup/debian-init startup/default-init startup/default-inetd
rm -f startup/default-service startup/default-socket startup/default-socket-svc
rm -f startup/default-xinetd startup/mac-init.plist startup/mac-inetd.plist
rm -f startup/newbsd-init startup/openbsd-init startup/openrc-conf
rm -f startup/openrc-init startup/rh-upstart-init startup/solaris-init.xml
rm -f startup/solaris-inetd.xml startup/tmpfile.conf startup/upstart-init
rm -f nrpe.spec uninstall include/common.h
2016-06-24 12:21:25 +02:00
rm -f Makefile
devclean: distclean