parse config dirs and files transparently
[dbuscron] / Makefile
1
2 DESTDIR ?= 
3 PYMODULES ?= $(DESTDIR)/usr/lib/pymodules/python2.5
4 PREFIX ?= $(DESTDIR)/usr/bin
5 PYVERSION ?= 2.5
6
7 .SUFFIXES: .py .pyo
8
9 compile: .py.pyo
10
11 .py.pyo:
12         sed -i.bak -e "s/%VERSION%/`git describe --tags`/" ./dbuscron/__init__.py
13         python$(PYVERSION) -O -m compileall ./dbuscron
14         mv -f ./dbuscron/__init__.py.bak ./dbuscron/__init__.py
15
16 install: compile
17         install -o root -g root -m 0755 ./dbuscron.py $(PREFIX)/dbuscron
18         install -o root -g root -m 0755 ./dbuscrontab.py $(PREFIX)/dbuscrontab
19         install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron/shell
20         find ./dbuscron -name "*.pyo" | xargs -I {} install -o root -g root -m 0644 {} $(PYMODULES)/{}
21         install -o root -g root -m 0644 ./event.d/dbuscron $(DESTDIR)/etc/event.d/dbuscron
22         test -f $(DESTDIR)/etc/dbuscrontab || \
23                 install -o root -g root -m 0644 ./doc/dbuscrontab $(DESTDIR)/etc/dbuscrontab
24         @echo ""
25         @echo "Installation complete. Run \`dbuscrontab -e' to edit config file,"
26         @echo "then run \`initctl start dbuscron' to start dbuscron daemon."
27
28 uninstall:
29         -initctl stop dbuscron
30         rm -rf $(PYMODULES)/dbuscron
31         rm -f $(PREFIX)/dbuscron $(PREFIX)/dbuscrontab
32         rm -f $(DESTDIR)/etc/event.d/dbuscron
33
34 clean:
35         find ./dbuscron -name "*.py[co]" | xargs rm -f 
36
37 debclean:
38         debclean
39         rm -rf ./debian/patches ./debian/dbuscron
40         rm -rf ./.pc
41
42 deb: debclean
43         debuild binary-indep
44
45 build: debclean
46         ./genchangelog $(B)
47         git commit -m "changelog updated" ./debian/changelog
48         git tag -f v$(B)
49         git push -f origin v$(B)
50         $(MAKE) deb
51
52 .PHONY: install uninstall clean debclean deb build compile
53