include ../Makefile.defs

CONFIGFILES = idsad.conf rc.idsa-full rc.idsa-simple inetd.conf
DOSED       = $(SED) -e "s%/usr/local/var/log/idsa%${LOCALSTATEDIR}/log/idsa%g" \
                     -e "s%/usr/local/share/idsa%${DATADIR}/idsa%g" \
                     -e "s%/usr/local/sbin%${SBINDIR}%g" \
                     -e "s%/usr/local/etc%${SYSCONFDIR}%g"

all: $(CONFIGFILES)

idsad.conf: idsad.conf-template
	$(DOSED) $< > $@

inetd.conf: inetd.conf-template
	$(DOSED) $< > $@

rc.idsa-simple: rc.idsa-simple-template
	$(DOSED) $< > $@
	-$(CHMOD) 755 $@

rc.idsa-full: rc.idsa-full-template
	$(DOSED) $< > $@
	-$(CHMOD) 755 $@

install: all
	@if [ ! -e $(SYSCONFDIR)/idsad.conf ] ; then $(INSTALL) -d $(SYSCONFDIR) ; $(INSTALL) -m 0600 idsad.conf $(SYSCONFDIR) ; $(INSTALL) -d -m 0700 $(LOCALSTATEDIR)/log/idsa; else $(WARN) "Existing $(SYSCONFDIR)/idsad.conf not modified" ; fi

checkpoint: indent clean
	$(CI) -l *-template

indent:

clean: 
	$(RM) *.o *~ core $(CONFIGFILES)

reallyclean: clean
