#!/usr/bin/make -f
#
# debian/rules file for srm-reader
# Copyright (C) 2003 Alastair McKinstry, <mckinstry@debian.org>
# $Id: rules,v 1.4 2003/10/16 23:09:08 goswin Exp $

export DH_VERBOSE=1
PACKAGE=srm-reader
VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
ARCH=alpha
FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb

export DH_COMPAT=3

# Udebs have no postrm file, don't make one
export DH_OPTIONS=-n

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-$(MAKE) clean
	dh_clean

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	$(MAKE)
	touch build-stamp

install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/debian/srm-reader
	dh_link /usr/bin/srm-reader /etc/rcS.d/S40srm-reader

# Build architecture-independent files here.
binary-indep:

# Build arch-dependent files here
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_fixperms
	dh_gencontrol -- -n$(FILENAME)
	dh_builddeb --filename=$(FILENAME)

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

