#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

clean:
	dh $@ -Xavelsieve.po.bak

override_dh_installchangelogs:
	dh_installchangelogs doc/NEWS
	find . -type f -not \( \
		-path '*/debian/*' -or \
		-path '*/doc/*' -or \
		-path '*/po/*' -or \
		-path '*/locale/*' -or \
		-path '*/.pc/*' -or \
		-name 'version' -or \
		-name '*.po*' -or \
		-name 'config_sample.php' -or \
		-name '.cvsignore' \
		\) -exec install -D --mode=644 {} $(TMP)/usr/share/squirrelmail/plugins/avelsieve/{} \;
	find locale -type f -name '*.mo' \
		-exec install -D --mode=644 {} $(TMP)/usr/share/squirrelmail/plugins/avelsieve/{} \;
	install -D --mode=644 config/config_sample.php $(TMP)/etc/squirrelmail/avelsieve-config.php

%:
	dh $@
