xref: /titanic_44/usr/src/cmd/cmd-crypto/etc/Makefile (revision 1ce1951135b81c803c8dcf2f3c756009b1b0170a)
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	kmf.conf \
36	$(RELEASECRYPTO:%=certs/%) \
37	certs/CA \
38	certs/SUNWObjectCA
39
40ETCCERTSFILES = \
41	$(RELEASECERTS) \
42	SUNWSolarisCA \
43	SUNWObjectCA
44
45ANNOTATEDFILES = \
46	certs/SUNWObjectCA.annot
47
48include ../../Makefile.cmd
49
50.KEEP_STATE:
51
52ROOTCRYPTODIR=		$(ROOT)/etc/crypto
53ROOTCRYPTOCERTSDIR=	$(ROOTCRYPTODIR)/certs
54
55ROOTETCCERTSDIR=	$(ROOT)/etc/certs
56
57$(ROOTCRYPTODIR):=	OWNER= root
58$(ROOTCRYPTODIR):=	GROUP= sys
59$(ROOTETCCERTSDIR):=	OWNER= root
60$(ROOTETCCERTSDIR):=	GROUP= sys
61
62IETCCRYPTOFILES=	$(ETCCRYPTOFILES:%=$(ROOTCRYPTODIR)/%)
63IETCCERTSFILES=		$(ETCCERTSFILES:%=$(ROOTETCCERTSDIR)/%)
64
65$(ROOTCRYPTOCERTSDIR)/SUNWObjectCA: \
66			$(ROOTETCCERTSDIR)/SUNWObjectCA
67			$(RM) $@
68			$(LN) $(ROOTETCCERTSDIR)/SUNWObjectCA $@
69$(ROOTCRYPTODIR)/%:	%
70			$(INS.file)
71$(RELEASECRYPTO:%=$(ROOTCRYPTODIR)/certs/%): \
72			certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
73			$(RM) $@
74			$(INS) -s -m $(FILEMODE) -f $(@D) \
75				certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
76			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%) $@
77
78$(ROOTETCCERTSDIR)/SUNWObjectCA: \
79			certs/$$(@F)
80			$(RM) $@
81			$(INS) -s -m $(FILEMODE) -f $(@D) certs/$(@F)
82$(ROOTETCCERTSDIR)/%:	certs/%
83			$(INS.file)
84$(RELEASECERTS:%=$(ROOTETCCERTSDIR)/%): \
85			certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
86			$(RM) $@
87			$(INS) -s -m $(FILEMODE) -f $(@D) \
88				certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
89			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWSolaris%) $@
90
91ANNOT_DEL =	SOURCE ANNOTATION DELETE
92$(ANNOTATEDFILES:%.annot=%): \
93			$$(@:%=%.annot)
94			$(RM) $@
95			$(SED) -e '/${ANNOT_DEL} START/,/${ANNOT_DEL} END/d' \
96				$(@:%=%.annot) > $@
97
98$(IETCCRYPTOFILES):=	FILEMODE= 644
99$(IETCCRYPTOFILES):=	OWNER= root
100$(IETCCRYPTOFILES):=	GROUP= sys
101$(IETCCERTSFILES):=	FILEMODE= 644
102$(IETCCERTSFILES):=	OWNER= root
103$(IETCCERTSFILES):=	GROUP= sys
104
105install:	$(IETCCRYPTOFILES) $(IETCCERTSFILES)
106
107clean clobber:
108		$(RM) $(ANNOTATEDFILES:%.annot=%)
109