#! /usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
#
# Modified for dpkg-mountable Andy Mortimer 27/1/97

package=dpkg-mountable
install:=/usr/bin/install

build:	logcmd.c
	$(checkdir)
	gcc -O2 -g -Wall -I/usr/include/bsd logcmd.c -o logcmd -lutil -lbsd-compat
	touch build

binary-arch:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	$(install) -d debian/tmp/usr/doc/$(package)
	$(install) -d debian/tmp/usr/lib/dpkg/methods/mountable
	$(install) updated-packages install setup update debian/tmp/usr/lib/dpkg/methods/mountable
	$(install) -s logcmd debian/tmp/usr/lib/dpkg/methods/mountable
	$(install) -m 644 names desc.mountable generic debian/tmp/usr/lib/dpkg/methods/mountable
	$(install) -d debian/tmp/var/lib/dpkg/methods/mountable
	debstd
	dpkg-gencontrol
	dpkg --build debian/tmp ..

binary-indep:	checkroot build
	$(checkdir)

clean:
	$(checkdir)
	-rm -rf *~ debian/tmp debian/*~ debian/files* build

define checkdir
	test -f desc.mountable -a -f debian/rules
endef

binary:	binary-indep	binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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