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

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

%:
	dh  $@ --with autoreconf

override_dh_install:
	rm `find debian/tmp -name '*.la'`
	d-shlibmove --commit \
		    --multiarch \
		    --override s/libpopt0-dev/libpopt-dev/ \
		    --override s/libprotobuf7-dev/libprotobuf-dev/ \
		    --override s/libprotobuf8-dev/libprotobuf-dev/ \
		    --override s/libbz2-1.0-dev/libbz2-dev/ \
		    --movedev debian/tmp/usr/include/* usr/include \
		    debian/tmp/usr/lib/*/libanfo.so
	dh_install

override_dh_installman:
	dh_installman
	# delete unused manpage
	find debian/anfo -name anfo-sge.1 -delete

# ./scm files should not be executable
override_dh_fixperms :
	dh_fixperms
	find debian/anfo -perm -5 -type f \( -name '*.scm' \)  -print0 2>/dev/null | xargs -0r chmod 644	
