#!/usr/bin/make -f

VERSION=0.6.7
PYVERS:=$(shell pyversions -vr)


%:
	dh $@ --with=python2,sphinxdoc

override_dh_auto_build:
	dh_auto_build
	http_proxy='localhost' make -C docs/build html

override_dh_auto_clean:
	dh_auto_clean
	make -C docs/build clean
	rm -rf build

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

help2man:
	help2man --version-string=$(VERSION) -n "lightweight database migration tool for usage with the SQLAlchemy" -N alembic > alembic.1
	sed -i "s/,\(\w\)/, \1/g" alembic.1
