/
install-sfw
86 lines (73 loc) · 2.52 KB
/
install-sfw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/ksh93
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright (c) 2010 Joyent Inc.
#
set -o errexit
LIBDIR=${DESTDIR}/lib
BINDIR=${DESTDIR}/usr/bin
USRLIBDIR=${DESTDIR}/usr/lib
INCDIR=${DESTDIR}/usr/include
mkdir -p $LIBDIR
mkdir -p $BINDIR
mkdir -p $USRLIBDIR
mkdir -p $INCDIR
LIBVER=0.9.8
source ../install.subr
cd $VERDIR
# Remove SSE and MMX from the Capabilities section (x86 only)
if [[ ${MACH32} = "i86" ]]; then
elfedit -e 'cap:hw1 -and -cmp sse2' \
-e 'cap:hw1 -and -cmp mmx' libcrypto.so.${LIBVER}
fi
# Install libraries
_install D libcrypto.so.${LIBVER} ${LIBDIR}/libcrypto.so.${LIBVER} 0755
_install L libcrypto.so.${LIBVER} ${LIBDIR}/libcrypto.so
_install D libssl.so.${LIBVER} ${LIBDIR}/libssl.so.${LIBVER} 0755
_install L libssl.so.${LIBVER} ${LIBDIR}/libssl.so
_install L libcrypto.so.${LIBVER} ${USRLIBDIR}/libcrypto.so.${LIBVER}
_install L libcrypto.so ${USRLIBDIR}/libcrypto.so
_install L lib/libssl.so.${LIBVER} ${USRLIBDIR}/libssl.so.${LIBVER}
_install L lib/libssl.so ${USRLIBDIR}/libssl.so
# Install commands
_install P apps/CA.pl ${BINDIR}/CA.pl 0555
_install E apps/openssl ${BINDIR}/openssl 0555
mkdir -p ${DESTDIR}/usr/sfw/bin
_install L ../../bin/openssl ${DESTDIR}/usr/sfw/bin/openssl
# Install etc
mkdir -p ${DESTDIR}/etc/openssl
mkdir -p ${DESTDIR}/etc/openssl/certs
mkdir -p ${DESTDIR}/etc/openssl/private
mkdir -p ${DESTDIR}/etc/sfw
chmod 0700 ${DESTDIR}/etc/openssl/private
_install N apps/openssl.cnf ${DESTDIR}/etc/openssl/openssl.cnf 0644
_install L ../openssl ${DESTDIR}/etc/sfw/openssl
# Install header files
mkdir -p ${INCDIR}/openssl
cd include/openssl
for header in !(ec*|fips*|idea*); do
_install N ${header} ${INCDIR}/openssl/${header} 0444
done
exit 0