
include ../../config

ROOT=$(RPM_BUILD_ROOT)/$(PREFIX)/
CONFIGDIR=$(ROOT)/etc/CDWserver/

INSTALL_FILE=install -m 644 -p

install:
	install -d $(CONFIGDIR)
	@if test -f $(CONFIGDIR)/accounts ; then \
		echo "$@ will not overwrite existing $(CONFIGDIR)/accounts"; \
	else \
		echo "$(INSTALL_FILE) accounts $(CONFIGDIR)/"; \
		$(INSTALL_FILE) accounts $(CONFIGDIR)/; \
	fi
	$(INSTALL_FILE) config.default $(CONFIGDIR)/
	@if test -f $(CONFIGDIR)/config ; then \
		echo "$@ will not overwrite existing $(CONFIGDIR)/config"; \
	else \
		echo "$(INSTALL_FILE) config.default $(CONFIGDIR)/config"; \
		$(INSTALL_FILE) config.default $(CONFIGDIR)/config; \
	fi
	@if test -f $(CONFIGDIR)/greeting ; then \
		echo "$@ will not overwrite existing $(CONFIGDIR)/greeting"; \
	else \
		echo "$(INSTALL_FILE) greeting $(CONFIGDIR)/"; \
		$(INSTALL_FILE) greeting $(CONFIGDIR)/; \
	fi
	@if test -f $(CONFIGDIR)/waitForCD ; then \
		echo "$@ will not overwrite existing $(CONFIGDIR)/waitForCD"; \
	else \
		echo "$(INSTALL_FILE) waitForCD $(CONFIGDIR)/"; \
		$(INSTALL_FILE) waitForCD $(CONFIGDIR)/; \
	fi
