#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pysupport
DEB_PACKAGES = tcosmonitor  tcosmonitor-common
DEB_ALL_PACKAGES= tcosmonitor tcosmonitor-common

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

# cdbs is confused if more than one binary package is build:
DEB_DESTDIR=$(CURDIR)/debian/tmp

cleanbuilddir/tcosmonitor::
	$(MAKE) -C po clean

#clean::
#	$(MAKE) clean

# test if __VERSION__ is not parsed and fail
install/tcosmonitor::
	@if [ `find $(CURDIR)/debian/tmp/ -name "*.py" | xargs grep __VERSION__ | wc -l` != 0 ]; then \
		echo "__VERSION__ unparsed"; \
		find *.py | xargs grep __VERSION__;\
		exit 1; \
	fi


binary-predeb/tcosmonitor-common::
	# link doc
	rm -rf debian/tcosmonitor/usr/share/doc/tcosmonitor
	ln -s tcosmonitor-common debian/tcosmonitor/usr/share/doc/tcosmonitor

