#!/usr/bin/make -f
# debian/rules for the Maemo xkbdata package.
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
# Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
# Copyright © 2005 David Nusinow <dnusinow@debian.org>

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

PACKAGE = xkbdata

DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

confflags += --with-xkb-base=/usr/share/X11/xkb --enable-xkbcomp-symlink \
             --disable-compat-rules --with-xkb-rules-symlink=xorg

build: build-stamp
build-stamp:
	dh_testdir

	mkdir obj-$(DEB_BUILD_GNU_TYPE)
	cd obj-$(DEB_BUILD_GNU_TYPE) && \
	../configure --prefix=/usr --mandir=\$${prefix}/share/man \
	             --infodir=\$${prefix}/share/info $(confflags)
	cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	rm -f build-stamp
	rm -f config.cache config.status config.log
	rm -rf autom4te.cache
	rm -rf obj-*

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/xkbdata install

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot

	dh_installdocs
	dh_installchangelogs
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

binary: binary-indep

.PHONY: build clean binary-indep binary-arch binary install
