# make the Distributed Checksum Clearinghouse prototype home directory files

# --S-LICENSE--
# $Revision: 1.68 $
# Generated automatically from Makefile.in by configure.

DEPTH	=..

HINST	=$(INSTALL) -c $(SET_DCCOWN)
HD	=/var/dcc
MAP	=$(HD)/map
MAPTXT	=$(HD)/map.txt
IDS	=$(HD)/ids
CDCC	=$(DEPTH)/cdcc/cdcc

# this should not be the ./configure name
PFILE	=.updatedcc_pfile

SIMPLE	=flod grey_flod whitelist grey_whitelist whiteclnt whitecommon
GENFILES=ids map map.txt dcc_conf
SSCRIPTS=fix-map

DCC_BINDIR=/var/dcc/libexec
.include "$(DEPTH)/Makefile.inc"

install:$(HD) $(HD)/log
	for NM in $(SSCRIPTS); do $(BININSTALL) $$NM $(DCC_BINDIR)/$$NM;done
	sh make-dcc_conf -F '' -h $(HD)
	for NM in $(SIMPLE); do\
	    if test -n '' -o ! -f $(HD)/$$NM; then\
		$(HINST) -m 644 $$NM $(HD)/$${NM}; fi; done
	if test -s $(PFILE); then $(HINST) -m 600 $(PFILE) $(HD)/$(PFILE); fi
	sh fix-map -n '' -c $(CDCC) -h $(HD) -i $(IDS) -m $(MAP) -t $(MAPTXT)
	for NM in $(SIMPLE) $(GENFILES); do\
	    if test -n '' -a ! -s $(HD)/$$NM; then\
		cp -p $(HD)/$${NM} $(HD)/$${NM}; fi; done

deinstall:
	-if test -d $(DCC_BINDIR); then cd $(DCC_BINDIR); rm -f $(SSCRIPTS); fi
	for NM in dcc_conf $(SIMPLE); do\
	    if test -f $(HD)/$$NM && test `diff $$NM $(HD)/$$NM\
		    | sed -e '/^---$$/d' -e '/^[^<>]/d'\
			 -e '/^[<>][	]*#/d' -e '/^[<>][	]*$$/d'\
		    | wc -l` -eq 0; then rm $(HD)/$$NM; fi; done;
	rm -f $(HD)/dcc_conf-new || true
	-if test -d $(HD); then\
	    find $(HD) -name '*.dcc[xw]' | /usr/bin/xargs rm -f;\
	    rmdir $(HD)/log 2>/dev/null || true;\
	    fi

$(HD):
	$(HINST) -m 755 -d $(HD)
$(HD)/log:
	$(HINST) -m 710 -d $(HD)/log
