-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
+.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`
+ 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)/{}