Makefile: ignore error on existing config
[dbuscron] / Makefile
index 8098d0d..07af6fc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ DESTDIR ?=
 PYMODULES ?= $(DESTDIR)/usr/lib/pymodules/python2.5
 PREFIX ?= $(DESTDIR)/usr/bin
 PYSUFFIX = `test -e ./dbuscron/__init__.pyo && echo pyo || echo pyc`
+PYVERSION ?= 2.5
 
 all:
        @echo "No compilation needed."
@@ -11,10 +12,11 @@ install:
        install -o root -g root -m 0755 ./dbuscron.py $(PREFIX)/dbuscron
        install -o root -g root -m 0755 ./dbuscrontab.py $(PREFIX)/dbuscrontab
        install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron
-       python -c 'import dbuscron'
+       python$(PYVERSION) -O -c 'import dbuscron'
        install -o root -g root -m 0644 ./dbuscron/*.$(PYSUFFIX) $(PYMODULES)/dbuscron
        install -o root -g root -m 0644 ./event.d/dbuscron $(DESTDIR)/etc/event.d/dbuscron
-       touch $(DESTDIR)/etc/dbuscrontab
+       -test ! -f $(DESTDIR)/etc/dbuscrontab && \
+               install -o root -g root -m 0644 ./doc/dbuscrontab $(DESTDIR)/etc/dbuscrontab
        @echo "Installation complete. Run \`dbuscrontab -e' to edit config file,"
        @echo "then run \`initctl start dbuscron' to start dbuscron daemon."
 
@@ -25,5 +27,7 @@ uninstall:
        rm -f $(DESTDIR)/etc/event.d/dbuscron
 
 clean:
-       find . -name "*.py[co]" | xargs rm -f 
+       find ./dbuscron -name "*.py[co]" | xargs rm -f 
+
+.PHONY: all install uninstall clean