#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYTHONPATH=$(abspath $(CURDIR))
PKGDIR=$(CURDIR)/debian/python-boto/

include /usr/share/python/python.mk

PYVERS := $(shell pyversions -r)

%:
	dh  $@ --with python2 --buildsystem=python_distutils

override_dh_auto_build:
	set -ex; \
	for python in $(PYVERS); do \
		$$python setup.py build; \
	done
	sphinx-build -b html docs/source debian/html
	rm -rf debian/html/_sources/
	rm -rf debian/html/.doctrees
	rm -f debian/html/.buildinfo
	rm -f debian/html/_static/jquery.js
	rm -f debian/html/_static/underscore.js

override_dh_install:
	python setup.py install --skip-build \
	 --install-layout=deb \
	 --root=$(PKGDIR)

override_dh_auto_test:
#	python tests/test.py

override_dh_compress:
	dh_compress -X.html -X.js -X.css -X.rst

clean:
	dh clean
	rm -rf boto.egg-info build debian/html
	find . \( -name '*.py[co]' -or -name '\._*' -or -name '\.DS_Store' \) -delete
