0
|
1 |
#!/usr/bin/ksh93
|
|
2 |
|
|
3 |
#
|
|
4 |
# CDDL HEADER START
|
|
5 |
#
|
|
6 |
# The contents of this file are subject to the terms of the
|
|
7 |
# Common Development and Distribution License (the "License").
|
|
8 |
# You may not use this file except in compliance with the License.
|
|
9 |
#
|
|
10 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
11 |
# or http://www.opensolaris.org/os/licensing.
|
|
12 |
# See the License for the specific language governing permissions
|
|
13 |
# and limitations under the License.
|
|
14 |
#
|
|
15 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
16 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
17 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
18 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
19 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
20 |
#
|
|
21 |
# CDDL HEADER END
|
|
22 |
#
|
|
23 |
|
|
24 |
#
|
|
25 |
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
|
26 |
# Use is subject to license terms.
|
|
27 |
#
|
|
28 |
#ident "@(#)install-apr-32 1.2 09/03/02 SMI"
|
|
29 |
#
|
|
30 |
|
|
31 |
set -o errexit
|
|
32 |
|
|
33 |
. ${SRC}/tools/install.subr
|
|
34 |
. ${SRC}/cmd/apr/apr-1.3/apr.build.env
|
|
35 |
|
|
36 |
# functions - search for "START HERE" to find start of control flow
|
|
37 |
|
|
38 |
post_process() {
|
|
39 |
cd ${LIBDIR}
|
|
40 |
for i in *.so
|
|
41 |
do
|
|
42 |
chmod u+w ${i}
|
|
43 |
${SRC}/tools/post_process_so ${i}
|
|
44 |
chmod u-w ${i}
|
|
45 |
done
|
|
46 |
}
|
|
47 |
|
|
48 |
cleanup_crud() {
|
|
49 |
cd ${LIBDIR}
|
|
50 |
rm *.la
|
|
51 |
}
|
|
52 |
|
|
53 |
fix_perms() {
|
|
54 |
cd ${PREFIX}
|
|
55 |
APDIRS="bin build include lib manual"
|
|
56 |
APDIRS555="bin build lib"
|
|
57 |
APDIRS644="include manual"
|
|
58 |
|
|
59 |
find ${APDIRS} -type d -exec chmod 755 {} \;
|
|
60 |
find ${APDIRS555} -type f -exec chmod 555 {} \;
|
|
61 |
find ${APDIRS644} -type f -exec chmod 644 {} \;
|
|
62 |
}
|
|
63 |
|
|
64 |
# Install the APR-util manual generated using the doxygen
|
|
65 |
# tool. APR-util does not by default provide any documents
|
|
66 |
install_doc() {
|
|
67 |
if test ! -d ${DOCDIR}; then
|
|
68 |
mkdir ${DOCDIR}
|
|
69 |
fi
|
|
70 |
cd ${DOCDIR}
|
|
71 |
cat ${TOP}/Solaris/apr-1.3.docs.tar.gz | gunzip | tar xf -
|
|
72 |
}
|
|
73 |
|
|
74 |
# create soft link to the utility in ${BINDIR} from /usr/bin
|
|
75 |
# e.g., /usr/bin/apr-1-config --> /usr/apr/1.3/bin/apr-1-config
|
|
76 |
create_bin_link() {
|
|
77 |
cd ${BINDIR}
|
|
78 |
_install L ../${APR_DIR_PREFIX}/bin/apr-1-config ${ROOT}/usr/bin/apr-1-config
|
|
79 |
}
|
|
80 |
|
|
81 |
# replace build environment specific paths
|
|
82 |
replace_build_path() {
|
|
83 |
for dirs in ${BINDIR} ${BUILDDIR}; do
|
|
84 |
cd ${dirs}
|
|
85 |
for i in `ls -Lp | grep -v '/$'`; do
|
|
86 |
sed -e "s;${ROOT};;g" \
|
|
87 |
-e "s;-M ${MAPFILE_NOEXSTK} ;;g" \
|
|
88 |
-e "s;${SPRO_VROOT}/bin/;;g" \
|
|
89 |
-e "s;${APR_SRC_DIR32};${APR_USR_PREFIX};g" < ${i} > ${i}.tmp
|
|
90 |
cp -f ${i}.tmp ${i}
|
|
91 |
rm -f ${i}.tmp
|
|
92 |
done
|
|
93 |
done
|
|
94 |
}
|
|
95 |
|
|
96 |
# START HERE - actual script processing starts here
|
|
97 |
|
|
98 |
TOP=`pwd`
|
|
99 |
|
|
100 |
PREFIX=${ROOT}${APR_USR_PREFIX}
|
|
101 |
BINDIR=${PREFIX}/bin
|
|
102 |
BUILDDIR=${PREFIX}/build
|
|
103 |
LIBDIR=${PREFIX}/lib
|
|
104 |
DOCDIR=${PREFIX}/manual
|
|
105 |
APR_SRC_DIR32=${TOP}/${APR_DIR32}
|
|
106 |
|
|
107 |
post_process
|
|
108 |
cleanup_crud
|
|
109 |
install_doc
|
|
110 |
replace_build_path
|
|
111 |
|
|
112 |
# all installation should be done before this point, so the functions
|
|
113 |
# that fixup permissions can get everything that is installed.
|
|
114 |
fix_perms
|
|
115 |
create_bin_link
|
|
116 |
|
|
117 |
exit 0
|