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

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

# This is the debhelper compatability version to use.
export DH_COMPAT=2

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

PACKAGE=$(shell dh_listpackages)
VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
ARCH=$(shell dpkg --print-architecture)
FILENAME=$(PACKAGE)_$(VERSION)_all.udeb

build: 
build-stamp:

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	dh_clean

install-dirs:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	mkdir -p debian/$(PACKAGE)/usr/bin
	mkdir -p debian/$(PACKAGE)/lib/debian-installer-startup.d
	mkdir -p debian/$(PACKAGE)/dev/vc

install: install-dirs
	install S10userdevfs debian/$(PACKAGE)/lib/debian-installer-startup.d
	install init-dev debian/$(PACKAGE)/usr/bin
	install update-dev debian/$(PACKAGE)/usr/bin
	install subarch-dev debian/$(PACKAGE)/usr/bin

# Build architecture-independent files here.
#
# Note that this builds a .udeb, which is not policy compliant or anything.
binary-indep: install
	dh_testdir
	dh_testroot
	dh_fixperms
	dh_installdeb
	dh_gencontrol -- -n$(FILENAME)
	dh_builddeb --filename=$(FILENAME)

# Build architecture-dependent files here.
# No such packages, so don't do anything.
binary-arch: 

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