#!/usr/bin/make -f

%:
	dh $@ --with sphinxdoc

override_dh_auto_install:
	dh_auto_install
	set -ex; for langdir in debian/tmp/usr/share/doc/debian-policy/*/policy.html; do	\
		lang=$${langdir%%/policy.html};							\
		lang=$${lang##*/};								\
		mkdir -p debian/debian-policy-$$lang/usr/share/doc/debian-policy;		\
		mv debian/tmp/usr/share/doc/debian-policy/$$lang				\
			debian/debian-policy-$$lang/usr/share/doc/debian-policy;		\
	done
	mv debian/tmp/* debian/debian-policy/
#	this file is not referenced by any HTML pages and we have no
#	idea what it does, so just delete it until further
#	investigation is possible
	rm -f debian/debian-policy/usr/share/doc/debian-policy/policy.html/_static/websupport.js
