#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file for altree
# Andreas Tille <tille@debian.org>
# GPL

%:
	dh $@

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
execute_before_dh_auto_clean:
	$(MAKE) -C Documentation distclean || true

execute_before_dh_auto_build:
	$(MAKE) -C Documentation pdf

override_dh_compress:
	dh_compress --exclude=.pdf
endif # !nodoc

INSTALL_DIR != echo debian/altree/usr/lib/*/perl*/*/ALTree/
NATIONAL_ENCODING = Chi2.pm Import.pm Input.pm Node.pm SitePerForet.pm
NATIONAL_ENCODING+= SiteSensPerTree.pm Tree.pm to_rewrite.pm
execute_after_dh_install-arch:
	set -e \
	; cd $(INSTALL_DIR) \
	; for file in $(NATIONAL_ENCODING) \
	; do iconv -f ISO-8859-1 -t UTF-8 < "$${file}" > "$${file}.conv" \
	;    mv -vf "$${file}.conv" "$${file}" \
	; done
