xref: /freebsd/usr.sbin/ypserv/Makefile.yp (revision 778c7b1c1c6bcd696918f410306457c989a65d33)
1778c7b1cSBill Paul#
2778c7b1cSBill Paul# Makefile for the NIS databases
3778c7b1cSBill Paul#
4778c7b1cSBill Paul# $Id: Makefile.yp,v 1.1 1995/12/09 04:33:14 wpaul Exp $
5778c7b1cSBill Paul#
6778c7b1cSBill Paul# This Makefile should only be run on the NIS master server of a domain.
7778c7b1cSBill Paul# All updated maps will be pushed to all NIS slave servers listed in the
8778c7b1cSBill Paul# /var/yp/ypservers file. Please make sure that the hostnames of all
9778c7b1cSBill Paul# NIS servers in your domain are listed in /var/yp/ypservers.
10778c7b1cSBill Paul#
11778c7b1cSBill Paul# This Makefile can be modified to support more NIS maps if desired.
12778c7b1cSBill Paul#
13778c7b1cSBill Paul
14778c7b1cSBill Paul# If this machine is an NIS master, comment out this next line so
15778c7b1cSBill Paul# that changes to the NIS maps can be propagated to the slave servers.
16778c7b1cSBill Paul# (By default we assume that we are only serving a small domain with
17778c7b1cSBill Paul# only one server.)
18778c7b1cSBill Paul#
19778c7b1cSBill PaulNOPUSH = "True"
20778c7b1cSBill Paul
21778c7b1cSBill Paul# If you want to use a FreeBSD NIS server to serve non-FreeBSD clients
22778c7b1cSBill Paul# (i.e. clients who expect the password field in the passwd maps to be
23778c7b1cSBill Paul# valid) then uncomment this line. This will cause $YPDIR/passwd to
24778c7b1cSBill Paul# be generated with valid password fields. This is insecure: FreeBSD
25778c7b1cSBill Paul# normally only serves the master.passwd maps (which have real encrypted
26778c7b1cSBill Paul# passwords in them) to the superuser on other FreeBSD machines, but
27778c7b1cSBill Paul# non-FreeBSD clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX,
28778c7b1cSBill Paul# etc...) will only work properly in 'unsecure' mode.
29778c7b1cSBill Paul#
30778c7b1cSBill Paul#UNSECURE = "True"
31778c7b1cSBill Paul
32778c7b1cSBill Paul# These are commands which this Makefile needs to properly rebuild the
33778c7b1cSBill Paul# NIS databases. Don't change these unless you have a good reason. Also
34778c7b1cSBill Paul# be sure not to place an @ in front of /usr/bin/awk: it isn't necessary
35778c7b1cSBill Paul# and it'll break everything in sight.
36778c7b1cSBill Paul#
37778c7b1cSBill PaulAWK = /usr/bin/awk
38778c7b1cSBill PaulRM  = @/bin/rm -f
39778c7b1cSBill PaulRCAT = /bin/cat
40778c7b1cSBill PaulCAT = @$(RCAT)
41778c7b1cSBill Paul
42778c7b1cSBill PaulDBLOAD = /usr/sbin/yp_mkdb -m `hostname`
43778c7b1cSBill PaulMKNETID = /usr/libexec/mknetid
44778c7b1cSBill PaulYPPUSH = /usr/bin/yppush
45778c7b1cSBill PaulDOMAIN = `/bin/domainname`
46778c7b1cSBill PaulREVNETGROUP = /usr/libexec/revnetgroup
47778c7b1cSBill Paul
48778c7b1cSBill PaulYPSRCDIR = /etc
49778c7b1cSBill PaulYPDIR = /var/yp
50778c7b1cSBill PaulYPMAPDIR = $(YPDIR)/$(DOMAIN)
51778c7b1cSBill Paul
52778c7b1cSBill Paul# These are the files from which the NIS databases are built. You may edit
53778c7b1cSBill Paul# these to taste in the event that you wish to keep your NIS source files
54778c7b1cSBill Paul# seperate from your NIS server's actual configuration files. Note that the
55778c7b1cSBill Paul# NIS passwd and master.passwd files are stored in /var/yp: the server's
56778c7b1cSBill Paul# real password database is not used by default. However, you may use
57778c7b1cSBill Paul# the real /etc/passwd and /etc/master.passwd files by:
58778c7b1cSBill Paul#
59778c7b1cSBill Paul#
60778c7b1cSBill Paul# - invoking yppasswdd without the -m option (yppasswdd will use
61778c7b1cSBill Paul#   /etc/master.passwd if no alternate master.passwd file is specified
62778c7b1cSBill Paul#   and do a 'pwd_mkdb' as needed).
63778c7b1cSBill Paul# - Specifying the location of the master.passwd file using the
64778c7b1cSBill Paul#   MASTER_PASSWD variable, i.e.:
65778c7b1cSBill Paul#
66778c7b1cSBill Paul#   # make MASTER_PASSWD=/path/to/some/other/master.passwd
67778c7b1cSBill Paul#
68778c7b1cSBill Paul# - (optionally): editing this Makefile to change the default location.
69778c7b1cSBill Paul#
70778c7b1cSBill Paul# To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw
71778c7b1cSBill Paul# passwd file will be generated from the master.passwd file automagically.
72778c7b1cSBill Paul#
73778c7b1cSBill PaulETHERS    = $(YPSRCDIR)/ethers	   # ethernet addresses (for rarpd)
74778c7b1cSBill PaulBOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
75778c7b1cSBill PaulHOSTS     = $(YPSRCDIR)/hosts
76778c7b1cSBill PaulNETWORKS  = $(YPSRCDIR)/networks
77778c7b1cSBill PaulPROTOCOLS = $(YPSRCDIR)/protocols
78778c7b1cSBill PaulRPC 	  = $(YPSRCDIR)/rpc
79778c7b1cSBill PaulSERVICES  = $(YPSRCDIR)/services
80778c7b1cSBill PaulGROUP     = $(YPSRCDIR)/group
81778c7b1cSBill PaulNETGROUP  = $(YPSRCDIR)/netgroup
82778c7b1cSBill PaulPASSWD    = $(YPDIR)/passwd
83778c7b1cSBill Paul.if !defined(MASTER_PASSWD)
84778c7b1cSBill PaulMASTER    = $(YPDIR)/master.passwd
85778c7b1cSBill Paul.else
86778c7b1cSBill PaulMASTER	  = $(MASTER_PASSWD)
87778c7b1cSBill Paul.endif
88778c7b1cSBill PaulYPSERVERS = $(YPDIR)/ypservers	# List of all NIS servers for a domain
89778c7b1cSBill PaulPUBLICKEY = $(YPSRCDIR)/publickey
90778c7b1cSBill Paul
91778c7b1cSBill Paultarget:
92778c7b1cSBill Paul	@if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
93778c7b1cSBill Paul	cd $(DOMAIN) ; echo "NIS Map update started on `date`" ; \
94778c7b1cSBill Paul	make -f ../Makefile all; echo "NIS Map update completed."
95778c7b1cSBill Paul
96778c7b1cSBill Paul# If you don't want some of these maps built, feel free to comment
97778c7b1cSBill Paul# them out from this list.
98778c7b1cSBill Paul# Note that we don't build the ethers or boorparams maps by default
99778c7b1cSBill Paul# since /etc/ethers and /etc/bootparams are not likely to be present
100778c7b1cSBill Paul# on all systems.
101778c7b1cSBill Paul#
102778c7b1cSBill Paul
103778c7b1cSBill Paulall:  master.passwd passwd hosts group networks protocols \
104778c7b1cSBill Paul      rpc services servers netid # publickey netgroup ethers bootparam
105778c7b1cSBill Paul
106778c7b1cSBill Paulethers:	   ethers.byname ethers.byaddr
107778c7b1cSBill Paulbootparam: bootparams
108778c7b1cSBill Paulhosts:	   hosts.byname hosts.byaddr
109778c7b1cSBill Paulnetworks:  networks.byaddr networks.byname
110778c7b1cSBill Paulprotocols: protocols.bynumber protocols.byname
111778c7b1cSBill Paulrpc:	   rpc.byname rpc.bynumber
112778c7b1cSBill Paulservices:  services.byname
113778c7b1cSBill Paulpasswd:    passwd.byname passwd.byuid
114778c7b1cSBill Paulgroup:     group.byname group.bygid
115778c7b1cSBill Paulnetgrp:    netgroup
116778c7b1cSBill Paulnetid:	   netid.byname
117778c7b1cSBill Paulservers:   ypservers
118778c7b1cSBill Paulpublickey: publickey.byname
119778c7b1cSBill Paul
120778c7b1cSBill Paulmaster.passwd:	master.passwd.byname master.passwd.byuid
121778c7b1cSBill Paul
122778c7b1cSBill Paul
123778c7b1cSBill Paulypservers: $(YPSERVERS)
124778c7b1cSBill Paul	@echo "Updating $@..."
125778c7b1cSBill Paul	$(RM) $@
126778c7b1cSBill Paul	$(CAT) $(YPSERVERS) | \
127778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#") print $$0"\t"$$0 }' $^ \
128778c7b1cSBill Paul		| $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $@
129778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
130778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
131778c7b1cSBill Paul
132778c7b1cSBill Paulethers.byname: $(ETHERS)
133778c7b1cSBill Paul	@echo "Updating $@..."
134778c7b1cSBill Paul	$(RM) $@
135778c7b1cSBill Paul	$(CAT) $(ETHERS) | \
136778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
137778c7b1cSBill Paul		print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
138778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
139778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) -i $(ETHERS) $@; fi
140778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
141778c7b1cSBill Paul
142778c7b1cSBill Paul
143778c7b1cSBill Paulethers.byaddr: $(ETHERS)
144778c7b1cSBill Paul	@echo "Updating $@..."
145778c7b1cSBill Paul	$(RM) $@
146778c7b1cSBill Paul	$(CAT) $(ETHERS) | \
147778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
148778c7b1cSBill Paul		print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
149778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
150778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
151778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
152778c7b1cSBill Paul
153778c7b1cSBill Paul
154778c7b1cSBill Paulbootparams: $(BOOTPARAMS)
155778c7b1cSBill Paul	@echo "Updating $@..."
156778c7b1cSBill Paul	$(RM) $@
157778c7b1cSBill Paul	$(CAT) $(BOOTPARAMS) | \
158778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
159778c7b1cSBill Paul		print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \
160778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
161778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
162778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
163778c7b1cSBill Paul
164778c7b1cSBill Paul
165778c7b1cSBill Paulnetgroup: $(NETGROUP) netgroup.byhost netgroup.byuser
166778c7b1cSBill Paul	@echo "Updating $@..."
167778c7b1cSBill Paul	$(RM) $@
168778c7b1cSBill Paul	$(CAT) $(NETGROUP) | \
169778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
170778c7b1cSBill Paul		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
171778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
172778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
173778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
174778c7b1cSBill Paul	@$(MAKE) -f ../Makefile netid
175778c7b1cSBill Paul
176778c7b1cSBill Paul
177778c7b1cSBill Paulnetgroup.byhost: $(NETGROUP)
178778c7b1cSBill Paul	@echo "Updating $@..."
179778c7b1cSBill Paul	$(RM) $@
180778c7b1cSBill Paul	$(CAT) $(NETGROUP) | $(REVNETGROUP) -h -f $(NETGROUP) | \
181778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
182778c7b1cSBill Paul		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
183778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
184778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
185778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
186778c7b1cSBill Paul
187778c7b1cSBill Paul
188778c7b1cSBill Paulnetgroup.byuser: $(NETGROUP)
189778c7b1cSBill Paul	@echo "Updating $@..."
190778c7b1cSBill Paul	$(RM) $@
191778c7b1cSBill Paul	$(CAT) $(NETGROUP) | $(REVNETGROUP) -u -f $(NETGROUP) | \
192778c7b1cSBill Paul	$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
193778c7b1cSBill Paul		print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
194778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
195778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
196778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
197778c7b1cSBill Paul
198778c7b1cSBill Paul
199778c7b1cSBill Paulhosts.byname: $(HOSTS)
200778c7b1cSBill Paul	@echo "Updating $@..."
201778c7b1cSBill Paul	$(RM) $@
202778c7b1cSBill Paul	$(CAT) $(HOSTS) | \
203778c7b1cSBill Paul	$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \
204778c7b1cSBill Paul		print $$n"\t"$$0 }' $^ | $(DBLOAD) -i $(HOSTS)  \
205778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
206778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
207778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
208778c7b1cSBill Paul	@$(MAKE) -f ../Makefile netid
209778c7b1cSBill Paul
210778c7b1cSBill Paulhosts.byaddr: $(HOSTS)
211778c7b1cSBill Paul	@echo "Updating $@..."
212778c7b1cSBill Paul	$(RM) $@
213778c7b1cSBill Paul	$(CAT) $(HOSTS) | \
214778c7b1cSBill Paul	$(AWK) '$$1 !~ "#" { print $$1"\t"$$0 }' $^ \
215778c7b1cSBill Paul		| $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $@
216778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
217778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
218778c7b1cSBill Paul	@$(MAKE) -f ../Makefile netid
219778c7b1cSBill Paul
220778c7b1cSBill Paul
221778c7b1cSBill Paulnetworks.byname: $(NETWORKS)
222778c7b1cSBill Paul	@echo "Updating $@..."
223778c7b1cSBill Paul	$(RM) $@
224778c7b1cSBill Paul	$(CAT) $(NETWORKS) | \
225778c7b1cSBill Paul	$(AWK) \
226778c7b1cSBill Paul	   '$$1 !~ "#"  { print $$1"\t"$$0; \
227778c7b1cSBill Paul			  for (n=3; n<=NF && $$n !~ "#"; n++) \
228778c7b1cSBill Paul			      print $$n"\t"$$0 \
229778c7b1cSBill Paul			}' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@
230778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
231778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
232778c7b1cSBill Paul
233778c7b1cSBill Paul
234778c7b1cSBill Paulnetworks.byaddr: $(NETWORKS)
235778c7b1cSBill Paul	@echo "Updating $@..."
236778c7b1cSBill Paul	$(RM) $@
237778c7b1cSBill Paul	$(CAT) $(NETWORKS) | \
238778c7b1cSBill Paul	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
239778c7b1cSBill Paul		| $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@
240778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
241778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
242778c7b1cSBill Paul
243778c7b1cSBill Paul
244778c7b1cSBill Paulprotocols.byname: $(PROTOCOLS)
245778c7b1cSBill Paul	@echo "Updating $@..."
246778c7b1cSBill Paul	$(RM) $@
247778c7b1cSBill Paul	$(CAT) $(PROTOCOLS) | \
248778c7b1cSBill Paul	$(AWK) \
249778c7b1cSBill Paul	   '$$1 !~ "#"	{ print $$1"\t"$$0; \
250778c7b1cSBill Paul			  for (n=3; n<=NF && $$n !~ "#"; n++) \
251778c7b1cSBill Paul			      print $$n"\t"$$0 \
252778c7b1cSBill Paul			}' $^ | $(DBLOAD) -i $(PROTOCOLS) \
253778c7b1cSBill Paul							-o $(YPMAPDIR)/$@ - $@
254778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
255778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
256778c7b1cSBill Paul
257778c7b1cSBill Paul
258778c7b1cSBill Paulprotocols.bynumber: $(PROTOCOLS)
259778c7b1cSBill Paul	@echo "Updating $@..."
260778c7b1cSBill Paul	$(RM) $@
261778c7b1cSBill Paul	$(CAT) $(PROTOCOLS) | \
262778c7b1cSBill Paul	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
263778c7b1cSBill Paul		| $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $@
264778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
265778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
266778c7b1cSBill Paul
267778c7b1cSBill Paul
268778c7b1cSBill Paulrpc.byname: $(RPC)
269778c7b1cSBill Paul	@echo "Updating $@..."
270778c7b1cSBill Paul	$(RM) $@
271778c7b1cSBill Paul	$(CAT) $(RPC) | \
272778c7b1cSBill Paul	$(AWK) \
273778c7b1cSBill Paul	   '$$1 !~ "#"  { print $$1"\t"$$0; \
274778c7b1cSBill Paul			  for (n=3; n<=NF && $$n !~ "#"; n++) \
275778c7b1cSBill Paul			      print $$n"\t"$$0 \
276778c7b1cSBill Paul			}' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $@
277778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
278778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
279778c7b1cSBill Paul
280778c7b1cSBill Paul
281778c7b1cSBill Paulrpc.bynumber: $(RPC)
282778c7b1cSBill Paul	@echo "Updating $@..."
283778c7b1cSBill Paul	$(RM) $@
284778c7b1cSBill Paul	$(CAT) $(RPC) | \
285778c7b1cSBill Paul	$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
286778c7b1cSBill Paul		| $(DBLOAD)  -i $(RPC) -o $(YPMAPDIR)/$@ - $@
287778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
288778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
289778c7b1cSBill Paul
290778c7b1cSBill Paul
291778c7b1cSBill Paulservices.byname: $(SERVICES)
292778c7b1cSBill Paul	@echo "Updating $@..."
293778c7b1cSBill Paul	$(RM) $@
294778c7b1cSBill Paul	$(CAT) $(SERVICES) | \
295778c7b1cSBill Paul	$(AWK) \
296778c7b1cSBill Paul	   '$$1 !~ "#"  { if (index($$2,"udp")) { printf("%s/udp",$$1) } \
297778c7b1cSBill Paul			  else { printf("%s/tcp",$$1) }; print "\t"$$0 \
298778c7b1cSBill Paul			}' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $@
299778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
300778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
301778c7b1cSBill Paul
302778c7b1cSBill Paul
303778c7b1cSBill Paulpublickey.byname: $(PUBLICKEY)
304778c7b1cSBill Paul	@echo "Updating $@..."
305778c7b1cSBill Paul	$(RM) $@
306778c7b1cSBill Paul	$(CAT) $(PUBLICKEY) | \
307778c7b1cSBill Paul	$(AWK) '$$1 !~ "#" { print $$1"\t"$$2 }' $^ \
308778c7b1cSBill Paul		| $(DBLOAD)  -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $@
309778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
310778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
311778c7b1cSBill Paul
312778c7b1cSBill Paul
313778c7b1cSBill Paul$(PASSWD): $(MASTER)
314778c7b1cSBill Paul	@echo "Creating new $@ file from $(MASTER)..."
315778c7b1cSBill Paul	$(RM) $@
316778c7b1cSBill Paul	@if [ ! $(UNSECURE) ]; then \
317778c7b1cSBill Paul	$(RCAT) $(MASTER) | \
318778c7b1cSBill Paul	$(AWK) -F: '{if ($$1 != "+") \
319778c7b1cSBill Paul		print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
320778c7b1cSBill Paul		> $(PASSWD) ; \
321778c7b1cSBill Paul	else $(RCAT) $(MASTER) | \
322778c7b1cSBill Paul	$(AWK) -F: '{if ($$1 != "+") \
323778c7b1cSBill Paul		print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
324778c7b1cSBill Paul		> $(PASSWD) ; fi
325778c7b1cSBill Paul
326778c7b1cSBill Paul
327778c7b1cSBill Paulpasswd.byname: $(PASSWD)
328778c7b1cSBill Paul	@echo "Updating $@..."
329778c7b1cSBill Paul	$(RM) $@
330778c7b1cSBill Paul	$(CAT) $(PASSWD) | \
331778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
332778c7b1cSBill Paul		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@
333778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
334778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
335778c7b1cSBill Paul
336778c7b1cSBill Paulpasswd.byuid: $(PASSWD)
337778c7b1cSBill Paul	@echo "Updating $@..."
338778c7b1cSBill Paul	$(RM) $@
339778c7b1cSBill Paul	$(CAT) $(PASSWD) | \
340778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
341778c7b1cSBill Paul		| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@
342778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
343778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
344778c7b1cSBill Paul	@$(MAKE) -f ../Makefile netid
345778c7b1cSBill Paul
346778c7b1cSBill Paul
347778c7b1cSBill Paulgroup.byname: $(GROUP)
348778c7b1cSBill Paul	@echo "Updating $@..."
349778c7b1cSBill Paul	$(RM) $@
350778c7b1cSBill Paul	$(CAT) $(GROUP) | \
351778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
352778c7b1cSBill Paul		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
353778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
354778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
355778c7b1cSBill Paul
356778c7b1cSBill Paul
357778c7b1cSBill Paulgroup.bygid: $(GROUP)
358778c7b1cSBill Paul	@echo "Updating $@..."
359778c7b1cSBill Paul	$(RM) $@
360778c7b1cSBill Paul	$(CAT) $(GROUP) | \
361778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
362778c7b1cSBill Paul		| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
363778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
364778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
365778c7b1cSBill Paul	@$(MAKE) -f ../Makefile netid
366778c7b1cSBill Paul
367778c7b1cSBill Paul
368778c7b1cSBill Paulnetid.byname: $(GROUP) $(PASSWD)
369778c7b1cSBill Paul	@echo "Updating $@..."
370778c7b1cSBill Paul	$(RM) $@
371778c7b1cSBill Paul	@$(MKNETID) $(PASSWD) $(GROUP) `basename \`pwd\`` \
372778c7b1cSBill Paul		| $(DBLOAD) -o $(YPMAPDIR)/$@ - $@
373778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
374778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
375778c7b1cSBill Paul
376778c7b1cSBill Paul
377778c7b1cSBill Paulmaster.passwd.byname: $(MASTER)
378778c7b1cSBill Paul	@echo "Updating $@..."
379778c7b1cSBill Paul	$(RM) $@
380778c7b1cSBill Paul	$(CAT) $(MASTER) | \
381778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
382778c7b1cSBill Paul		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@
383778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
384778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
385778c7b1cSBill Paul
386778c7b1cSBill Paul
387778c7b1cSBill Paulmaster.passwd.byuid: $(MASTER)
388778c7b1cSBill Paul	@echo "Updating $@..."
389778c7b1cSBill Paul	$(RM) $@
390778c7b1cSBill Paul	$(CAT) $(MASTER) | \
391778c7b1cSBill Paul	$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
392778c7b1cSBill Paul		| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@
393778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
394778c7b1cSBill Paul	@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
395