X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=Makefile;h=53b6053f60a583451a4eaf9d56e6b6706721231b;hb=5a330402bcc1fd3904d22439f1eb031f863223a8;hp=cf21aae6e6a3ec0c9d6fee3f11d72e4953ac3d63;hpb=8bc267c0c3e49a946f9d741aae60f069b3e8dda5;p=dbuscron diff --git a/Makefile b/Makefile index cf21aae..53b6053 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,29 @@ -PYMODULES ?= /usr/lib/pymodules/python2.5 -PREFIX ?= /usr/bin -PYSUFFIX = `test -e ./dbuscron/__init__.pyo && echo pyo || echo pyc` - -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 0644 ./dbuscron/*.$(PYSUFFIX) $(PYMODULES)/dbuscron - install -o root -g root -m 0644 ./event.d/dbuscron /etc/event.d/dbuscron - touch /etc/dbuscrontab +DESTDIR ?= +PYMODULES ?= $(DESTDIR)/usr/lib/pymodules/python2.5 +PREFIX ?= $(DESTDIR)/usr/bin +PYVERSION ?= 2.5 + +BINFILES = dbuscron.py dbuscrontab.py migrate-dbus-scripts.py + +.SUFFIXES: .py .pyo + +compile: .py.pyo + +.py.pyo: + sed -i.bak -e "s/%VERSION%/`git describe --tags`/" ./dbuscron/__init__.py + python$(PYVERSION) -O -m compileall ./dbuscron + mv -f ./dbuscron/__init__.py.bak ./dbuscron/__init__.py + +install: compile + for f in $(BINFILES); do \ + install -o root -g root -m 0755 ./$$f $(PREFIX)/`basename $$f .py`; done + install -o root -g root -m 0755 -d $(PYMODULES)/dbuscron/shell + find ./dbuscron -name "*.pyo" | xargs -I {} install -o root -g root -m 0644 {} $(PYMODULES)/{} + install -o root -g root -m 0644 ./event.d/dbuscron $(DESTDIR)/etc/event.d/dbuscron + test -f $(DESTDIR)/etc/dbuscrontab || \ + install -o root -g root -m 0644 ./doc/dbuscrontab $(DESTDIR)/etc/dbuscrontab + @echo "" @echo "Installation complete. Run \`dbuscrontab -e' to edit config file," @echo "then run \`initctl start dbuscron' to start dbuscron daemon." @@ -18,4 +31,25 @@ uninstall: -initctl stop dbuscron rm -rf $(PYMODULES)/dbuscron rm -f $(PREFIX)/dbuscron $(PREFIX)/dbuscrontab - rm -f /etc/event.d/dbuscron + rm -f $(DESTDIR)/etc/event.d/dbuscron + +clean: + 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: install uninstall clean debclean deb build compile +