# $Id: Makefile.in,v 1.19 2000/05/14 02:28:32 assar Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

SHELL		= /bin/sh
INSTALL		= @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS 	= @top_srcdir@/mkinstalldirs
ARLACACHEDIR	= @ARLACACHEDIR@
CHMOD		= @chmod@

prefix 		= @prefix@
sysconfdir	= @sysconfdir@

CONF_FILES	= CellServDB ThisCell arla.conf SuidCells

all: arla.spec

install:	all
		$(MKINSTALLDIRS) $(DESTDIR)$(ARLACACHEDIR)
		$(CHMOD) 700 $(DESTDIR)$(ARLACACHEDIR)
		$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)
		@CONF_FILES='$(CONF_FILES)'; \
		for x in $$CONF_FILES; do \
		  echo $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x.default; \
		  $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x.default; \
		  if test -f $(DESTDIR)$(sysconfdir)/$$x; then \
		    echo "$@ will not overwrite $(DESTDIR)$(sysconfdir)/$$x"; \
		  else \
		    echo $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x; \
		    $(INSTALL_DATA) $(srcdir)/$$x $(DESTDIR)$(sysconfdir)/$$x; \
		  fi; \
		done

uninstall:
		CONF_FILES='$(CONF_FILES)'; \
		for x in $$CONF_FILES; do \
		  rm -f $(DESTDIR)$(sysconfdir)/$$x.default; \
		  rm -f $(DESTDIR)$(sysconfdir)/$$x; \
		done

clean		:

mostlyclean:	clean

distclean:	clean
		rm -f Makefile

realclean:	distclean

arla.spec:	arla.spec.in ../config.status
		(cd .. ; CONFIG_FILES=conf/arla.spec CONFIG_HEADERS= $(SHELL) ./config.status)

Makefile:	Makefile.in ../config.status
		(cd .. ; CONFIG_FILES=conf/Makefile CONFIG_HEADERS= $(SHELL) ./config.status)

.PHONY: all install uninstall clean mostlyclean distclean realclean
