#!/usr/bin/make -f

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

%:
	dh $@

override_dh_auto_build:
	$(MAKE)
	$(MAKE) -C doc all
	$(MAKE) -C uiop/doc all
	ln -sf build/asdf.lisp .

override_dh_fixperms:
	dh_fixperms
	chmod 644 debian/cl-asdf/usr/share/common-lisp/source/cl-asdf/tools/asdf-tools

# Extensive tests are performed before release of the orig.tgz on
# different Common Lisp implementations.
#
# Testing asdf on Debian should include testing with all Common Lisp
# implementations which are available on Debian and requires Debian
# packaging of all libraries which are used during testing.
#
# This is a definitely a goal for the future, but beyond the scope of
# the current package maintainer.
#
# See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809308#29
#
override_dh_auto_test:

# do not invoke make install: it tries to upload the tarball to
# common-lisp.net
override_dh_auto_install:

override_dh_install:
	dh_install
	rm -r debian/cl-asdf/usr/share/common-lisp/source/cl-asdf/uiop/doc/
	rm debian/cl-asdf/usr/share/common-lisp/source/cl-asdf/contrib/fiveam-asdf/license.txt

override_dh_installdocs:
	dh_installdocs
	# Rename uiop/README.md to avoid overriding the main README.md
	mv debian/cl-asdf/usr/share/common-lisp/source/cl-asdf/uiop/README.md \
		debian/cl-asdf/usr/share/doc/cl-asdf/README-uiop.md
