.
[corvix.git] / var / deb-package / meta / corvix-cluster / opt / cluster / etc / nis / Makefile
blob02e73df56ee7cd76468439dc3651c9d8b6321325
2 # Makefile for the NIS databases
4 # This Makefile should only be run on the NIS master server of a domain.
5 # All updated maps will be pushed to all NIS slave servers listed in the
6 # /var/yp/ypservers file. Please make sure that the hostnames of all
7 # NIS servers in your domain are listed in /var/yp/ypservers.
9 # This Makefile can be modified to support more NIS maps if desired.
12 # Set the following variable to "-b" to have NIS servers use the domain
13 # name resolver for hosts not in the current domain. This is only needed,
14 # if you have SunOS slave YP server, which gets here maps from this
15 # server. The NYS YP server will ignore the YP_INTERDOMAIN key.
16 #B=-b
19 # If we have only one server, we don't have to push the maps to the
20 # slave servers (NOPUSH=true). If you have slave servers, change this
21 # to "NOPUSH=false" and put all hostnames of your slave servers in the file
22 # /var/yp/ypservers.
23 NOPUSH=true
25 # Specify any additional arguments to be supplied when invoking yppush.
26 # For example, the -port option may be used to allow operation with port
27 # based firewalls.
28 YPPUSHARGS=
30 # We do not put password entries with lower UIDs (the root and system
31 # entries) in the NIS password database, for security. MINUID is the
32 # lowest uid that will be included in the password maps. If you
33 # create shadow maps, the UserID for a shadow entry is taken from
34 # the passwd file. If no entry is found, this shadow entry is
35 # ignored.
36 # MINGID is the lowest gid that will be included in the group maps.
37 MINUID=1000
38 MINGID=1000
40 # Don't export this uid/guid (nfsnobody).
41 # Set to 0 if you want to
42 NFSNOBODYUID=65534
43 NFSNOBODYGID=65534
45 # Should we merge the passwd file with the shadow file ?
46 # MERGE_PASSWD=true|false
47 MERGE_PASSWD=false
49 # Should we merge the group file with the gshadow file ?
50 # MERGE_GROUP=true|false
51 MERGE_GROUP=false
53 # These are commands which this Makefile needs to properly rebuild the
54 # NIS databases. Don't change these unless you have a good reason.
55 AWK = /usr/bin/awk
56 MAKE = /usr/bin/make
57 UMASK = umask 066
60 # These are the source directories for the NIS files; normally
61 # that is /etc but you may want to move the source for the password
62 # and group files to (for example) /var/yp/ypfiles. The directory
63 # for passwd, group and shadow is defined by YPPWDDIR, the rest is
64 # taken from YPSRCDIR.
66 YPSRCDIR = /etc
67 YPPWDDIR = /etc
68 YPBINDIR = /usr/lib/yp
69 YPSBINDIR = /usr/sbin
70 YPDIR = /var/yp
71 YPMAPDIR = $(YPDIR)/$(DOMAIN)
73 # These are the files from which the NIS databases are built. You may edit
74 # these to taste in the event that you wish to keep your NIS source files
75 # seperate from your NIS server's actual configuration files.
77 GROUP = $(YPPWDDIR)/group
78 PASSWD = $(YPPWDDIR)/passwd
79 SHADOW = $(YPPWDDIR)/shadow
80 GSHADOW = $(YPPWDDIR)/gshadow
81 ADJUNCT = $(YPPWDDIR)/passwd.adjunct
82 #ALIASES = $(YPSRCDIR)/aliases # aliases could be in /etc or /etc/mail
83 ALIASES = /etc/aliases
84 ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd)
85 BOOTPARAMS = $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
86 HOSTS = $(YPSRCDIR)/hosts
87 NETWORKS = $(YPSRCDIR)/networks
88 PRINTCAP = $(YPSRCDIR)/printcap
89 PROTOCOLS = $(YPSRCDIR)/protocols
90 PUBLICKEYS = $(YPSRCDIR)/publickey
91 RPC = $(YPSRCDIR)/rpc
92 SERVICES = $(YPSRCDIR)/services
93 NETGROUP = $(YPSRCDIR)/netgroup
94 NETID = $(YPSRCDIR)/netid
95 AMD_HOME = $(YPSRCDIR)/amd.home
96 AUTO_MASTER = $(YPSRCDIR)/auto.master
97 AUTO_HOME = $(YPSRCDIR)/auto.home
98 AUTO_LOCAL = $(YPSRCDIR)/auto.local
99 TIMEZONE = $(YPSRCDIR)/timezone
100 LOCALE = $(YPSRCDIR)/locale
101 NETMASKS = $(YPSRCDIR)/netmasks
103 YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
105 target: Makefile
106 @test ! -d $(LOCALDOMAIN) && mkdir $(LOCALDOMAIN) ; \
107 cd $(LOCALDOMAIN) ; \
108 $(NOPUSH) || $(MAKE) -f ../Makefile ypservers; \
109 $(MAKE) -f ../Makefile all
111 # If you don't want some of these maps built, feel free to comment
112 # them out from this list.
114 ALL = passwd shadow group hosts rpc services netid protocols netgrp #timezone
115 #ALL += $(TIMEZONE)
116 #ALL += /etc/profile
117 #ALL += publickey mail ethers bootparams printcap
118 #ALL += amd.home auto.master auto.home auto.local
119 #ALL += timezone locale networks netmasks
121 # Autodetect /etc/shadow if it's there
122 ifneq ($(wildcard $(SHADOW)),)
123 ALL += shadow
124 endif
126 # Autodetect /etc/passwd.adjunct if it's there
127 ifneq ($(wildcard $(ADJUNCT)),)
128 ALL += passwd.adjunct
129 endif
131 all: $(ALL)
135 ########################################################################
137 # DON'T EDIT ANYTHING BELOW IF YOU DON'T KNOW WHAT YOU ARE DOING !!! #
139 ########################################################################
141 DBLOAD = $(YPBINDIR)/makedbm -c -m `$(YPBINDIR)/yphelper --hostname`
142 MKNETID = $(YPBINDIR)/mknetid
143 YPPUSH = $(YPSBINDIR)/yppush $(YPPUSHARGS)
144 MERGER = $(YPBINDIR)/yphelper
145 DOMAIN = `basename \`pwd\``
146 LOCALDOMAIN = `/bin/domainname`
147 REVNETGROUP = $(YPBINDIR)/revnetgroup
148 CREATE_PRINTCAP = $(YPBINDIR)/create_printcap
150 ethers: ethers.byname ethers.byaddr
151 hosts: hosts.byname hosts.byaddr
152 networks: networks.byaddr networks.byname
153 protocols: protocols.bynumber protocols.byname
154 rpc: rpc.byname rpc.bynumber
155 services: services.byname services.byservicename
156 passwd: passwd.byname passwd.byuid
157 group: group.byname group.bygid
158 shadow: shadow.byname
159 passwd.adjunct: passwd.adjunct.byname
160 netid: netid.byname
161 netgrp: netgroup netgroup.byhost netgroup.byuser
162 publickey: publickey.byname
163 mail: mail.aliases
164 timezone: timezone.byname
165 locale: locale.byname
166 netmasks: netmasks.byaddr
168 ypservers: $(YPSERVERS) $(YPDIR)/Makefile
169 @echo "Updating $@..."
170 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#") print $$0"\t"$$0 }' \
171 $(YPSERVERS) | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $@
172 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
174 $(YPSERVERS):
175 @echo -n "Generating $*..."
176 @uname -n > $(YPSERVERS)
178 bootparams: $(BOOTPARAMS) $(YPDIR)/Makefile
179 @echo "Updating $@..."
180 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#" && $$1 != "+") \
181 print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -r -i $(BOOTPARAMS) \
182 -o $(YPMAPDIR)/$@ - $@
183 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
186 ethers.byname: $(ETHERS) $(YPDIR)/Makefile
187 @echo "Updating $@..."
188 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#" && $$1 != "+") \
189 print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -r -i $(ETHERS) \
190 -o $(YPMAPDIR)/$@ - $@
191 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
194 ethers.byaddr: $(ETHERS) $(YPDIR)/Makefile
195 @echo "Updating $@..."
196 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#" && $$1 != "+") \
197 print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -r -i $(ETHERS) \
198 -o $(YPMAPDIR)/$@ - $@
199 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
202 netgroup: $(NETGROUP) $(YPDIR)/Makefile
203 @echo "Updating $@..."
204 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#" && $$1 != "+") \
205 print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
206 -o $(YPMAPDIR)/$@ - $@
207 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
210 netgroup.byhost: $(NETGROUP) $(YPDIR)/Makefile
211 @echo "Updating $@..."
212 @$(REVNETGROUP) -h < $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
213 -o $(YPMAPDIR)/$@ - $@
214 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
217 netgroup.byuser: $(NETGROUP) $(YPDIR)/Makefile
218 @echo "Updating $@..."
219 @$(REVNETGROUP) -u < $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \
220 -o $(YPMAPDIR)/$@ - $@
221 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
224 hosts.byname: $(HOSTS) $(YPDIR)/Makefile
225 @echo "Updating $@..."
226 @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \
227 print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) -r $(B) -l \
228 -i $(HOSTS) -o $(YPMAPDIR)/$@ - $@
229 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
231 hosts.byaddr: $(HOSTS) $(YPDIR)/Makefile
232 @echo "Updating $@..."
233 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") print $$1"\t"$$0 }' \
234 $(HOSTS) | $(DBLOAD) -r $(B) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $@
235 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
238 networks.byname: $(NETWORKS) $(YPDIR)/Makefile
239 @echo "Updating $@..."
240 @$(AWK) '{ if($$1 !~ "#" && $$1 != "") { print $$1"\t"$$0; \
241 for (n=3; n<=NF && $$n !~ "#"; n++) print $$n"\t"$$0 \
242 }}' $(NETWORKS) | $(DBLOAD) -r -i $(NETWORKS) \
243 -o $(YPMAPDIR)/$@ - $@
244 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
247 networks.byaddr: $(NETWORKS) $(YPDIR)/Makefile
248 @echo "Updating $@..."
249 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") print $$2"\t"$$0 }' \
250 $(NETWORKS) | $(DBLOAD) -r -i $(NETWORKS) \
251 -o $(YPMAPDIR)/$@ - $@
252 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
255 protocols.byname: $(PROTOCOLS) $(YPDIR)/Makefile
256 @echo "Updating $@..."
257 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") { print $$1"\t"$$0; \
258 for (n=3; n<=NF && $$n !~ "#"; n++) \
259 print $$n"\t"$$0}}' $(PROTOCOLS) | $(DBLOAD) -r -i \
260 $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $@
261 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
264 protocols.bynumber: $(PROTOCOLS) $(YPDIR)/Makefile
265 @echo "Updating $@..."
266 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") print $$2"\t"$$0 }' \
267 $(PROTOCOLS) | $(DBLOAD) -r -i $(PROTOCOLS) \
268 -o $(YPMAPDIR)/$@ - $@
269 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
272 rpc.byname: $(RPC) $(YPDIR)/Makefile
273 @echo "Updating $@..."
274 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") { print $$1"\t"$$0; \
275 for (n=3; n<=NF && $$n !~ "#"; n++) print $$n"\t"$$0 \
276 }}' $(RPC) | $(DBLOAD) -r -i $(RPC) -o $(YPMAPDIR)/$@ - $@
277 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
280 rpc.bynumber: $(RPC) $(YPDIR)/Makefile
281 @echo "Updating $@..."
282 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") print $$2"\t"$$0 }' $(RPC) \
283 | $(DBLOAD) -r -i $(RPC) -o $(YPMAPDIR)/$@ - $@
284 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
287 services.byname: $(SERVICES) $(YPDIR)/Makefile
288 @echo "Updating $@..."
289 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") print $$2"\t"$$0 }' \
290 $(SERVICES) | $(DBLOAD) -r -i $(SERVICES) \
291 -o $(YPMAPDIR)/$@ - $@
292 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
294 services.byservicename: $(SERVICES) $(YPDIR)/Makefile
295 @echo "Updating $@..."
296 @$(AWK) '{ if ($$1 !~ "#" && $$1 != "") { \
297 split($$2,A,"/") ; TMP = "/" A[2] ; \
298 print $$1 TMP"\t"$$0 ; \
299 if (! seen[$$1]) { seen[$$1] = 1 ; print $$1"\t"$$0 ; } \
300 for (N = 3; N <= NF && $$N !~ "#" ; N++) { \
301 if ($$N !~ "#" && $$N != "") print $$N TMP"\t"$$0 ; \
302 if (! seen[$$N]) { seen[$$N] = 1 ; print $$N"\t"$$0 ; } \
303 } } } ' \
304 $(SERVICES) | $(DBLOAD) -r -i $(SERVICES) \
305 -o $(YPMAPDIR)/$@ - $@
306 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
309 ifeq (x$(MERGE_PASSWD),xtrue)
310 passwd.byname: $(PASSWD) $(SHADOW) $(YPDIR)/Makefile
311 @echo "Updating $@..."
312 @$(UMASK); \
313 $(MERGER) -p $(PASSWD) $(SHADOW) | \
314 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
315 print $$1"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
316 -o $(YPMAPDIR)/$@ - $@
317 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
319 passwd.byuid: $(PASSWD) $(SHADOW) $(YPDIR)/Makefile
320 @echo "Updating $@..."
321 @$(UMASK); \
322 $(MERGER) -p $(PASSWD) $(SHADOW) | \
323 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
324 print $$3"\t"$$0 }' | $(DBLOAD) -i $(PASSWD) \
325 -o $(YPMAPDIR)/$@ - $@
326 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
328 # Don't build a shadow map !
329 shadow.byname:
330 @echo "Updating $@... Ignored -> merged with passwd"
332 else
334 passwd.byname: $(PASSWD) $(YPDIR)/Makefile
335 @echo "Updating $@..."
336 @$(UMASK); \
337 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
338 print $$1"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
339 -o $(YPMAPDIR)/$@ - $@
340 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
342 passwd.byuid: $(PASSWD) $(YPDIR)/Makefile
343 @echo "Updating $@..."
344 @$(UMASK); \
345 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINUID) && $$3 != $(NFSNOBODYUID) ) \
346 print $$3"\t"$$0 }' $(PASSWD) | $(DBLOAD) -i $(PASSWD) \
347 -o $(YPMAPDIR)/$@ - $@
348 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
350 shadow.byname: $(SHADOW) $(YPDIR)/Makefile
351 @echo "Updating $@..."
352 @$(UMASK); \
353 $(AWK) -F: '{ if (FILENAME ~ /shadow$$/) { \
354 if (UID[$$1] >= $(MINUID) && UID[$$1] != $(NFSNOBODYUID)) print $$1"\t"$$0; \
355 } else UID[$$1] = $$3; }' $(PASSWD) $(SHADOW) \
356 | $(DBLOAD) -s -i $(SHADOW) -o $(YPMAPDIR)/$@ - $@
357 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
358 endif
360 passwd.adjunct.byname: $(ADJUNCT) $(YPDIR)/Makefile
361 @echo "Updating $@..."
362 @$(UMASK); \
363 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" ) print $$1"\t"$$0 }' \
364 $(ADJUNCT) | $(DBLOAD) -s -i $(ADJUNCT) -o $(YPMAPDIR)/$@ - $@
365 @chmod 700 $(YPDIR)/$(DOMAIN)/$@*
366 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
368 ifeq (x$(MERGE_GROUP),xtrue)
369 group.byname: $(GROUP) $(GSHADOW) $(YPDIR)/Makefile
370 @echo "Updating $@..."
371 @$(UMASK); \
372 $(MERGER) -g $(GROUP) $(GSHADOW) | \
373 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
374 print $$1"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
375 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
377 group.bygid: $(GROUP) $(GSHADOW) $(YPDIR)/Makefile
378 @echo "Updating $@..."
379 @$(UMASK); \
380 $(MERGER) -g $(GROUP) $(GSHADOW) | \
381 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
382 print $$3"\t"$$0 }' | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
383 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
385 else
387 group.byname: $(GROUP) $(YPDIR)/Makefile
388 @echo "Updating $@..."
389 @$(UMASK); \
390 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
391 print $$1"\t"$$0 }' $(GROUP) \
392 | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
393 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
395 group.bygid: $(GROUP) $(YPDIR)/Makefile
396 @echo "Updating $@..."
397 @$(UMASK); \
398 $(AWK) -F: '!/^[-+#]/ { if ($$1 != "" && $$3 >= $(MINGID) && $$3 != $(NFSNOBODYGID) ) \
399 print $$3"\t"$$0 }' $(GROUP) \
400 | $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
401 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
402 endif
404 $(NETID):
405 netid.byname: $(GROUP) $(PASSWD) $(HOSTS) $(NETID) $(YPDIR)/Makefile
406 @echo "Updating $@..."
407 @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -d $(DOMAIN) \
408 -n $(NETID) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $@
409 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
412 mail.aliases: $(ALIASES) $(YPDIR)/Makefile
413 @echo "Updating $@..."
414 @$(AWK) '{ \
415 if ($$1 ~ "^#.*") \
416 next; \
417 if ($$1 == "" || $$1 == "+") { \
418 if (line != "") \
419 {print line; line = "";} \
420 next; \
422 if ($$0 ~ /^[[:space:]]/) \
423 line = line $$0; \
424 else { \
425 if (line != "") \
426 {print line; line = "";} \
427 line = $$0; \
430 END {if (line != "") print line}' \
431 $(ALIASES) | $(DBLOAD) --aliases \
432 -i $(ALIASES) -o $(YPMAPDIR)/$@ - $@
433 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
436 publickey.byname: $(PUBLICKEYS) $(YPDIR)/Makefile
437 @echo "Updating $@..."
438 @$(AWK) '{ if($$1 !~ "#" && $$1 != "") { print $$1"\t"$$2 }}' \
439 $(PUBLICKEYS) | $(DBLOAD) -i $(PUBLICKEYS) \
440 -o $(YPMAPDIR)/$@ - $@
441 @$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
444 printcap: $(PRINTCAP) $(YPDIR)/Makefile
445 @echo "Updating $@..."
446 @$(CREATE_PRINTCAP) < $(PRINTCAP) | \
447 $(DBLOAD) -i $(PRINTCAP) -o $(YPMAPDIR)/$@ - $@
448 @$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
451 auto.master: $(AUTO_MASTER) $(YPDIR)/Makefile
452 @echo "Updating $@..."
453 -@sed -e "/^#/d" -e s/#.*$$// $(AUTO_MASTER) | $(DBLOAD) \
454 -i $(AUTO_MASTER) -o $(YPMAPDIR)/$@ - $@
455 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
457 auto.home: $(AUTO_HOME) $(YPDIR)/Makefile
458 @echo "Updating $@..."
459 -@sed -e "/^#/d" -e s/#.*$$// $(AUTO_HOME) | $(DBLOAD) \
460 -i $(AUTO_HOME) -o $(YPMAPDIR)/$@ - $@
461 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
464 auto.local: $(AUTO_LOCAL) $(YPDIR)/Makefile
465 @echo "Updating $@..."
466 -@sed -e "/^#/d" -e s/#.*$$// $(AUTO_LOCAL) | $(DBLOAD) \
467 -i $(AUTO_LOCAL) -o $(YPMAPDIR)/$@ - $@
468 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
471 amd.home: $(AMD_HOME) $(YPDIR)/Makefile
472 @echo "Updating $@..."
473 -@sed -e "s/#.*$$//" -e "/^$$/d" $(AMD_HOME) | \
474 $(AWK) '{\
475 for (i = 1; i <= NF; i++)\
476 if (i == NF) { \
477 if (substr($$i, length($$i), 1) == "\\") \
478 printf("%s", substr($$i, 1, length($$i) -1)); \
479 else \
480 printf("%s\n",$$i); \
482 else \
483 printf("%s ",$$i);\
484 }' | $(DBLOAD) -i $(AMD_HOME) -o $(YPMAPDIR)/$@ - $@
485 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
487 timezone.byname: $(TIMEZONE) $(YPDIR)/Makefile
488 @echo "Updating $@..."
489 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#") \
490 print $$2"\t"$$0 }' $(TIMEZONE) | $(DBLOAD) \
491 -r -i $(TIMEZONE) -o $(YPMAPDIR)/$@ - $@
492 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
495 locale.byname: $(LOCALE) $(YPDIR)/Makefile
496 @echo "Updating $@..."
497 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#") \
498 print $$2"\t"$$0"\n"$$1"\t"$$2"\t"$$1 }' $(LOCALE) | $(DBLOAD) \
499 -r -i $(LOCALE) -o $(YPMAPDIR)/$@ - $@
500 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@
503 netmasks.byaddr: $(NETMASKS) $(YPDIR)/Makefile
504 @echo "Updating $@..."
505 @$(AWK) '{ if ($$1 != "" && $$1 !~ "#") \
506 print $$1"\t"$$2 }' $(NETMASKS) | $(DBLOAD) \
507 -r -i $(NETMASKS) -o $(YPMAPDIR)/$@ - $@
508 -@$(NOPUSH) || $(YPPUSH) -d $(DOMAIN) $@