# Hey emacs, use -*-Makefile-*- mode
######################################################################
# $Id: Makefile.dist,v 1.8 2003/07/29 17:00:07 edwinh Exp $
# $Name: v1_2_1 $
######################################################################

PREFIX=/usr

# Where the script binary should go
BINPATH = $(PREFIX)/bin
# Where the manpage should go
MANPATH = $(PREFIX)/share/man

# Where flexbackup.conf should be stored
CONFFILE = /etc/flexbackup.conf

# Where perl lives
PERLPATH = /usr/bin/perl

######################################################################

all: fb.install

install: all
	install -m 0644 flexbackup.conf $(CONFFILE)
	install -m 0755 fb.install $(BINPATH)/flexbackup
	install -m 0644 flexbackup.1 $(MANPATH)/man1/flexbackup.1
	install -m 0644 flexbackup.conf.5 $(MANPATH)/man5/flexbackup.conf.5

fb.install:
	cp flexbackup fb.install
	cp fb.install fb.tmp; sed -e 's%/etc/flexbackup.conf%$(CONFFILE)%g;' fb.tmp > fb.install
	cp fb.install fb.tmp; sed -e 's%/usr/bin/perl%$(PERLPATH)%g' fb.tmp > fb.install
	rm -f fb.tmp

clean:
	rm -f fb.install
