#!/usr/bin/make -f

# Verbose mode
export DH_VERBOSE=1

PYTHON := python2.5

clean:
	dh_testdir
	dh_testroot

	rm -f build-stamp install-stamp
	rm -rf build

	dh_clean

build: build-stamp
build-stamp:
	dh_testdir

	$(PYTHON) setup.py build

	touch build-stamp

install: build-stamp
	dh_testdir
	dh_installdirs

	$(PYTHON) setup.py install --root $(CURDIR)/debian/python-boto \
		--install-scripts usr/share/doc/python-boto/examples/

	for f in `find $(CURDIR)/debian/python-boto -name test_\*.py`; do \
	    sed -e '\,^#!/usr/bin/env python,d' < $$f > $$f.tmp; \
	    mv $$f.tmp $$f; \
	done

	touch install-stamp


binary-arch:
binary-indep: install
	dh_installdocs README doc/*.txt
	dh_installexamples cq.py tests
	dh_installchangelogs
	dh_compress
	dh_fixperms
#	dh_pysupport
	dh_gencontrol
	dh_installdeb
	dh_md5sums
	dh_builddeb

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary

