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

version = $(shell dpkg-parsechangelog | sed -nre 's/^Version: (.*)-.*/\1/p')

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

libpath = Project/GNU/Library

override_dh_auto_configure:
	dh_auto_configure -D$(libpath) --	\
		--enable-shared			\
		--disable-static

override_dh_auto_build:
	cd Source/Doc && doxygen Doxyfile
	cp Source/Doc/*.html ./

	sed -i -e 's|Version: |Version: $(version)|g' Project/GNU/Library/libzen.pc

	dh_auto_build -D$(libpath)

override_dh_auto_clean:
	dh_auto_clean -D$(libpath)
	rm -rf Doc/ *.html

override_dh_auto_install:
	dh_auto_install -D$(libpath)

override_dh_installdocs:
	dh_installdocs
	fromdos debian/*/usr/share/doc/*/*.txt

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

%:
	dh $@ --with=autoreconf --parallel
