support \xXX escape characters in args field
[dbuscron] / Makefile
index 8098d0d..41cbc01 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."
@@ -10,11 +11,14 @@ all:
 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'
+       install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron/shell
+       sed -i -e "s/%VERSION%/`git describe --tags`/" ./dbuscron/__init__.py
+       python$(PYVERSION) -O -c 'import dbuscron, dbuscron.shell.main, dbuscron.shell.edit'
        install -o root -g root -m 0644 ./dbuscron/*.$(PYSUFFIX) $(PYMODULES)/dbuscron
+       install -o root -g root -m 0644 ./dbuscron/shell/*.$(PYSUFFIX) $(PYMODULES)/dbuscron/shell
        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 +29,22 @@ uninstall:
        rm -f $(DESTDIR)/etc/event.d/dbuscron
 
 clean:
-       find . -name "*.py[co]" | xargs rm -f 
+       find ./dbuscron -name "*.py[co]" | xargs rm -f 
+
+debclean:
+       debclean
+       rm -rf ./debian/patches ./debian/dbuscron
+       rm -rf ./.pc
+
+deb: debclean
+       debuild binary-indep
+
+build: debclean
+       ./genchangelog $(B)
+       git commit -m "changelog updated" ./debian/changelog
+       git tag -f v$(B)
+       git push -f origin v$(B)
+       $(MAKE) deb
+
+.PHONY: all install uninstall clean debclean deb build