#!/usr/bin/make -f
#export DH_VERBOSE=1

VERSION=`grep '^\$$version' $(CURDIR)/reformat | sed 's/.*"\([0-9]*\)".*/\1/'`
INSTDIR=$(CURDIR)/debian/reformat
INSTALL=/usr/bin/install -c

build-arch: build
build-indep: build
build:
	dh_testdir
	/usr/bin/pod2man -c reformat -r 'reformat '$(VERSION) reformat reformat.1

clean:
	dh_testdir
	dh_testroot
	rm -f reformat.1
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_prep 
	dh_installdirs
	$(INSTALL) -m 644 -D reformat.1 $(INSTDIR)/usr/share/man/man1/reformat.1
	$(INSTALL) -m 755 -D reformat $(INSTDIR)/usr/bin/reformat


binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installman
	dh_compress
	dh_fixperms
	dh_perl
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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