#!/usr/bin/make -f
# -*- makefile -*-

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

DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl
XP=xsltproc -''-nonet -''-param man.charmap.use.subset "0"

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --bindir=/usr/games \
		--libdir=/usr/lib/games/xsystem35 \
		--enable-audio=default,alsa,oss,esd \
		--enable-cdrom=default,linux,mp3 \
		--enable-midi=extp,raw,seq \
		--enable-pkg-config \
		--enable-debug \
		--with-ft-exec-prefix=$(CURDIR)/debian \
		LDFLAGS="$(LDFLAGS) -lX11 -lltdl" \
		ESD_CONFIG=$(CURDIR)/debian/esd-config \
		--disable-esdtest

override_dh_auto_build: xsystem35.6
	dh_auto_build
	chrpath -d $(CURDIR)/src/xsystem35

override_dh_auto_install:
	dh_auto_install
	find $(CURDIR)/debian/xsystem35/usr/lib -name "*.la" -exec rm {} \;

override_dh_installdocs:
	dh_installdocs -XChangeLog

xsystem35.6: debian/xsystem35.xml
	$(XP) $(DB2MAN) $<