#!/usr/bin/make -f

%:
	dh $@ --with python2,sphinxdoc

.PHONY: override_dh_auto_build
override_dh_auto_build:
	PYTHONPATH=. sphinx-build -b html -d docs/.build/.doctrees -N docs docs/.build/html
	dh_auto_build

.PHONY: override_dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	set -e; \
	for python in $(shell pyversions -r); do \
	  $$python setup.py test ; \
	done
endif

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress -X .js -X .html

.PHONY: override_dh_clean
override_dh_clean:
	rm -rf docs/.build
	rm -rf kombu.egg-info/PKG-INFO
	dh_clean

.PHONY: override_dh_auto_install
override_dh_auto_install:
	dh_auto_install
	sed -i 's/Metadata-Version: 1\.0/Metadata-Version: 1\.1/' debian/tmp/usr/lib/python2.*/*-packages/kombu-1.4.3.egg-info/PKG-INFO
