version from git filters
[dbuscron] / Makefile
1
2 DESTDIR ?= 
3 PYMODULES ?= $(DESTDIR)/usr/lib/pymodules/python2.5
4 PREFIX ?= $(DESTDIR)/usr/bin
5 PYVERSION ?= 2.5
6
7 BINFILES = dbuscron.py dbuscrontab.py migrate-dbus-scripts.py
8
9 .SUFFIXES: .py .pyo
10
11 compile: .py.pyo
12
13 .py.pyo:
14         python$(PYVERSION) -O -m compileall ./dbuscron
15
16 install: compile
17         for f in $(BINFILES); do \
18                 install -o root -g root -m 0755 ./$$f $(PREFIX)/`basename $$f .py`; done
19         install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron/shell
20         for f in `find ./dbuscron -name "*.pyo"`; do \
21                 install -o root -g root -m 0644 $$f $(PYMODULES)/$$f; done
22         install -o root -g root -m 0644 ./event.d/dbuscron $(DESTDIR)/etc/event.d/dbuscron
23         test -f $(DESTDIR)/etc/dbuscrontab || \
24                 install -o root -g root -m 0644 ./doc/dbuscrontab $(DESTDIR)/etc/dbuscrontab
25         @echo ""
26         @echo "Installation complete. Run \`dbuscrontab -e' to edit config file,"
27         @echo "then run \`initctl start dbuscron' to start dbuscron daemon."
28
29 uninstall:
30         -initctl stop dbuscron
31         rm -rf $(PYMODULES)/dbuscron
32         rm -f $(PREFIX)/dbuscron $(PREFIX)/dbuscrontab
33         rm -f $(DESTDIR)/etc/event.d/dbuscron
34
35 clean:
36         find ./dbuscron -name "*.py[co]" | xargs rm -f 
37
38 debclean:
39         debclean
40         rm -rf ./debian/patches ./debian/dbuscron
41         rm -rf ./.pc
42
43 deb: debclean
44         debuild binary-indep
45
46 build: debclean
47         ./genchangelog $(B)
48         git commit -m "changelog updated" ./debian/changelog
49         git tag -f v$(B)
50         git push -f origin v$(B)
51         $(MAKE) deb
52
53 tarball:
54         git archive --format=tar v$(B) | gzip -9 > ../dbuscron_$(B:.0=).orig.tar.gz
55
56 .PHONY: install uninstall clean debclean deb build compile
57