1778c7b1cSBill Paul# 2778c7b1cSBill Paul# Makefile for the NIS databases 3778c7b1cSBill Paul# 497d92980SPeter Wemm# $FreeBSD$ 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 3244519760SBill Paul# The following line encodes the YP_INTERDOMAIN key into the hosts.byname 3344519760SBill Paul# and hosts.byaddr maps so that ypserv(8) will do DNS lookups to resolve 3444519760SBill Paul# hosts not in the current domain. Commenting this line out will disable 3544519760SBill Paul# the DNS lookups. 3644519760SBill PaulB=-b 3744519760SBill Paul 3844519760SBill Paul# Normally, the master.passwd.* maps are guarded against access from 3944519760SBill Paul# non-privileged users. By commenting out the following line, the YP_SECURE 4044519760SBill Paul# key will be removed from these maps, allowing anyone to access them. 4144519760SBill PaulS=-s 4244519760SBill Paul 43778c7b1cSBill Paul# These are commands which this Makefile needs to properly rebuild the 44778c7b1cSBill Paul# NIS databases. Don't change these unless you have a good reason. Also 45778c7b1cSBill Paul# be sure not to place an @ in front of /usr/bin/awk: it isn't necessary 46778c7b1cSBill Paul# and it'll break everything in sight. 47778c7b1cSBill Paul# 48778c7b1cSBill PaulAWK = /usr/bin/awk 49778c7b1cSBill PaulRM = @/bin/rm -f 50b2264be8SBill PaulMV = @/bin/mv -f 511754677bSBill PaulRMV = /bin/mv -f 52778c7b1cSBill Paul 53de88f160SAdam DavidMKDB = /usr/sbin/yp_mkdb 54de88f160SAdam DavidDBLOAD = $(MKDB) -m `hostname` 55778c7b1cSBill PaulMKNETID = /usr/libexec/mknetid 56b2264be8SBill PaulNEWALIASES = /usr/bin/newaliases 571fff226dSBill PaulYPPUSH = /usr/sbin/yppush 58920491cfSBill Paul.if !defined(UPDATE_DOMAIN) 59778c7b1cSBill PaulDOMAIN = `/bin/domainname` 60920491cfSBill Paul.else 61920491cfSBill PaulDOMAIN = $(UPDATE_DOMAIN) 62920491cfSBill Paul.endif 63778c7b1cSBill PaulREVNETGROUP = /usr/libexec/revnetgroup 641754677bSBill PaulTMP = `echo $@.$$$$` 65778c7b1cSBill Paul 66de88f160SAdam David# It is advisable to create a separate directory to contain the 67de88f160SAdam David# source files used to generate your NIS maps. If you intend to 68b2264be8SBill Paul# support multiple domains, something like /src/dir/$DOMAIN 69b2264be8SBill Paul# would work well. 70778c7b1cSBill PaulYPSRCDIR = /etc 7113170f18SBill Paul.if !defined(YP_DIR) 72778c7b1cSBill PaulYPDIR = /var/yp 7313170f18SBill Paul.else 7413170f18SBill PaulYPDIR = $(YP_DIR) 7513170f18SBill Paul.endif 76778c7b1cSBill PaulYPMAPDIR = $(YPDIR)/$(DOMAIN) 77778c7b1cSBill Paul 78778c7b1cSBill Paul# These are the files from which the NIS databases are built. You may edit 79778c7b1cSBill Paul# these to taste in the event that you wish to keep your NIS source files 801a6e52d0SJeroen Ruigrok van der Werven# separate from your NIS server's actual configuration files. Note that the 81778c7b1cSBill Paul# NIS passwd and master.passwd files are stored in /var/yp: the server's 82778c7b1cSBill Paul# real password database is not used by default. However, you may use 83778c7b1cSBill Paul# the real /etc/passwd and /etc/master.passwd files by: 84778c7b1cSBill Paul# 85778c7b1cSBill Paul# 863939bb66SPoul-Henning Kamp# - invoking yppasswdd with `-t /etc/master.passwd' (yppasswdd will do a 873939bb66SPoul-Henning Kamp# 'pwd_mkdb' as needed if /etc/master.passwd is thus specified). 88778c7b1cSBill Paul# - Specifying the location of the master.passwd file using the 89778c7b1cSBill Paul# MASTER_PASSWD variable, i.e.: 90778c7b1cSBill Paul# 91778c7b1cSBill Paul# # make MASTER_PASSWD=/path/to/some/other/master.passwd 92778c7b1cSBill Paul# 93778c7b1cSBill Paul# - (optionally): editing this Makefile to change the default location. 94778c7b1cSBill Paul# 95778c7b1cSBill Paul# To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw 96778c7b1cSBill Paul# passwd file will be generated from the master.passwd file automagically. 97778c7b1cSBill Paul# 98778c7b1cSBill PaulETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd) 99778c7b1cSBill PaulBOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd) 100778c7b1cSBill PaulHOSTS = $(YPSRCDIR)/hosts 101a89e588cSHajimu UMEMOTOIPNODES = $(YPDIR)/ipnodes 102778c7b1cSBill PaulNETWORKS = $(YPSRCDIR)/networks 103778c7b1cSBill PaulPROTOCOLS = $(YPSRCDIR)/protocols 104778c7b1cSBill PaulRPC = $(YPSRCDIR)/rpc 105778c7b1cSBill PaulSERVICES = $(YPSRCDIR)/services 10680fc33c3SRobert DrehmelSHELLS = $(YPSRCDIR)/shells 107778c7b1cSBill PaulGROUP = $(YPSRCDIR)/group 108a00856a8SGregory Neil ShapiroALIASES = $(YPSRCDIR)/mail/aliases 109b2264be8SBill PaulNETGROUP = $(YPDIR)/netgroup 110778c7b1cSBill PaulPASSWD = $(YPDIR)/passwd 111778c7b1cSBill Paul.if !defined(MASTER_PASSWD) 112778c7b1cSBill PaulMASTER = $(YPDIR)/master.passwd 113778c7b1cSBill Paul.else 114778c7b1cSBill PaulMASTER = $(MASTER_PASSWD) 115778c7b1cSBill Paul.endif 116778c7b1cSBill PaulYPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain 117778c7b1cSBill PaulPUBLICKEY = $(YPSRCDIR)/publickey 1181fe3e67aSBill PaulNETID = $(YPSRCDIR)/netid 1193b056022SMark MurrayAMDHOST = $(YPSRCDIR)/amd.map 120778c7b1cSBill Paul 12113170f18SBill Paul# List of maps that are always built. 12213170f18SBill Paul# If you want to omit some of them, feel free to comment 12313170f18SBill Paul# them out from this list. 12480fc33c3SRobert DrehmelTARGETS= servers hosts networks protocols rpc services shells group 12513170f18SBill Paul#TARGETS+= aliases 12613170f18SBill Paul 12713170f18SBill Paul# Sanity checks: filter out targets we can't build 12813170f18SBill Paul# Note that we don't build the ethers or boorparams maps by default 12913170f18SBill Paul# since /etc/ethers and /etc/bootparams are not likely to be present 13013170f18SBill Paul# on all systems. 13113170f18SBill Paul.if exists($(ETHERS)) 13213170f18SBill PaulTARGETS+= ethers 13313170f18SBill Paul.else 13413170f18SBill PaulETHERS= /dev/null 13513170f18SBill Paul.endif 13613170f18SBill Paul 13713170f18SBill Paul.if exists($(BOOTPARAMS)) 13813170f18SBill PaulTARGETS+= bootparams 13913170f18SBill Paul.else 14013170f18SBill PaulBOOTPARAMS= /dev/null 14113170f18SBill Paul.endif 14213170f18SBill Paul 14313170f18SBill Paul.if exists($(NETGROUP)) 14413170f18SBill PaulTARGETS+= netgrp 14513170f18SBill Paul.else 14613170f18SBill PaulNETGROUP= /dev/null 14713170f18SBill Paul.endif 14813170f18SBill Paul 14913170f18SBill Paul.if exists($(MASTER)) 15013170f18SBill PaulTARGETS+= passwd master.passwd netid 15113170f18SBill Paul.else 15213170f18SBill PaulMASTER= /dev/null 15313170f18SBill PaulTARGETS+= nopass 15413170f18SBill Paul.endif 15513170f18SBill Paul 15613170f18SBill Paul.if exists($(PUBLICKEY)) 15713170f18SBill PaulTARGETS+= publickey 15813170f18SBill Paul.else 15913170f18SBill PaulPUBLICKEY= /dev/null 16013170f18SBill Paul.endif 16113170f18SBill Paul 16213170f18SBill Paul.if exists($(AMDHOST)) 1633b056022SMark MurrayTARGETS+= amd.map 16413170f18SBill Paul.else 16513170f18SBill PaulAMDHOST= /dev/null 16613170f18SBill Paul.endif 16713170f18SBill Paul 168a89e588cSHajimu UMEMOTO.if exists($(IPNODES)) 169a89e588cSHajimu UMEMOTOTARGETS+= ipnodes 170a89e588cSHajimu UMEMOTO.else 171a89e588cSHajimu UMEMOTOIPNODES= /dev/null 172a89e588cSHajimu UMEMOTO.endif 173a89e588cSHajimu UMEMOTO 174778c7b1cSBill Paultarget: 175778c7b1cSBill Paul @if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \ 176920491cfSBill Paul cd $(DOMAIN) ; echo "NIS Map update started on `date` for domain $(DOMAIN)" ; \ 177778c7b1cSBill Paul make -f ../Makefile all; echo "NIS Map update completed." 178778c7b1cSBill Paul 17913170f18SBill Paulall: $(TARGETS) 180778c7b1cSBill Paul 181778c7b1cSBill Paulethers: ethers.byname ethers.byaddr 182778c7b1cSBill Paulbootparam: bootparams 183778c7b1cSBill Paulhosts: hosts.byname hosts.byaddr 184a89e588cSHajimu UMEMOTOipnodes: ipnodes.byname ipnodes.byaddr 185778c7b1cSBill Paulnetworks: networks.byaddr networks.byname 186778c7b1cSBill Paulprotocols: protocols.bynumber protocols.byname 187778c7b1cSBill Paulrpc: rpc.byname rpc.bynumber 188778c7b1cSBill Paulservices: services.byname 18980fc33c3SRobert Drehmelshells: shells.list 190778c7b1cSBill Paulpasswd: passwd.byname passwd.byuid 191778c7b1cSBill Paulgroup: group.byname group.bygid 192778c7b1cSBill Paulnetgrp: netgroup 193778c7b1cSBill Paulnetid: netid.byname 194778c7b1cSBill Paulservers: ypservers 195778c7b1cSBill Paulpublickey: publickey.byname 196b2264be8SBill Paulaliases: mail.aliases 197778c7b1cSBill Paul 198778c7b1cSBill Paulmaster.passwd: master.passwd.byname master.passwd.byuid 199778c7b1cSBill Paul 200b3e93234SBill Paul# 201b3e93234SBill Paul# This is a special target used only when doing in-place updates with 202b3e93234SBill Paul# rpc.yppasswdd. In this case, the maps will be updated by the rpc.yppasswdd 203b3e93234SBill Paul# server and won't need to be remade. They will have to be pushed to the 204b3e93234SBill Paul# slaves however. Calling this target implicitly insures that this will 205b3e93234SBill Paul# happen. 206b3e93234SBill Paul# 207b3e93234SBill Paulpushpw: 208b3e93234SBill Paul @$(DBLOAD) -c 209b3e93234SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byname ; fi 210b3e93234SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) master.passwd.byuid ; fi 211b3e93234SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byname ; fi 212b3e93234SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) passwd.byuid ; fi 213b3e93234SBill Paul 21413170f18SBill Paulpushmap: 21513170f18SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $(PUSHMAP) ; fi 21613170f18SBill Paul 21713170f18SBill Paulnopass: 21813170f18SBill Paul @echo "" 21913170f18SBill Paul @echo " ********WARNING********" 22013170f18SBill Paul @echo " Couldn't find the master.passwd source file. This file" 22113170f18SBill Paul @echo " is needed to generate the master.passwd and passwd maps." 22213170f18SBill Paul @echo " The default location is /var/yp/master.passwd. You should" 22313170f18SBill Paul @echo " edit /var/yp/Makefile and set the MASTER variable to point" 22413170f18SBill Paul @echo " to the source file you wish to use for building the passwd" 22513170f18SBill Paul @echo " maps, or else invoke make(1) in the following manner:" 22681d30297SNick Hibma @echo "" 22713170f18SBill Paul @echo " make MASTER_PASSWD=/path/to/master.passwd" 22813170f18SBill Paul @echo "" 22913170f18SBill Paul 230b2264be8SBill Paulmail.aliases: $(ALIASES) 231b2264be8SBill Paul @echo "Updating $@..." 232de88f160SAdam David @$(NEWALIASES) -oA$(ALIASES) 233d91013b5SAdam David @$(MKDB) -u $(ALIASES).db \ 2341754677bSBill Paul | $(DBLOAD) -i $(ALIASES) -o $(YPMAPDIR)/$@ - $(TMP); \ 2351754677bSBill Paul $(RMV) $(TMP) $@ 236b2264be8SBill Paul @$(DBLOAD) -c 237b2264be8SBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 238b2264be8SBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 239b2264be8SBill Paul 240778c7b1cSBill Paul 241778c7b1cSBill Paulypservers: $(YPSERVERS) 242778c7b1cSBill Paul @echo "Updating $@..." 2430d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \ 2440d3b8ac4SRuslan Ermilov $(YPSERVERS) \ 2451754677bSBill Paul | $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $(TMP); \ 2461754677bSBill Paul $(RMV) $(TMP) $@ 247b2264be8SBill Paul @$(DBLOAD) -c 248778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 249778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 250778c7b1cSBill Paul 251778c7b1cSBill Paulethers.byname: $(ETHERS) 252778c7b1cSBill Paul @echo "Updating $@..." 25313170f18SBill Paul.if ${ETHERS} == "/dev/null" 25413170f18SBill Paul @echo "Ethers source file not found -- skipping" 25513170f18SBill Paul.else 2560d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 2570d3b8ac4SRuslan Ermilov print $$2"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \ 2581754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 259b2264be8SBill Paul @$(DBLOAD) -c 260a6dbeb65SPeter Wemm @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 261778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 26213170f18SBill Paul.endif 263778c7b1cSBill Paul 264778c7b1cSBill Paulethers.byaddr: $(ETHERS) 265778c7b1cSBill Paul @echo "Updating $@..." 26613170f18SBill Paul.if ${ETHERS} == "/dev/null" 26713170f18SBill Paul @echo "Ethers source file not found -- skipping" 26813170f18SBill Paul.else 2690d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 2700d3b8ac4SRuslan Ermilov print $$1"\t"$$0 }' $(ETHERS) | $(DBLOAD) -i $(ETHERS) \ 2711754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 272b2264be8SBill Paul @$(DBLOAD) -c 273778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 274778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 27513170f18SBill Paul.endif 276778c7b1cSBill Paul 277778c7b1cSBill Paul 278778c7b1cSBill Paulbootparams: $(BOOTPARAMS) 279778c7b1cSBill Paul @echo "Updating $@..." 28013170f18SBill Paul.if ${BOOTPARAMS} == "/dev/null" 28113170f18SBill Paul @echo "Bootparams source file not found -- skipping" 28213170f18SBill Paul.else 2830d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 2840d3b8ac4SRuslan Ermilov print $$0 }' $(BOOTPARAMS) | $(DBLOAD) -i $(BOOTPARAMS) \ 2851754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 286b2264be8SBill Paul @$(DBLOAD) -c 287778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 288778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 28913170f18SBill Paul.endif 290778c7b1cSBill Paul 291778c7b1cSBill Paul 292778c7b1cSBill Paulnetgroup: $(NETGROUP) netgroup.byhost netgroup.byuser 293778c7b1cSBill Paul @echo "Updating $@..." 29413170f18SBill Paul.if ${NETGROUP} == "/dev/null" 29513170f18SBill Paul @echo "Netgroup source file not found -- skipping" 29613170f18SBill Paul.else 2970d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 2980d3b8ac4SRuslan Ermilov print $$0 }' $(NETGROUP) | $(DBLOAD) -i $(NETGROUP) \ 2991754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 300b2264be8SBill Paul @$(DBLOAD) -c 301778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 302778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 303778c7b1cSBill Paul @$(MAKE) -f ../Makefile netid 30413170f18SBill Paul.endif 305778c7b1cSBill Paul 306778c7b1cSBill Paul 307778c7b1cSBill Paulnetgroup.byhost: $(NETGROUP) 308778c7b1cSBill Paul @echo "Updating $@..." 30913170f18SBill Paul.if ${NETGROUP} == "/dev/null" 31013170f18SBill Paul @echo "Netgroup source file not found -- skipping" 31113170f18SBill Paul.else 3120d3b8ac4SRuslan Ermilov @$(REVNETGROUP) -h -f $(NETGROUP) | \ 3130f87b00dSSteve Price $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 3140d3b8ac4SRuslan Ermilov print $$0 }' | $(DBLOAD) -i $(NETGROUP) \ 3151754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 316b2264be8SBill Paul @$(DBLOAD) -c 317778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 318778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 31913170f18SBill Paul.endif 320778c7b1cSBill Paul 321778c7b1cSBill Paul 322778c7b1cSBill Paulnetgroup.byuser: $(NETGROUP) 323778c7b1cSBill Paul @echo "Updating $@..." 32413170f18SBill Paul.if ${NETGROUP} == "/dev/null" 32513170f18SBill Paul @echo "Netgroup source file not found -- skipping" 32613170f18SBill Paul.else 3270d3b8ac4SRuslan Ermilov @$(REVNETGROUP) -u -f $(NETGROUP) | \ 3280f87b00dSSteve Price $(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 3290d3b8ac4SRuslan Ermilov print $$0 }' | $(DBLOAD) -i $(NETGROUP) \ 3301754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 331b2264be8SBill Paul @$(DBLOAD) -c 332778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 333778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 33413170f18SBill Paul.endif 335778c7b1cSBill Paul 336778c7b1cSBill Paul 337778c7b1cSBill Paulhosts.byname: $(HOSTS) 338778c7b1cSBill Paul @echo "Updating $@..." 3390d3b8ac4SRuslan Ermilov @$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ 3400d3b8ac4SRuslan Ermilov print $$n"\t"$$0 }' $(HOSTS) | $(DBLOAD) ${B} -i $(HOSTS) \ 3411754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 342b2264be8SBill Paul @$(DBLOAD) -c 343778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 344778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 345778c7b1cSBill Paul @$(MAKE) -f ../Makefile netid 346778c7b1cSBill Paul 347b2264be8SBill Paul 348778c7b1cSBill Paulhosts.byaddr: $(HOSTS) 349778c7b1cSBill Paul @echo "Updating $@..." 3500d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(HOSTS) \ 3511754677bSBill Paul | $(DBLOAD) ${B} -i $(HOSTS) -o $(YPMAPDIR)/$@ - $(TMP); \ 3521754677bSBill Paul $(RMV) $(TMP) $@ 353b2264be8SBill Paul @$(DBLOAD) -c 354778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 355778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 356778c7b1cSBill Paul @$(MAKE) -f ../Makefile netid 357778c7b1cSBill Paul 358778c7b1cSBill Paul 359a89e588cSHajimu UMEMOTOipnodes.byname: $(IPNODES) 360a89e588cSHajimu UMEMOTO @echo "Updating $@..." 361a89e588cSHajimu UMEMOTO.if ${IPNODES} == "/dev/null" 362a89e588cSHajimu UMEMOTO @echo "Ipnodes source file not found -- skipping" 363a89e588cSHajimu UMEMOTO.else 364a89e588cSHajimu UMEMOTO @$(AWK) '/^[0-9a-fA-F:]/ { for (n=2; n<=NF && $$n !~ "^#.*"; n++) \ 365a89e588cSHajimu UMEMOTO print $$n"\t"$$0 }' $(IPNODES) | $(DBLOAD) ${B} -i $(IPNODES) \ 366a89e588cSHajimu UMEMOTO -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 367a89e588cSHajimu UMEMOTO @$(DBLOAD) -c 368a89e588cSHajimu UMEMOTO @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 369a89e588cSHajimu UMEMOTO @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 370a89e588cSHajimu UMEMOTO @$(MAKE) -f ../Makefile netid 371a89e588cSHajimu UMEMOTO.endif 372a89e588cSHajimu UMEMOTO 373a89e588cSHajimu UMEMOTO 374a89e588cSHajimu UMEMOTOipnodes.byaddr: $(IPNODES) 375a89e588cSHajimu UMEMOTO @echo "Updating $@..." 376a89e588cSHajimu UMEMOTO.if ${IPNODES} == "/dev/null" 377a89e588cSHajimu UMEMOTO @echo "Ipnodes source file not found -- skipping" 378a89e588cSHajimu UMEMOTO.else 379a89e588cSHajimu UMEMOTO @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$0 }' $(IPNODES) \ 380a89e588cSHajimu UMEMOTO | $(DBLOAD) ${B} -i $(IPNODES) -o $(YPMAPDIR)/$@ - $(TMP); \ 381a89e588cSHajimu UMEMOTO $(RMV) $(TMP) $@ 382a89e588cSHajimu UMEMOTO @$(DBLOAD) -c 383a89e588cSHajimu UMEMOTO @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 384a89e588cSHajimu UMEMOTO @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 385a89e588cSHajimu UMEMOTO @$(MAKE) -f ../Makefile netid 386a89e588cSHajimu UMEMOTO.endif 387a89e588cSHajimu UMEMOTO 388a89e588cSHajimu UMEMOTO 389778c7b1cSBill Paulnetworks.byname: $(NETWORKS) 390778c7b1cSBill Paul @echo "Updating $@..." 3910d3b8ac4SRuslan Ermilov @$(AWK) \ 3920f87b00dSSteve Price '$$1 !~ "^#.*" { print $$1"\t"$$0; \ 3930f87b00dSSteve Price for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ 394778c7b1cSBill Paul print $$n"\t"$$0 \ 3950d3b8ac4SRuslan Ermilov }' $(NETWORKS) \ 3960d3b8ac4SRuslan Ermilov | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \ 3971754677bSBill Paul $(RMV) $(TMP) $@ 398b2264be8SBill Paul @$(DBLOAD) -c 399778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 400778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 401778c7b1cSBill Paul 402778c7b1cSBill Paul 403778c7b1cSBill Paulnetworks.byaddr: $(NETWORKS) 404778c7b1cSBill Paul @echo "Updating $@..." 4050d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(NETWORKS) \ 4061754677bSBill Paul | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $(TMP); \ 4071754677bSBill Paul $(RMV) $(TMP) $@ 408b2264be8SBill Paul @$(DBLOAD) -c 409778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 410778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 411778c7b1cSBill Paul 412778c7b1cSBill Paul 413778c7b1cSBill Paulprotocols.byname: $(PROTOCOLS) 414778c7b1cSBill Paul @echo "Updating $@..." 4150d3b8ac4SRuslan Ermilov @$(AWK) \ 4160f87b00dSSteve Price '$$1 !~ "^#.*" { print $$1"\t"$$0; \ 4170f87b00dSSteve Price for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ 418778c7b1cSBill Paul print $$n"\t"$$0 \ 4190d3b8ac4SRuslan Ermilov }' $(PROTOCOLS) | $(DBLOAD) -i $(PROTOCOLS) \ 4201754677bSBill Paul -o $(YPMAPDIR)/$@ - $(TMP); $(RMV) $(TMP) $@ 421b2264be8SBill Paul @$(DBLOAD) -c 422778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 423778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 424778c7b1cSBill Paul 425778c7b1cSBill Paul 426778c7b1cSBill Paulprotocols.bynumber: $(PROTOCOLS) 427778c7b1cSBill Paul @echo "Updating $@..." 4280d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(PROTOCOLS) \ 4291754677bSBill Paul | $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $(TMP); \ 4301754677bSBill Paul $(RMV) $(TMP) $@ 431b2264be8SBill Paul @$(DBLOAD) -c 432778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 433778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 434778c7b1cSBill Paul 435778c7b1cSBill Paul 436778c7b1cSBill Paulrpc.byname: $(RPC) 437778c7b1cSBill Paul @echo "Updating $@..." 4380d3b8ac4SRuslan Ermilov @$(AWK) \ 4390f87b00dSSteve Price '$$1 !~ "^#.*" { print $$1"\t"$$0; \ 4400f87b00dSSteve Price for (n=3; n<=NF && $$n !~ "^#.*"; n++) \ 441778c7b1cSBill Paul print $$n"\t"$$0 \ 4420d3b8ac4SRuslan Ermilov }' $(RPC) | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \ 4431754677bSBill Paul $(RMV) $(TMP) $@ 444b2264be8SBill Paul @$(DBLOAD) -c 445778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 446778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 447778c7b1cSBill Paul 448778c7b1cSBill Paul 449778c7b1cSBill Paulrpc.bynumber: $(RPC) 450778c7b1cSBill Paul @echo "Updating $@..." 4510d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { print $$2"\t"$$0 }' $(RPC) \ 4521754677bSBill Paul | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $(TMP); \ 4531754677bSBill Paul $(RMV) $(TMP) $@ 454b2264be8SBill Paul @$(DBLOAD) -c 455778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 456778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 457778c7b1cSBill Paul 458778c7b1cSBill Paul 459778c7b1cSBill Paulservices.byname: $(SERVICES) 460778c7b1cSBill Paul @echo "Updating $@..." 4610d3b8ac4SRuslan Ermilov @$(AWK) \ 4620f87b00dSSteve Price '$$1 !~ "^#.*" { for (n=1; n<=NF && $$n !~ "^#.*"; n++) { \ 463f44298dfSBill Paul if (split($$2, t, "/")) { \ 464f44298dfSBill Paul printf("%s/%s", $$n, t[2]) }; \ 4659ac2a83aSBill Paul print "\t"$$0; \ 46688b4ff3cSPeter Wemm if (n == 1) n = 2; \ 46788b4ff3cSPeter Wemm } ; print $$2"\t"$$0 ; \ 4680d3b8ac4SRuslan Ermilov }' $(SERVICES) \ 4690d3b8ac4SRuslan Ermilov | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $(TMP); \ 4701754677bSBill Paul $(RMV) $(TMP) $@ 471b2264be8SBill Paul @$(DBLOAD) -c 472778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 473778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 474778c7b1cSBill Paul 47580fc33c3SRobert Drehmelshells.list: $(SHELLS) 47680fc33c3SRobert Drehmel @echo "Updating $@..." 4770d3b8ac4SRuslan Ermilov @$(AWK) '{ if ($$1 != "" && $$1 !~ "^#.*") print $$0"\t"$$0 }' \ 4780d3b8ac4SRuslan Ermilov $(SHELLS) \ 4790d3b8ac4SRuslan Ermilov | $(DBLOAD) -i $(SHELLS) -o $(YPMAPDIR)/$@ - $(TMP); \ 48080fc33c3SRobert Drehmel $(RMV) $(TMP) $@ 48180fc33c3SRobert Drehmel @$(DBLOAD) -c 48280fc33c3SRobert Drehmel @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 48380fc33c3SRobert Drehmel @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 484778c7b1cSBill Paul 485778c7b1cSBill Paulpublickey.byname: $(PUBLICKEY) 486778c7b1cSBill Paul @echo "Updating $@..." 48713170f18SBill Paul.if ${PUBLICKEY} == "/dev/null" 48813170f18SBill Paul @echo "Publickey source file not found -- skipping" 48913170f18SBill Paul.else 4900d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { print $$1"\t"$$2 }' $(PUBLICKEY) \ 4911754677bSBill Paul | $(DBLOAD) -i $(PUBLICKEY) -o $(YPMAPDIR)/$@ - $(TMP); \ 4921754677bSBill Paul $(RMV) $(TMP) $@ 493b2264be8SBill Paul @$(DBLOAD) -c 494778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 495778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 49613170f18SBill Paul.endif 497778c7b1cSBill Paul 498778c7b1cSBill Paul 499778c7b1cSBill Paul$(PASSWD): $(MASTER) 500778c7b1cSBill Paul @echo "Creating new $@ file from $(MASTER)..." 501778c7b1cSBill Paul @if [ ! $(UNSECURE) ]; then \ 50203806e0dSBrian Somers $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5030d3b8ac4SRuslan Ermilov print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ 504778c7b1cSBill Paul > $(PASSWD) ; \ 5050d3b8ac4SRuslan Ermilov else \ 50603806e0dSBrian Somers $(AWK) -F: '{if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5070d3b8ac4SRuslan Ermilov print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $(MASTER) \ 508778c7b1cSBill Paul > $(PASSWD) ; fi 509778c7b1cSBill Paul 510778c7b1cSBill Paul 511778c7b1cSBill Paulpasswd.byname: $(PASSWD) 512778c7b1cSBill Paul @echo "Updating $@..." 5130d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5140d3b8ac4SRuslan Ermilov print $$1"\t"$$0 }' $(PASSWD) \ 515b22e036eSBill Paul | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ 5161754677bSBill Paul $(RMV) $(TMP) $@ 517b2264be8SBill Paul @$(DBLOAD) -c 518778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 519778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 520778c7b1cSBill Paul 521b2264be8SBill Paul 522778c7b1cSBill Paulpasswd.byuid: $(PASSWD) 523778c7b1cSBill Paul @echo "Updating $@..." 5240d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5250d3b8ac4SRuslan Ermilov print $$3"\t"$$0 }' $(PASSWD) \ 526b22e036eSBill Paul | $(DBLOAD) -f -i $(PASSWD) -o $(YPMAPDIR)/$@ - $(TMP); \ 5271754677bSBill Paul $(RMV) $(TMP) $@ 528b2264be8SBill Paul @$(DBLOAD) -c 529778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 530778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 531778c7b1cSBill Paul @$(MAKE) -f ../Makefile netid 532778c7b1cSBill Paul 533778c7b1cSBill Paul 534778c7b1cSBill Paulgroup.byname: $(GROUP) 535778c7b1cSBill Paul @echo "Updating $@..." 5360d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5370d3b8ac4SRuslan Ermilov print $$1"\t"$$0 }' $(GROUP) \ 538b22e036eSBill Paul | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \ 5391754677bSBill Paul $(RMV) $(TMP) $@ 540b2264be8SBill Paul @$(DBLOAD) -c 541778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 542778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 543778c7b1cSBill Paul 544778c7b1cSBill Paul 545778c7b1cSBill Paulgroup.bygid: $(GROUP) 546778c7b1cSBill Paul @echo "Updating $@..." 5470d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5480d3b8ac4SRuslan Ermilov print $$3"\t"$$0 }' $(GROUP) \ 549b22e036eSBill Paul | $(DBLOAD) -f -i $(GROUP) -o $(YPMAPDIR)/$@ - $(TMP); \ 5501754677bSBill Paul $(RMV) $(TMP) $@ 551b2264be8SBill Paul @$(DBLOAD) -c 552778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 553778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 554778c7b1cSBill Paul @$(MAKE) -f ../Makefile netid 555778c7b1cSBill Paul 556778c7b1cSBill Paul 557778c7b1cSBill Paulnetid.byname: $(GROUP) $(PASSWD) 558778c7b1cSBill Paul @echo "Updating $@..." 5591fe3e67aSBill Paul @$(MKNETID) -q -p $(PASSWD) -g $(GROUP) -h $(HOSTS) -n $(NETID) \ 5601754677bSBill Paul -d $(DOMAIN) | $(DBLOAD) -o $(YPMAPDIR)/$@ - $(TMP); \ 5611754677bSBill Paul $(RMV) $(TMP) $@ 562b2264be8SBill Paul @$(DBLOAD) -c 563778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 564778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 565778c7b1cSBill Paul 566778c7b1cSBill Paul 567778c7b1cSBill Paulmaster.passwd.byname: $(MASTER) 568778c7b1cSBill Paul @echo "Updating $@..." 56913170f18SBill Paul.if ${MASTER} == "/dev/null" 57013170f18SBill Paul @echo "Master.passwd source file not found -- skipping" 57113170f18SBill Paul.else 5720d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5730d3b8ac4SRuslan Ermilov print $$1"\t"$$0 }' $(MASTER) \ 574b22e036eSBill Paul | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ 5751754677bSBill Paul $(RMV) $(TMP) $@ 576b2264be8SBill Paul @$(DBLOAD) -c 577778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 578778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 57913170f18SBill Paul.endif 580778c7b1cSBill Paul 581778c7b1cSBill Paul 582778c7b1cSBill Paulmaster.passwd.byuid: $(MASTER) 583778c7b1cSBill Paul @echo "Updating $@..." 58413170f18SBill Paul.if ${MASTER} == "/dev/null" 58513170f18SBill Paul @echo "Master.passwd source file not found -- skipping" 58613170f18SBill Paul.else 5870d3b8ac4SRuslan Ermilov @$(AWK) -F: '{ if ($$1 != "" && $$1 !~ "^#.*" && $$1 != "+") \ 5880d3b8ac4SRuslan Ermilov print $$3"\t"$$0 }' $(MASTER) \ 589b22e036eSBill Paul | $(DBLOAD) ${S} -f -i $(MASTER) -o $(YPMAPDIR)/$@ - $(TMP); \ 5901754677bSBill Paul $(RMV) $(TMP) $@ 591b2264be8SBill Paul @$(DBLOAD) -c 592778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 593778c7b1cSBill Paul @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 59413170f18SBill Paul.endif 59513170f18SBill Paul 59657948c0bSPeter Wemm 5973b056022SMark Murrayamd.map: $(AMDHOST) 59857948c0bSPeter Wemm @echo "Updating $@..." 5990d3b8ac4SRuslan Ermilov @$(AWK) '$$1 !~ "^#.*" { \ 60057948c0bSPeter Wemm for (i = 1; i <= NF; i++) \ 60157948c0bSPeter Wemm if (i == NF) { \ 60257948c0bSPeter Wemm if (substr($$i, length($$i), 1) == "\\") \ 60357948c0bSPeter Wemm printf("%s", substr($$i, 1, length($$i) - 1)); \ 60457948c0bSPeter Wemm else \ 60557948c0bSPeter Wemm printf("%s\n", $$i); \ 60657948c0bSPeter Wemm } \ 60757948c0bSPeter Wemm else \ 60857948c0bSPeter Wemm printf("%s ", $$i); \ 6090d3b8ac4SRuslan Ermilov }' $(AMDHOST) | \ 6101754677bSBill Paul $(DBLOAD) -i $(AMDHOST) -o $(YPMAPDIR)/$@ - $(TMP); \ 6111754677bSBill Paul $(RMV) $(TMP) $@ 61257948c0bSPeter Wemm @$(DBLOAD) -c 61357948c0bSPeter Wemm @if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi 61457948c0bSPeter Wemm @if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi 61557948c0bSPeter Wemm 616