# Copyright (C) 2002  Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

# $Id: Makefile,v 1.27 2002/12/10 20:04:06 explorer Exp $

srcdir= .
top_srcdir= ..

TARGETS=xaction epp-frontend whois \
	replication-master write-zone stats-monitor poll-stats poll-stuff \
	poll-stats-op measure_dig log-monitor \
	ka_msgq ka_xaction ka_epp-frontend ka_whois \
	ka_write-zone ka_stats-monitor

SUBDIRS=msgq

INSTALLDIRS=${prefix}/sbin

include ${top_srcdir}/mk/rules

xaction: xaction.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

epp-frontend: epp-frontend.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

whois: whois.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

replication-master: replication-master.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

write-zone: write-zone.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

stats-monitor: stats-monitor.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

log-monitor: log-monitor.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

poll-stats: poll-stats.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

poll-stats-op: poll-stats-op.pl
	sed s,@prefix@,${prefix}/lib/site_perl,g < $? > $@
	chmod 755 $@

poll-stuff: poll-stuff.sh
	sed s,@prefix@,${prefix}/sbin,g < $? > $@
	chmod 755 $@

measure_dig: measure_dig.sh
	sed s,@prefix@,${prefix}/sbin,g < $? > $@
	chmod 755 $@

ka_msgq: ka_msgq.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g > $@
	chmod 755 $@

ka_stats-monitor: ka_stats-monitor.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g > $@
	chmod 755 $@

ka_epp-frontend: ka_epp-frontend.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g > $@
	chmod 755 $@

ka_whois: ka_whois.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g > $@
	chmod 755 $@

ka_write-zone: ka_write-zone.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g | \
	sed s,@RNDC@,${RNDC},g > $@
	chmod 755 $@

ka_xaction: ka_xaction.sh
	sed s,@prefix@,${prefix}/sbin,g < $? | \
	sed s,@logdir@,${logdir},g > $@
	chmod 755 $@

install:: ${TARGETS}
	${INSTALL_PROG} xaction ${prefix}/sbin
	${INSTALL_PROG} epp-frontend ${prefix}/sbin
	${INSTALL_PROG} whois ${prefix}/sbin
	${INSTALL_PROG} replication-master ${prefix}/sbin
	${INSTALL_PROG} write-zone ${prefix}/sbin
	${INSTALL_PROG} stats-monitor ${prefix}/sbin
	${INSTALL_PROG} log-monitor ${prefix}/sbin

	${INSTALL_PROG} ka_msgq ${prefix}/sbin
	${INSTALL_PROG} ka_xaction ${prefix}/sbin
	${INSTALL_PROG} ka_epp-frontend ${prefix}/sbin
	${INSTALL_PROG} ka_whois ${prefix}/sbin
	${INSTALL_PROG} ka_write-zone ${prefix}/sbin
	${INSTALL_PROG} ka_stats-monitor ${prefix}/sbin
