#<: 'Makefile' v0.002 @ 2012-10-05 23:58:03 UTC (Jonas@Ubbe-III) "Jonas Eckerman" <jonas@truls.org> :>#

# What the DNS?
# make configuration

WTDNS=wtdns.ini apache_wtdns-fromlog_vhost.conf
CRON=wtdns
UPSTART=wtdnsd.conf
WWW=ddns-ok.txt
VAR=ddns-ok.txt TXT

IFO=-p -D -m u=rw,go=r,a-s
IDO=-p -m u=rwx,go=rx,a-s -d

default:

all: 

clean:

distclean: clean

preinstall:

postinstall:

prepackage:

postpackage:

install:
	install $(IDO) /var/lib/wtdns
	install $(IDO) /etc/wtdns
	set -e; for f in $(WWW); do if [ ! -e /var/lib/wtdns/$$f ]; then install $(IFO) $$f /var/lib/wtdns/:www/$$f; fi; done
	set -e; for f in $(WTDNS); do if [ ! -e /etc/wtdns/$$f ]; then install $(IFO) $$f /etc/wtdns/$$f; fi; done
	set -e; \
	if [ -d /etc/cron.d ]; then \
	  for f in $(CRON); do if [ ! -e /etc/cron.d/$$f ]; then install $(IFO) $$f /etc/cron.d/$$f; fi; done; \
	fi
	set -e; \
	if (which initctl > /dev/null && /sbin/initctl version > /dev/null && [ -d /etc/init ]); then \
	  for f in $(UPSTART); do if [ ! -e /etc/init/$$f ]; then install $(IFO) $$f /etc/init/$$f; fi; done; \
	fi
	set -e; \
	if [ -d /usr/share/doc ]; then \
	  install $(IDO) /usr/share/doc/wtdns; \
	  for d in var etc/cron etc/wtdns etc/init; do install $(IDO) /usr/share/doc/wtdns/$$d; done; \
	  for f in $(VAR); do install $(IFO) $$f /usr/share/doc/wtdns/var/$$f; done; \
	  for f in $(CRON); do install $(IFO) $$f /usr/share/doc/wtdns/etc/cron/$$f; done; \
	  for f in $(WTDNS); do install $(IFO) $$f /usr/share/doc/wtdns/etc/wtdns/$$f; done; \
	  for f in $(UPSTART); do install $(IFO) $$f /usr/share/doc/wtdns/etc/init/$$f; done; \
	fi
