#!/usr/bin/make -f
#-*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess.

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

# Test that the update was done while the man page was updated
# according to new changes in the source, too
DVERSION=$(shell dpkg-parsechangelog | grep '^Version: ' | cut -d' ' -f2)
MVERSION=$(shell grep 'up-to-date with version ' apt-zip.sgml | tr -s 'a-zA-Z-' ' ' | tr -d ' ' )


build: build-stamp
build-stamp:
	dh_testdir

	$(MAKE)
	test "$$DEV" = "yes" -o "${DVERSION}" = "${MVERSION}" || \
		echo 'WARNING: The man page seems to be outdated, but it would be good to update it; Continuing, anyway...'

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	-$(MAKE) clean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) DESTDIR=`pwd`/debian/`dh_listpackages` install


# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs ENHANCEMENTS
	dh_installexamples
	dh_installman
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

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

