summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/Makefile.yp
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2005-05-02 11:19:52 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2005-05-02 11:19:52 +0000
commita89e588c90adc84993d7eeb41e0413890763a653 (patch)
tree6f3439ac3d20a1fdb281ae6115c6229ac931bfa5 /usr.sbin/ypserv/Makefile.yp
parentadd62273c916c5f4bafa199e4fe748d3980d755e (diff)
downloadsrc-test2-a89e588c90adc84993d7eeb41e0413890763a653.tar.gz
src-test2-a89e588c90adc84993d7eeb41e0413890763a653.zip
Notes
Diffstat (limited to 'usr.sbin/ypserv/Makefile.yp')
-rw-r--r--usr.sbin/ypserv/Makefile.yp38
1 files changed, 38 insertions, 0 deletions
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) \