xref: /titanic_44/usr/src/cmd/print/scripts/Makefile.yp (revision 62a24de03df1f2399ceda704cb3874dabc98bbbd)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyrights (c) 1996 by Sun Microsystems, Inc.
24# All Rights Reserved
25#
26#	Example pieces of NIS Makefile.
27#
28# ident	"%Z%%M%	%I%	%E% SMI"
29#
30
31#
32# Printers conf Rules
33#
34DIR=/etc
35#
36$(DOM)/printers.conf.time: $(DIR)/printers.conf
37	-@if [ -f $(DIR)/printers.conf ]; then \
38		(sed -e '/^#/d' -e s/#.*$$// -e 's/[ 	][ 	]*$$//' \
39		  -e '/\\$$/s/\\$$/ /'  $(DIR)/printers.conf $(CHKPIPE))\
40		|( awk '/ $$/ {printf "%s", $$0} !/ $$/ {print}' $(CHKPIPE))\
41		|( sed -e 's/[ 	][ 	]*/ /g' -e 's/:[ 	]*:/:/' \
42			$(CHKPIPE))\
43		| awk -F: '{n=split($$1, nm, "|");  for (i=1; i<=n; i++) \
44				print nm[i], $$0}' \
45		| $(MAKEDBM) - $(YPDBDIR)/$(DOM)/printers.conf.byname ; \
46		touch $(DOM)/printers.conf.time;  \
47		echo "updated printers.conf";  \
48		if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOM) printers.conf.byname; \
49		fi ; \
50		if [ ! $(NOPUSH) ]; then echo "pushed printers.conf"; fi ; \
51	else \
52		echo "couldn't find $(DIR)/printers.conf"; \
53	fi
54
55#
56#	Dependency
57#
58printers.conf: $(DOM)/printers.conf.time
59