Added revnetgroup in ypserv's Makefile and added support for netgroup. -moj
authormaja <maja@openbsd.org>
Tue, 15 Apr 1997 22:58:57 +0000 (22:58 +0000)
committermaja <maja@openbsd.org>
Tue, 15 Apr 1997 22:58:57 +0000 (22:58 +0000)
usr.sbin/ypserv/Makefile
usr.sbin/ypserv/ypinit/Makefile.main
usr.sbin/ypserv/ypinit/Makefile.yp

index 3fb15fe..33a3c1d 100644 (file)
@@ -1,5 +1,6 @@
-#      $OpenBSD: Makefile,v 1.4 1996/05/30 09:52:58 deraadt Exp $
+#      $OpenBSD: Makefile,v 1.5 1997/04/15 22:58:57 maja Exp $
 
-SUBDIR=        makedbm mknetid stdethers stdhosts ypinit ypserv yptest yppush ypxfr
+SUBDIR=        makedbm mknetid revnetgroup stdethers stdhosts \
+       ypinit ypserv yptest yppush ypxfr
 
 .include <bsd.subdir.mk>
index ce3f7e4..ca1e926 100644 (file)
@@ -1,7 +1,7 @@
-#      $OpenBSD: Makefile.main,v 1.5 1996/05/30 09:53:16 deraadt Exp $
+#      $OpenBSD: Makefile.main,v 1.6 1997/04/15 22:58:58 maja Exp $
 
 SUBDIR=        
 
-passwd group hosts networks rpc services protocols netid: _SUBDIRUSE
+passwd group hosts ethers networks rpc services protocols netid netgroup: _SUBDIRUSE
 
 .include <bsd.subdir.mk>
index c8c1a95..07d5f85 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile.yp,v 1.6 1997/03/13 09:50:26 maja Exp $
+#      $OpenBSD: Makefile.yp,v 1.7 1997/04/15 22:58:59 maja Exp $
 
 YPDBDIR=/var/yp
 DIR=/etc
@@ -13,6 +13,7 @@ SED=/usr/bin/sed
 STDHOSTS=/usr/sbin/stdhosts
 STDETHERS=/usr/sbin/stdethers
 MKNETID=/usr/sbin/mknetid
+REVNETGROUP=/usr/sbin/revnetgroup
 TOUCH=/usr/bin/touch
 DOMAIN="`/usr/bin/basename ${.CURDIR}`"
 YPPUSH=/usr/sbin/yppush
@@ -24,7 +25,7 @@ YPPUSH=/usr/sbin/yppush
 MAKEDBM-S=$(MAKEDBM) -s
 UNSECURE="True"
 
-all: passwd group hosts ethers networks rpc services protocols netid
+all: passwd group hosts ethers networks rpc services protocols netid netgroup
 
 passwd.time: $(DIR)/master.passwd
        -@if [ -f $(>) ]; then \
@@ -218,6 +219,28 @@ netid.time: $(DIR)/passwd $(DIR)/group $(DIR)/hosts $(DIR)/netid
          fi
 
 
+netgroup.time: $(DIR)/netgroup
+       -@if [ -f $(>) ]; then \
+               $(CAT) $(>) | $(MAKEDBM) - netgroup; \
+               $(CAT) $(>) | $(REVNETGROUP) -u -f - | \
+               $(MAKEDBM) - netgroup.byuser; \
+               $(CAT) $(>) | $(REVNETGROUP) -h -f - | \
+               $(MAKEDBM) - netgroup.byhost; \
+               $(TOUCH) $(@); \
+               $(ECHO) "updated netgroup"; \
+               if [ ! $(NOPUSH) ]; then \
+                       $(YPPUSH) -d $(DOMAIN) netgroup; \
+                       $(YPPUSH) -d $(DOMAIN) netgroup.byuser; \
+                       $(YPPUSH) -d $(DOMAIN) netgroup.byhost; \
+                       $(ECHO) "pushed netgroup"; \
+               else \
+                       : ; \
+               fi \
+       else \
+               $(ECHO) "couldn't find $(>)"; \
+       fi
+
+
 passwd: passwd.time
 group: group.time
 hosts: hosts.time
@@ -227,6 +250,7 @@ rpc: rpc.time
 services: services.time
 protocols: protocols.time
 netid: netid.time
+netgroup: netgroup.time
 $(DIR)/passwd:
 $(DIR)/group:
 $(DIR)/hosts:
@@ -237,3 +261,5 @@ $(DIR)/services:
 $(DIR)/protocols:
 $(DIR)/netid:
 $(DIR)/master.passwd:
+$(DIR)/netgroup:
+