#!/usr/bin/make -f

-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

# don't strip translated pages
export NO_PKG_MANGLE=1

%:
	dh $@ --with gnome

override_dh_auto_install:
	dh_auto_install
	for d in $(CURDIR)/debian/ubuntu-docs/usr/share/help/*; do \
		cd "$$d"; \
		rm ubuntu-help/legal.xml; \
		mv ubuntu-help gnome-help; \
		for s in gnome-help/figures/*; do \
			if [ -h "$$s" ]; then \
				target=$$(readlink "$$s"); \
				ln -sf $$(echo $$target | sed s/ubuntu-help/gnome-help/) "$$s"; \
			fi \
		done \
	done
