#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2003 Colin Walters <walters@verbum.org>

include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/gnome.mk
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

DEB_DH_AUTORECONF_ARGS = --as-needed

DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc \
			     --enable-vala \
			     --enable-introspection \
			     --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)

UNICODE_DATA_VERSION := $(shell dpkg-query -W -f'$${Version}' unicode-data | sed -e's/-.*//')
DEB_DH_GENCONTROL_ARGS_ALL = -- -VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W unicode-data)"

post-patches:: debian/stamp-gen-unicode-tables

debian/stamp-gen-unicode-tables:
	cd gucharmap && ./gen-guch-unicode-tables.pl $(UNICODE_DATA_VERSION) /usr/share/unicode
	touch debian/stamp-gen-unicode-tables

clean::
	rm -f intltool-extract intltool-merge intltool-update
	rm -f po/.intltool-merge-cache
	rm -f gucharmap/unicode-*.h
	rm -f debian/stamp-gen-unicode-tables

LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed
