0
|
1 |
#!/bin/ksh93 -e
|
|
2 |
#
|
|
3 |
# CDDL HEADER START
|
|
4 |
#
|
|
5 |
# The contents of this file are subject to the terms of the
|
|
6 |
# Common Development and Distribution License (the "License").
|
|
7 |
# You may not use this file except in compliance with the License.
|
|
8 |
#
|
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
|
10 |
# or http://www.opensolaris.org/os/licensing.
|
|
11 |
# See the License for the specific language governing permissions
|
|
12 |
# and limitations under the License.
|
|
13 |
#
|
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each
|
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
16 |
# If applicable, add the following below this CDDL HEADER, with the
|
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
19 |
#
|
|
20 |
# CDDL HEADER END
|
|
21 |
#
|
|
22 |
|
|
23 |
#
|
14
|
24 |
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
0
|
25 |
#
|
14
|
26 |
#ident "@(#)install-sfw 1.5 10/04/22 SMI"
|
0
|
27 |
|
|
28 |
set -o errexit
|
|
29 |
|
|
30 |
source ${SRC}/tools/install.subr
|
|
31 |
|
|
32 |
# functions - search for "START HERE" to find start of control flow
|
|
33 |
|
|
34 |
install_smf_hooks() {
|
|
35 |
cd ${TOP}/Solaris
|
|
36 |
_install N http-lighttpd14.xml ${MANIFESTDIR}/http-lighttpd14.xml 444
|
|
37 |
_install N http-lighttpd14 ${METHODDIR}/http-lighttpd14 555
|
|
38 |
}
|
|
39 |
|
|
40 |
post_process() {
|
|
41 |
cd ${SBINDIR}
|
|
42 |
for i in \
|
|
43 |
lighttpd \
|
|
44 |
lighttpd-angel
|
|
45 |
do
|
|
46 |
chmod u+w ${i}
|
|
47 |
${SRC}/tools/post_process ${i}
|
|
48 |
chmod u-w ${i}
|
|
49 |
done
|
|
50 |
|
|
51 |
cd ${LIBDIR}
|
|
52 |
for i in *.so
|
|
53 |
do
|
|
54 |
chmod u+w ${i}
|
|
55 |
${SRC}/tools/post_process_so ${i}
|
|
56 |
chmod u-w ${i}
|
|
57 |
done
|
|
58 |
}
|
|
59 |
|
|
60 |
cleanup_crud() {
|
|
61 |
cd ${LIBDIR}
|
|
62 |
rm *.la
|
|
63 |
}
|
|
64 |
|
|
65 |
fix_lighttpd_perms() {
|
|
66 |
|
|
67 |
cd ${CONFDIR}
|
|
68 |
find . -type f -exec chmod 644 {} \;
|
|
69 |
|
|
70 |
cd ${PREFIX}
|
|
71 |
APDIRS="man"
|
|
72 |
find ${APDIRS} -type d -exec chmod 755 {} \;
|
|
73 |
find ${APDIRS} -type f -exec chmod 444 {} \;
|
|
74 |
|
|
75 |
cd ${PREFIX}
|
3
|
76 |
APDIRS="lib sbin"
|
0
|
77 |
find ${APDIRS} -type d -exec chmod 755 {} \;
|
|
78 |
find ${APDIRS} -type f -exec chmod 555 {} \;
|
|
79 |
|
|
80 |
cd ${VARDIR}
|
|
81 |
APDIRS="docroot logs"
|
|
82 |
find ${APDIRS} -type d -exec chmod 755 {} \;
|
|
83 |
find ${APDIRS} -type f -exec chmod 644 {} \;
|
|
84 |
}
|
|
85 |
|
|
86 |
install_man_files() {
|
3
|
87 |
cd ${TOP}/${VER}/doc
|
0
|
88 |
for manpage in \
|
3
|
89 |
lighttpd.8
|
0
|
90 |
do
|
3
|
91 |
rm ${PREFIX}/man/man8/${manpage}
|
|
92 |
_install M ${manpage} ${PREFIX}/man/man8/${manpage} 444
|
0
|
93 |
done
|
3
|
94 |
cd ${TOP}/Solaris
|
0
|
95 |
_install N lighttpd.1m.sunman ${ROOT}/usr/share/man/man1m/lighttpd.1m 444
|
|
96 |
}
|
|
97 |
|
|
98 |
install_config_files() {
|
|
99 |
cd ${TOP}/${VER}/doc
|
|
100 |
_install N lighttpd.conf ${CONFDIR}/lighttpd.conf 644
|
|
101 |
cd ${TOP}/Solaris
|
|
102 |
_install N fcgi-php.conf ${CONFDIR}/conf.d/fcgi-php.conf 644
|
|
103 |
_install N ssl.conf ${CONFDIR}/conf.d/ssl.conf 644
|
9
|
104 |
|
|
105 |
cd ${TOP}
|
|
106 |
_install N auth_attr ${ETC}/security/auth_attr.d/lighttpd 444
|
|
107 |
_install N prof_attr ${ETC}/security/prof_attr.d/lighttpd 444
|
0
|
108 |
}
|
|
109 |
|
3
|
110 |
install_symlinks() {
|
|
111 |
_install L ../../../bin/spawn-fcgi ${BINDIR}/spawn-fcgi
|
|
112 |
_install L ../../../../share/man/man1/spawn-fcgi.1 ${MAN1DIR}/spawn-fcgi.1
|
0
|
113 |
}
|
|
114 |
|
|
115 |
# START HERE - actual script processing starts here
|
|
116 |
|
|
117 |
TOP=`pwd`
|
|
118 |
|
|
119 |
LIGHTTPD_VERSION=1.4
|
|
120 |
PREFIX=${ROOT}/usr/lighttpd/${LIGHTTPD_VERSION}
|
|
121 |
CONFDIR=$ROOT/etc/lighttpd/${LIGHTTPD_VERSION}
|
|
122 |
VARDIR=$ROOT/var/lighttpd/${LIGHTTPD_VERSION}
|
|
123 |
DOCROOT=${VARDIR}/docroot
|
|
124 |
MANDIR=${PREFIX}/man
|
|
125 |
MAN1DIR=${MANDIR}/man1
|
|
126 |
ETC=${ROOT}/etc
|
|
127 |
|
|
128 |
BINDIR=${PREFIX}/bin
|
|
129 |
SBINDIR=${PREFIX}/sbin
|
|
130 |
LIBDIR=${PREFIX}/lib
|
|
131 |
|
14
|
132 |
MANIFESTDIR=${ROOT}/lib/svc/manifest/network
|
0
|
133 |
METHODDIR=${ROOT}/lib/svc/method
|
|
134 |
|
3
|
135 |
MANSCRIPT=${TOP}/sunman-stability
|
|
136 |
|
0
|
137 |
install_smf_hooks
|
|
138 |
post_process
|
|
139 |
cleanup_crud
|
|
140 |
install_config_files
|
|
141 |
install_man_files
|
3
|
142 |
install_symlinks
|
0
|
143 |
|
|
144 |
# all installation should be done before this point, so the functions
|
|
145 |
# that fixup permissions can get everything that is installed.
|
|
146 |
|
|
147 |
fix_lighttpd_perms
|
|
148 |
|
|
149 |
exit 0
|