Code

Separation of root setuid plugins into plugins-root/
[nagiosplug.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
3 SUBDIRS = intl lib plugins plugins-scripts plugins-root m4 po
5 EXTRA_DIST = config.rpath \
6         ABOUT-NLS ACKNOWLEDGEMENTS AUTHORS BUGS CHANGES CODING FAQ LEGAL \
7         REQUIREMENTS SUPPORT THANKS \
8         NPTest.pm contrib pkg nagios-plugins.spec \
9         config_test/Makefile config_test/run_tests config_test/child_test.c
11 ACLOCAL_AMFLAGS = -I m4
13 localedir = $(datadir)/locale
14 DEFS = -DLOCALEDIR=\"$(localedir)\"
16 dist-hook:
17         make THANKS nagios-plugins.spec pkg/fedora/nagios-plugins.spec
19 install-root:
20         cd plugins-root && $(MAKE) $@
22 test:
23         cd plugins; $(MAKE) test
24         cd plugins-scripts; $(MAKE) test
26 nagios-plugins.spec: nagios-plugins.spec.in
27         sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;s/^%%{requires}$$//" $? > $@
29 pkg/fedora/nagios-plugins.spec: nagios-plugins.spec.in
30         $(top_srcdir)/mkinstalldirs pkg/fedora
31         sed "s/%%{VERSION}/${VERSION}/;s/%%{RELEASE}/${RELEASE}/;/^# Requires$$/r $(top_srcdir)/pkg/fedora/requires" $? > $@
33 # Solaris pkgmk
34 BUILDDIR = build-solaris
35 PACKDIR = build-pkg
36 PKGSCRIPT = pkg/solaris/solpkg
38 solpkg:
39         if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
40         if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
41         $(MAKE) all
42         $(MAKE) DESTDIR=$$PWD/$(BUILDDIR) install
43         $(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
44         cd $(BUILDDIR) && $(PERL) ../$(PKGSCRIPT) ../$(PACKDIR)
46 THANKS: THANKS.in
47         @echo "This software is brought to you by the Nagios Plugins Development Team. However," > $@
48         @echo "there have been many contributors to this project. Everyone below has helped in " >> $@
49         @echo "raising bug reports, creating patches or contributing new plugins." >> $@
50         @echo "" >> $@
51         perl -e ' while (<>) { print STDERR "Duplicate: $$_",$$/ if ($$a{$$_}) ; $$a{$$_}++}; print sort by_last_field (keys %a); sub by_last_field { ($$a1) = $$a =~ /\s(\w+)$$/; ($$b1) = $$b =~ /\s(\w+)$$/; $$a1 cmp $$b1}' $? >> $@
53 pkgclean:
54         rm -rf $(BUILDDIR) $(PACKDIR)