#! /usr/bin/make -f
#
# Debian rules extensively rewritten by Martin Mitchell <martin@debian.org>

ARCH = $(shell dpkg --print-installation-architecture)

build:
# Builds the binary package.
	make 
	touch build

clean:
# Undoes the effect of `make -f debian/rules build'.
	rm -f build
	rm -rf debian/tmp debian/substvars debian/files debian/*~
	make clean

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	test -f build || make -f debian.rules build
	rm -rf debian/tmp
	install -d -g root -m 755 -o root debian/tmp/DEBIAN \
	debian/tmp/usr/share/i18n-locale-resolver/ 
	install -m 755 debian/locale-resolver-extra.postinst debian/tmp/DEBIAN/postinst
	install -m 755 debian/locale-resolver-extra.postrm debian/tmp/DEBIAN/postrm
	cp im.data debian/tmp/usr/share/i18n-locale-resolver/im.data.new
	cp generic.data debian/tmp/usr/share/i18n-locale-resolver/generic.data.new
	cp lra_language.data debian/tmp/usr/share/i18n-locale-resolver/lra_language.data.new
	cp lra_regional.data debian/tmp/usr/share/i18n-locale-resolver/lra_regional.data.new
	dpkg-gencontrol -isp
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot
