#!/usr/bin/make -f

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

installfile = install -g root -o root -m 644
installdir = install -g root -o root -m 755

mandir = `pwd`/debian/tmp/usr/share/man/fi

build:
	dh_testdir
	# Nothing to do.

clean:
	dh_testdir
	dh_testroot
	dh_clean

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -d debian/tmp
#	cp -a `ls |grep -v debian` debian/tmp
#
	dh_installdocs
#	dh_installexamples

	$(installdir) -d $(mandir)
		#debian/tmp/usr/share/man/fi
	for section in 1 5 6 8; do \
	  $(installdir) -d $(mandir)/man$$section ; \
	  for file in `(cd usr/man/fi/man$$section && ls *.$$section*)` ; do \
	    $(installfile) usr/man/fi/man$$section/$$file $(mandir)/man$$section/$$file ; \
	  done ; \
	done
	rm -f $(mandir)/man1/{man,apropos,whatis,AnotherLevel,userinfo,userpasswd}.1

	dh_installchangelogs
	dh_compress -X.Z
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary
