From e4ed737b82ad33ffe306a7ff5526000ace460e62 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 14 Dec 1995 01:16:56 +0000 Subject: [PATCH] install yp Makefile from here --- etc/Makefile | 4 +- etc/Makefile.yp | 172 ++++++++++++++++++++++++++++++++ usr.sbin/ypserv/ypinit/Makefile | 4 +- 3 files changed, 176 insertions(+), 4 deletions(-) create mode 100644 etc/Makefile.yp diff --git a/etc/Makefile b/etc/Makefile index 536cf49444d..52aeea22ca6 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,5 +1,5 @@ +# $NetBSD: Makefile,v 1.51 1995/11/01 13:52:40 pk Exp $ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $Id: Makefile,v 1.2 1995/11/01 16:42:45 deraadt Exp $ TZDIR= /usr/share/zoneinfo LOCALTIME= US/Pacific @@ -67,6 +67,8 @@ distribution: distrib-dirs ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime /bin/rm -f ${DESTDIR}/etc/rmt ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt + install -c -o root -g wheel -m 644 Makefile.yp \ + ${DESTDIR}/var/yp.no/Makefile install -c -o ${BINOWN} -g operator -m 664 /dev/null \ ${DESTDIR}/etc/dumpdates install -c -o ${BINOWN} -g operator -m 644 /dev/null \ diff --git a/etc/Makefile.yp b/etc/Makefile.yp new file mode 100644 index 00000000000..54d729d9155 --- /dev/null +++ b/etc/Makefile.yp @@ -0,0 +1,172 @@ +# from: @(#)Makefile 5.6.1.2 (Berkeley) 5/8/91 +# $Id: Makefile.yp,v 1.1 1995/12/14 01:19:40 deraadt Exp $ + +YPDBDIR=/var/yp +DIR=/etc +NOPUSH="" +# +AWK=/usr/bin/awk +CAT=/bin/cat +CUT=/usr/bin/cut +ECHO=/bin/echo +MAKEDBM=/usr/sbin/makedbm +SED=/usr/bin/sed +STDHOSTS=/usr/sbin/stdhosts +TOUCH=/usr/bin/touch +YPPUSH=$(ECHO) "YPPUSH Not Yet Implemented: " + +all: passwd group hosts networks rpc services protocols + +passwd.time: $(DIR)/master.passwd + -@if [ -f $(>) ]; then \ + $(CAT) $(>) | $(CUT) -d: -f1-4,8-10 | \ + $(AWK) 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \ + { print $$1, $$0 }' - | $(MAKEDBM) - passwd.byname; \ + $(CAT) $(>) | $(CUT) -d: -f1-4,8-10 |\ + $(AWK) 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \ + { print $$3, $$0 }' - | $(MAKEDBM) - passwd.byuid; \ + $(TOUCH) $(@); \ + $(ECHO) "updated passwd"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) passwd.byname; \ + $(YPPUSH) passwd.byuid; \ + $(ECHO) "pushed passwd"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + + +group.time: $(DIR)/group + -@if [ -f $(>) ]; then \ + $(AWK) 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \ + { print $$1, $$0 }' $(>) | \ + $(MAKEDBM) - group.byname; \ + $(AWK) 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \ + { print $$3, $$0 }' $(>) | \ + $(MAKEDBM) - group.bygid; \ + $(TOUCH) $(@); \ + $(ECHO) "updated group"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) group.byname; \ + $(YPPUSH) group.bygid; \ + $(ECHO) "pushed group"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + +hosts.time: $(DIR)/hosts + -@if [ -f $(DIR)/hosts ]; then \ + $(STDHOSTS) $(>) | $(SED) -e s/#.*$$// | \ + $(AWK) '{for (i = 2; i <= NF; i++) print $$i, $$0 }' | \ + $(MAKEDBM) - hosts.byname; \ + $(STDHOSTS) $(>) | \ + $(AWK) 'BEGIN { OFS="\t"; } { print $$1, $$0 }' | \ + $(MAKEDBM) - hosts.byaddr; \ + $(TOUCH) $(@); \ + $(ECHO) "updated hosts"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) hosts.byname; \ + $(YPPUSH) hosts.byaddr; \ + $(ECHO) "pushed hosts"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + +networks.time: $(DIR)/networks + -@if [ -f $(>) ]; then \ + $(SED) -e "/^#/d" -e s/#.*$$// $(>) | \ + $(AWK) '{print $$1, $$0; for (i = 3;i <= NF;i++) print $$i,$$0}' | \ + $(MAKEDBM) - networks.byname; \ + $(AWK) 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' $(>) | \ + $(MAKEDBM) - networks.byaddr; \ + $(TOUCH) $(@); \ + $(ECHO) "updated networks"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) networks.byname; \ + $(YPPUSH) networks.byaddr; \ + $(ECHO) "pushed networks"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + +rpc.time: $(DIR)/rpc + -@if [ -f $(>) ]; then \ + $(AWK) 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' $(>) | \ + $(MAKEDBM) - rpc.bynumber; \ + $(TOUCH) $(@); \ + $(ECHO) "updated rpc"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) rpc.bynumber; \ + $(ECHO) "pushed rpc"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + + +services.time: $(DIR)/services + -@if [ -f $(>) ]; then \ + $(AWK) 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' $(>) | \ + $(MAKEDBM) - services.byname; \ + $(TOUCH) $(@); \ + $(ECHO) "updated services"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) services.byname; \ + $(ECHO) "pushed services"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + + +protocols.time: $(DIR)/protocols + -@if [ -f $(>) ]; then \ + $(AWK) 'BEGIN { OFS="\t"; } $$1 !~ /^#/ { print $$2, $$0 }' $(>) | \ + $(MAKEDBM) - protocols.bynumber; \ + $(SED) -e "/^#/d" -e s/#.*$$// $(>) | \ + $(AWK) '{print $$1, $$0; for (i = 3;i <= NF;i++) print $$i,$$0}' | \ + $(MAKEDBM) - protocols.byname; \ + $(TOUCH) $(@); \ + $(ECHO) "updated protocols"; \ + if [ ! $(NOPUSH) ]; then \ + $(YPPUSH) protocols.bynumber; \ + $(YPPUSH) protocols.byname; \ + $(ECHO) "pushed protocols"; \ + else \ + : ; \ + fi \ + else \ + $(ECHO) "couldn't find $(>)"; \ + fi + + +passwd: passwd.time +group: group.time +hosts: hosts.time +networks: networks.time +rpc: rpc.time +services: services.time +protocols: protocols.time +$(DIR)/passwd: +$(DIR)/group: +$(DIR)/hosts: +$(DIR)/networks: +$(DIR)/rpc: +$(DIR)/services: +$(DIR)/protocols: diff --git a/usr.sbin/ypserv/ypinit/Makefile b/usr.sbin/ypserv/ypinit/Makefile index fce3cdb6915..03141df395a 100644 --- a/usr.sbin/ypserv/ypinit/Makefile +++ b/usr.sbin/ypserv/ypinit/Makefile @@ -1,12 +1,10 @@ # from: @(#)Makefile 5.3 (Berkeley) 6/22/90 -# $Id: Makefile,v 1.3 1995/11/08 00:01:04 deraadt Exp $ +# $Id: Makefile,v 1.4 1995/12/14 01:16:56 deraadt Exp $ FILES= Makefile.yp NOOBJ= noobj install: - install -c -o root -g wheel -m 644 Makefile.yp \ - ${DESTDIR}/var/yp.no/Makefile install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${.CURDIR}/ypinit.sh ${DESTDIR}/usr/sbin/ypinit -- 2.20.1