xref: /illumos-gate/usr/src/cmd/cmd-crypto/etc/Makefile (revision 8548bf79039833dba8615afdf63258b2cb122121)
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
44include ../../Makefile.cmd
45
46.KEEP_STATE:
47
48ROOTCRYPTODIR=		$(ROOT)/etc/crypto
49ROOTCRYPTOCERTSDIR=	$(ROOTCRYPTODIR)/certs
50
51ROOTETCCERTSDIR=	$(ROOT)/etc/certs
52
53$(ROOTCRYPTODIR):=	OWNER= root
54$(ROOTCRYPTODIR):=	GROUP= sys
55$(ROOTETCCERTSDIR):=	OWNER= root
56$(ROOTETCCERTSDIR):=	GROUP= sys
57
58IETCCRYPTOFILES=	$(ETCCRYPTOFILES:%=$(ROOTCRYPTODIR)/%)
59IETCCERTSFILES=		$(ETCCERTSFILES:%=$(ROOTETCCERTSDIR)/%)
60
61$(ROOTCRYPTOCERTSDIR)/SUNWObjectCA: \
62			$(ROOTETCCERTSDIR)/SUNWObjectCA
63			$(RM) $@
64			$(LN) $(ROOTETCCERTSDIR)/SUNWObjectCA $@
65$(ROOTCRYPTODIR)/%:	%
66			$(INS.file)
67$(RELEASECRYPTO:%=$(ROOTCRYPTODIR)/certs/%): \
68			certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
69			$(RM) $@
70			$(INS) -s -m $(FILEMODE) -f $(@D) \
71				certs/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%)
72			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWCryptographic%) $@
73
74$(ROOTETCCERTSDIR)/SUNWObjectCA: \
75			certs/$(@F)
76			$(RM) $@
77			$(INS) -s -m $(FILEMODE) -f $(@D) certs/$(@F)
78$(ROOTETCCERTSDIR)/%:	certs/%
79			$(INS.file)
80$(RELEASECERTS:%=$(ROOTETCCERTSDIR)/%): \
81			certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
82			$(RM) $@
83			$(INS) -s -m $(FILEMODE) -f $(@D) \
84				certs/$(@F:SUNW_SunOS_5.%=SUNWSolaris%)
85			$(MV) $(@D)/$(@F:SUNW_SunOS_5.%=SUNWSolaris%) $@
86
87$(IETCCRYPTOFILES):=	FILEMODE= 644
88$(IETCCRYPTOFILES):=	OWNER= root
89$(IETCCRYPTOFILES):=	GROUP= sys
90$(IETCCERTSFILES):=	FILEMODE= 644
91$(IETCCERTSFILES):=	OWNER= root
92$(IETCCERTSFILES):=	GROUP= sys
93
94install:	$(IETCCRYPTOFILES) $(IETCCERTSFILES)
95