xref: /titanic_41/usr/src/cmd/cmd-crypto/etc/Makefile (revision 24db46411fd54f70c35b94bb952eb7ba040e43b4)
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 (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28RELEASECERTS =		SUNW_SunOS_5.10
29RELEASECRYPTO =		SUNW_SunOS_5.10 \
30			SUNW_SunOS_5.11_Limited
31
32ETCCRYPTOFILES = \
33	kcf.conf \
34	pkcs11.conf \
35	$(RELEASECRYPTO:%=certs/%) \
36	certs/CA \
37	certs/SUNWObjectCA
38
39ETCCERTSFILES = \
40	$(RELEASECERTS) \
41	SUNWSolarisCA \
42	SUNWObjectCA
43
44ANNOTATEDFILES = \
45	certs/SUNWObjectCA.annot
46
47include ../../Makefile.cmd
48
49.KEEP_STATE:
50
51ROOTCRYPTODIR=		$(ROOT)/etc/crypto
52ROOTCRYPTOCERTSDIR=	$(ROOTCRYPTODIR)/certs
53
54ROOTETCCERTSDIR=	$(ROOT)/etc/certs
55
56$(ROOTCRYPTODIR):=	OWNER= root
57$(ROOTCRYPTODIR):=	GROUP= sys
58$(ROOTETCCERTSDIR):=	OWNER= root
59$(ROOTETCCERTSDIR):=	GROUP= sys
60
61IETCCRYPTOFILES=	$(ETCCRYPTOFILES:%=$(ROOTCRYPTODIR)/%)
62IETCCERTSFILES=		$(ETCCERTSFILES:%=$(ROOTETCCERTSDIR)/%)
63
64$(ROOTCRYPTOCERTSDIR)/SUNWObjectCA: \
65			$(ROOTETCCERTSDIR)/SUNWObjectCA
66			$(RM) $@
67			$(LN) $(ROOTETCCERTSDIR)/SUNWObjectCA $@
68$(ROOTCRYPTODIR)/%:	%
69			$(INS.file)
70$(RELEASECRYPTO:%=$(ROOTCRYPTODIR)/certs/%): \
71			certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
72			$(RM) $@
73			$(INS) -s -m $(FILEMODE) -f $(@D) \
74				certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
75			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%) $@
76
77$(ROOTETCCERTSDIR)/SUNWObjectCA: \
78			certs/$$(@F)
79			$(RM) $@
80			$(INS) -s -m $(FILEMODE) -f $(@D) certs/$(@F)
81$(ROOTETCCERTSDIR)/%:	certs/%
82			$(INS.file)
83$(RELEASECERTS:%=$(ROOTETCCERTSDIR)/%): \
84			certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
85			$(RM) $@
86			$(INS) -s -m $(FILEMODE) -f $(@D) \
87				certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
88			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWSolaris%) $@
89
90ANNOT_DEL =	SOURCE ANNOTATION DELETE
91$(ANNOTATEDFILES:%.annot=%): \
92			$$(@:%=%.annot)
93			$(RM) $@
94			$(SED) -e '/${ANNOT_DEL} START/,/${ANNOT_DEL} END/d' \
95				$(@:%=%.annot) > $@
96
97$(IETCCRYPTOFILES):=	FILEMODE= 644
98$(IETCCRYPTOFILES):=	OWNER= root
99$(IETCCRYPTOFILES):=	GROUP= sys
100$(IETCCERTSFILES):=	FILEMODE= 644
101$(IETCCERTSFILES):=	OWNER= root
102$(IETCCERTSFILES):=	GROUP= sys
103
104install:	$(IETCCRYPTOFILES) $(IETCCERTSFILES)
105
106clean clobber:
107		$(RM) $(ANNOTATEDFILES:%.annot=%)
108