#!/usr/bin/make -f

export PERL_HASH_SEED = 0

TEXI2HTML = texi2html --init-file debian/texi2html.rc --split chapter --verbose

%:
	dh $@

# configure script does not accept usual --build, etc. options.
# Scheme sources should be installed in /usr/share not /usr/lib.
override_dh_auto_configure:
	./configure --prefix=/usr --libdir=/usr/share

override_dh_auto_build:
	touch clrnamdb.scm  # clrnamdb.scm does not need to be rebuilt
	dh_auto_build
	$(MAKE) slib.info
	$(MAKE) TEXI2HTML="$(TEXI2HTML)" html

override_dh_install:
	dh_install
	# Remove unwanted info/dir.gz
	rm -f debian/slib/usr/share/info/dir*
	# Remove configure script, etc. installed by upstream makefile
	for i in configure slib.sh syncase.sh Makefile slib.nsi slib.spec; do \
	  rm -f debian/slib/usr/share/slib/$$i; \
	done
