# -*-makefile-*-
# JLdL 13May10.
#
# This makefile closes the "cluster-tools-client" package, as an
# _ "all" arch package; the main part of its structure is meant
# _ to install everything within the debian/package subdirectory.

# Edited for Debian GNU/Linux.
DESTDIR = 

# The package this makefile is meant for.
PACKAGE = cluster-tools-client

# Where the configuration file goes.
ETC = $(DESTDIR)/etc

# Where the user executables go.
CBIN = $(DESTDIR)/usr/bin

# Where the policy executable goes.
SBIN = $(DESTDIR)/usr/sbin

# Where the client library goes.
CLIB = $(DESTDIR)/lib/cluster

# Where the man pages go.
MANS = $(DESTDIR)/usr/share/man

# Where the additional documentation goes.
DOCS = $(DESTDIR)/usr/share/doc/$(PACKAGE)

# The configuration files.
CONFFILES = \
cluster.conf \
cluster.aliases \
kernel-img.conf

# The user executables.
CBINFILES = \
cdsh \
cjobs \
cruptime

# The policy executable.
SBINFILES = \
policy-rc.d

# The client library.
CLIBFILES = \
multi-apt-get-chroot.anchor \
multi-crontab-chroot.anchor \
multi-dpkg-chroot.anchor

# The user man pages.
MAN1FILES = \
cdsh.1.gz \
cjobs.1.gz \
cruptime.1.gz

# The file man pages.
MAN5FILES = \
cluster.conf.5.gz

# The description man pages.
MAN7FILES = \
cluster.7.gz

# Extra documentation files and directories.
DOCSFILES = \
debian/README.Debian

default:
	@echo "Nothing to do: no actual compilation is needed."

# Install files on the client.
install: $(MAN1FILES) $(MAN5FILES) $(MAN7FILES)
	@echo Installing the configuration files in $(ETC)/
	@mkdir -p $(ETC)/
	@cp -pf $(CONFFILES) $(ETC)/
	@echo Installing user executables in $(CBIN)/
	@mkdir -p $(CBIN)/
	@cp -pf $(CBINFILES) $(CBIN)/
	@echo Installing policy executable in $(SBIN)/
	@mkdir -p $(SBIN)/
	@cp -pf $(SBINFILES) $(SBIN)/
	@echo Installing the client library in $(CLIB)/
	@mkdir -p $(CLIB)/
	@cp -pf $(CLIBFILES) $(CLIB)/
	@echo Installing man pages in $(MANS)/man1/
	@mkdir -p $(NFSDIR)$(MANS)/man1/
	@cp -pf $(MAN1FILES) $(MANS)/man1/
	@echo Installing man pages in $(MANS)/man5/
	@mkdir -p $(NFSDIR)$(MANS)/man5/
	@cp -pf $(MAN5FILES) $(MANS)/man5/
	@echo Installing man pages in $(MANS)/man7/
	@mkdir -p $(MANS)/man7/
	@cp -pf $(MAN7FILES) $(MANS)/man7/
	@echo Installing additional documentation in $(DOCS)/
	@mkdir -p $(DOCS)/
	@cp -af $(DOCSFILES) $(DOCS)/

# Make the package.
package:
	dpkg-buildpackage -kE92A1F5C

# Clean up this directory.
clean:
	rm -f *~

