From a89e588c90adc84993d7eeb41e0413890763a653 Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Mon, 2 May 2005 11:19:52 +0000 Subject: [PATCH] add targets for ipnodes.byname and ipnodes.byaddr which carries IPv6 addresses. these targets are off by default, and these are built when there is /var/yp/ipnodes. --- usr.sbin/ypserv/Makefile.yp | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/usr.sbin/ypserv/Makefile.yp b/usr.sbin/ypserv/Makefile.yp index bd33918ffc47..0cb8a21d1ed8 100644 --- a/usr.sbin/ypserv/Makefile.yp +++ b/usr.sbin/ypserv/Makefile.yp @@ -98,6 +98,7 @@ YPMAPDIR = $(YPDIR)/$(DOMAIN) ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd) BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd) HOSTS = $(YPSRCDIR)/hosts +IPNODES = $(YPDIR)/ipnodes NETWORKS = $(YPSRCDIR)/networks PROTOCOLS = $(YPSRCDIR)/protocols RPC = $(YPSRCDIR)/rpc @@ -164,6 +165,12 @@ TARGETS+= amd.map AMDHOST= /dev/null .endif +.if exists($(IPNODES)) +TARGETS+= ipnodes +.else +IPNODES= /dev/null +.endif + target: @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \ cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \ @@ -174,6 +181,7 @@ all: $(TARGETS) ethers: ethers.byname ethers.byaddr bootparam: bootparams hosts: hosts.byname hosts.byaddr +ipnodes: ipnodes.byname ipnodes.byaddr networks: networks.byaddr networks.byname protocols: protocols.bynumber protocols.byname rpc: rpc.byname rpc.bynumber @@ -348,6 +356,36 @@ hosts.byaddr: $(HOSTS) @$(MAKE) -f ../Makefile netid +ipnodes.byname: $(IPNODES) + @echo "Updating $@..." +.if ${IPNODES} == "/dev/null" + @echo "Ipnodes source file not found -- skipping" +.else + @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ + print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ + -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi + @$(MAKE) -f ../Makefile netid +.endif + + +ipnodes.byaddr: $(IPNODES) + @echo "Updating $@..." +.if ${IPNODES} == "/dev/null" + @echo "Ipnodes source file not found -- skipping" +.else + @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ + | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ + $(RMV) $(TMP) $@ + @$(DBLOAD) -c + @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi + @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi + @$(MAKE) -f ../Makefile netid +.endif + + networks.byname: $(NETWORKS) @echo "Updating $@..." @$(AWK) \