Makefile: ignore error on existing config
[dbuscron] / Makefile
1
2 DESTDIR ?= 
3 PYMODULES ?= $(DESTDIR)/usr/lib/pymodules/python2.5
4 PREFIX ?= $(DESTDIR)/usr/bin
5 PYSUFFIX = `test -e ./dbuscron/__init__.pyo && echo pyo || echo pyc`
6 PYVERSION ?= 2.5
7
8 all:
9         @echo "No compilation needed."
10
11 install:
12         install -o root -g root -m 0755 ./dbuscron.py $(PREFIX)/dbuscron
13         install -o root -g root -m 0755 ./dbuscrontab.py $(PREFIX)/dbuscrontab
14         install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron
15         python$(PYVERSION) -O -c 'import dbuscron'
16         install -o root -g root -m 0644 ./dbuscron/*.$(PYSUFFIX) $(PYMODULES)/dbuscron
17         install -o root -g root -m 0644 ./event.d/dbuscron $(DESTDIR)/etc/event.d/dbuscron
18         -test ! -f $(DESTDIR)/etc/dbuscrontab && \
19                 install -o root -g root -m 0644 ./doc/dbuscrontab $(DESTDIR)/etc/dbuscrontab
20         @echo "Installation complete. Run \`dbuscrontab -e' to edit config file,"
21         @echo "then run \`initctl start dbuscron' to start dbuscron daemon."
22
23 uninstall:
24         -initctl stop dbuscron
25         rm -rf $(PYMODULES)/dbuscron
26         rm -f $(PREFIX)/dbuscron $(PREFIX)/dbuscrontab
27         rm -f $(DESTDIR)/etc/event.d/dbuscron
28
29 clean:
30         find ./dbuscron -name "*.py[co]" | xargs rm -f 
31
32 .PHONY: all install uninstall clean
33