aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGuido G√ľnther <agx@sigxcpu.org>2008-11-20 14:17:14 +0100
committerGuido Guenther <agx@sigxcpu.org>2008-11-20 14:33:29 +0100
commitde0c1a3e21ce0bcf4eeed7bbf952a38c8983ef75 (patch)
tree8bdb326a40fb1590683cda2314e16a1ba47b64ea /Makefile
parent532cac06c0779ec953eeb474981c6348ee2a7d51 (diff)
detect script for autoconfiguration
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 20 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index f972c82..0054d77 100644
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,40 @@
VERSION=0.0.4
-PKG=munin-libvirt-plugins
-PLUGINDIR=/usr/share/munin/plugins/
+PACKAGE=munin-libvirt-plugins
+SBINDIR=/usr/sbin
+PLUGINDIR=/usr/share/munin/plugins
+MUNINCONFDIR=/etc/munin
PLUGINS=libvirt-cputime \
libvirt-blkstat \
libvirt-ifstat \
libvirt-mem
-ALL=$(PLUGINS) Makefile COPYING INSTALL
-PYFILES=$(patsubst %,%.py,$(PLUGINS))
+DETECT=$(PACKAGE)-detect
+PYFILES=$(patsubst %,%.py,$(PLUGINS) $(DETECT))
-install: $(PLUGINS)
+all: $(DETECT)
+
+install: build
install -d $(DESTDIR)$(PLUGINDIR)
install -m 755 $(PLUGINS) $(DESTDIR)$(PLUGINDIR)
+ install -m 755 $(DETECT) $(DESTDIR)$(SBINDIR)
+
+$(DETECT): $(DETECT).in
+ sed -e "s,::MUNINCONFDIR::,$(MUNINCONFDIR),"\
+ -e "s,::PLUGINDIR::,$(PLUGINDIR)," \
+ -e "s,::VERSION::,$(VERSION)," \
+ < $< > $@
%.py: %
ln -s $< $@
pychecker -q -e Error $@
-check: $(PYFILES)
+check: $(DETECT) $(PYFILES)
clean:
- rm -f *.py *.pyc
+ rm -f *.py *.pyc $(DETECT)
dist: clean check
- git-archive --format=tar --prefix=$(PKG)-$(VERSION)/ HEAD | gzip -c > ../$(PKG)-$(VERSION).tar.gz
+ git-archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD | gzip -c > ../$(PACKAGE)-$(VERSION).tar.gz
-.PHONY: clean check dist install
+.PHONY: clean check dist install build