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

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

unexport HOME

PKGDIR:=$(CURDIR)/debian/vice

override_dh_auto_configure:
	./configure \
		--prefix=/usr --infodir=/usr/share/info \
		--mandir=/usr/share/man \
		--enable-gnomeui3 --enable-ethernet \
		--enable-fullscreen --enable-parsid --with-midas \
		--without-xaw3d \
		--enable-arch=no

override_dh_auto_build:
	$(MAKE) intl2po -C po/
	$(MAKE) trans-update -C po/
	$(MAKE) -C po/
	$(MAKE)
	dh_auto_build

override_dh_install:
	dh_install
	# remove extra licence file
	rm -f $(PKGDIR)/usr/lib/vice/doc/COPYING
	rm -rf $(PKGDIR)/usr/share/info/
	# remove ROM 'dummy' placeholders
	find $(PKGDIR)/usr/lib/vice -size 6c -exec rm {} \;
	# remove duplicated documentation
	rm -rf $(PKGDIR)/usr/lib/vice/doc/
	ln -sf vice_toc.html $(PKGDIR)/usr/share/doc/vice/html/index.html
	ln -sf ../../share/doc/vice/html $(PKGDIR)/usr/lib/vice/doc

%:
	dh $@ --with autoreconf

.PHONY: override_dh_auto_configure override_dh_auto_build override_dh_install
