#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

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

build:
# Nothing to do.

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

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

# Build architecture-independent files here.
binary-indep: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs usr/bin
	install dpkg-repack debian/dpkg-repack/usr/bin
	dh_installdocs README
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installmanpages
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')

# Update the debhelper web page. Not intended for use by anyone except the
# author.
installhook:
	rm /home/ftp/pub/code/dpkg-repack/* || true
	cp debian/changelog /home/pub/programs/dpkg-repack/CHANGES
	echo -n $(VERSION) > /home/pub/programs/dpkg-repack/LATEST-VERSION-IS
	cd /home/ftp/pub/code/dpkg-repack; \
		ln -sf ../debian/dpkg-repack_$(VERSION).tar.gz dpkg-repack_$(VERSION).tar.gz; \
		ln -sf ../debian/dpkg-repack_$(VERSION).tar.gz dpkg-repack.tar.gz; \

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