X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git;a=blobdiff_plain;f=Makefile;h=264532e51e4c9b0034f043eeb98ba6a5977af47c;hp=aad396b9058674eedba92723bf7db039a07dbcd7;hb=8e49e95c32862d2bcd56be4c229d65f7e70e7c58;hpb=6b76f2469e3b6ba5dfd12738cafcc33e64787c17 diff --git a/Makefile b/Makefile index aad396b..264532e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,19 @@ # # NagCollect -- Nagios Data Collector for Passive Checks -# Copyright (c)2009 Alexander Barton, alex@barton.de +# Copyright (c)2009-2011 Alexander Barton, alex@barton.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# Please read the file COPYING, README and AUTHORS for more information. # -all: +all: server client plugins clean: find . -name .DS_Store -delete + rm -rf client/lib/nagios distclean: clean @@ -16,7 +23,7 @@ install: install-all: install-server install-client -install-server: +install-server: server install -d -o nagios -g nagios -m 750 /var/lib/nagios3/collect [ -r /etc/nagios3/system.cfg ] || \ install -D -o nagios -g root -m 640 -p \ @@ -33,7 +40,7 @@ install-server: [ -r contrib/Makefile.`uname` ] \ && make -f contrib/Makefile.`uname` "install-server" || true -install-client: +install-client: client install -d -o 0 -g 0 -m 755 /usr/local/sbin install -c -o 0 -g 0 -m 755 -p \ client/bin/nagcollect /usr/local/sbin/nagcollect @@ -56,13 +63,45 @@ install-client: check: dist: distclean - dir=`basename $${PWD}` \ + rel=`grep "^NagCollect " ChangeLog|awk "{print \\\$$3 }"|head -n 1`; \ + dir=`basename $${PWD}` \ && cd .. \ - && COPYFILE_DISABLE=true tar cvzf "$${dir}.tar.gz" \ + && COPYFILE_DISABLE=true tar cvzf "NagCollect-R$${rel}.tar.gz" \ --exclude .git "$${dir}" distcheck: check dist +server: + +client: + +plugins: + mkdir -p client/lib/nagios/plugins + (cd client/lib/tests; (ls -1 *.tst; ls -1 `uname`/*.tst) | \ + while read x; do \ + name="check_nc_`basename "$$x" | cut -d'.' -f1 | tr '[A-Z]' '[a-z]'`"; \ + dest="../nagios/plugins/$$name"; \ + echo " * $$x -> $$name"; \ + cat "../wrapper/wrapper-top.sh" >"$$dest"; \ + cat "$$x" >>"$$dest"; \ + cat "../wrapper/wrapper-bottom.sh" >>"$$dest"; \ + chmod 755 "$$dest"; \ + done \ + ) + +osxpkg: + rel=`grep "^NagCollect " ChangeLog|awk "{print \\\$$3 }"|head -n 1`; \ + rm -rf "../NagCollect-R$${rel}.mpkg" \ + && packagemaker \ + --doc "contrib/NagCollect.pmdoc" \ + --out "../NagCollect-R$${rel}.mpkg" + +osxdmg: osxpkg + rel=`grep "^NagCollect " ChangeLog|awk "{print \\\$$3 }"|head -n 1`; \ + rm -f "../NagCollect-R$${rel}.dmg" \ + && hdiutil create -srcfolder \ + "../NagCollect-R$${rel}.mpkg" "../NagCollect-R$${rel}.dmg" + nagcollecttestscripts: COPYFILE_DISABLE=true tar -czvf nagcollecttestscripts.tgz \ -C client/lib/tests .