0
|
1 |
#!/bin/sh -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 |
#
|
10
|
23 |
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
0
|
24 |
# Use is subject to license terms.
|
|
25 |
#
|
|
26 |
# install objects in the proto area, since it would
|
|
27 |
# really like to install locally, but that doesn't scale.
|
|
28 |
#
|
10
|
29 |
#pragma ident "@(#)install-sfw 1.10 10/03/14 SMI"
|
0
|
30 |
|
|
31 |
TOP=`pwd`
|
|
32 |
BINDIR=${ROOT}/usr/sfw/bin
|
|
33 |
MANDIR=${ROOT}/usr/sfw/share/man/man1m
|
|
34 |
CONFDIR=${ROOT}/etc/webmin
|
|
35 |
WEBMINVERS=`cat Version`
|
|
36 |
WEBMINPKGVERS=${TOP}/webmin-${WEBMINVERS}
|
|
37 |
|
|
38 |
# Perl Modules
|
|
39 |
SSLEAYVER=Net_SSLeay.pm-1.30
|
10
|
40 |
AUTHENVER=Authen-PAM-0.16
|
0
|
41 |
RBACVER=Authen-SolarisRBAC-0.1
|
|
42 |
IOTTYVER=IO-Tty-1.02
|
|
43 |
SSLEAYPKGVERS=${TOP}/${SSLEAYVER}
|
|
44 |
AUTHENPKGVERS=${TOP}/${AUTHENVER}
|
|
45 |
RBACPKGVERS=${TOP}/${RBACVER}
|
|
46 |
IOTTYPKGVERS=${TOP}/${IOTTYVER}
|
|
47 |
PERL_MODS="${SSLEAYPKGVERS} ${AUTHENPKGVERS} ${RBACPKGVERS} ${IOTTYPKGVERS}"
|
|
48 |
WEBMINCONFDIR=${TOP}/etc
|
|
49 |
PREFIX=${ROOT}/usr/sfw/lib/webmin
|
|
50 |
SMFPREFIX=${ROOT}/var/svc/manifest/application/management
|
|
51 |
|
|
52 |
. ${SRC}/tools/install.subr
|
|
53 |
|
|
54 |
cd $TOP
|
|
55 |
# install webminsetup wrapper script file in /usr/sfw/bin
|
|
56 |
for i in webminsetup
|
|
57 |
do
|
|
58 |
_install S ${i} ${BINDIR}/${i} 555
|
|
59 |
done
|
|
60 |
|
|
61 |
# install man pages into SFW man dir. This assumes all files
|
|
62 |
# are for section 1m
|
|
63 |
for i in webmin webminsetup
|
|
64 |
do
|
|
65 |
_install N misc/${i}.1m ${MANDIR}/${i}.1m 444
|
|
66 |
done
|
|
67 |
|
|
68 |
rm -rf ${PREFIX} ${CONFDIR}
|
|
69 |
mkdir -p -m 755 ${PREFIX}
|
|
70 |
mkdir -p -m 700 ${CONFDIR}
|
|
71 |
mkdir -p -m 755 ${MANDIR}
|
|
72 |
mkdir -p -m 755 ${BINDIR}
|
|
73 |
mkdir -p -m 755 ${SMFPREFIX}
|
|
74 |
|
|
75 |
#
|
|
76 |
# Now copy the stuff in the webmin base directory to the proto area
|
|
77 |
#
|
|
78 |
cd ${WEBMINPKGVERS}
|
|
79 |
|
|
80 |
# The source directory ($WEBMINPKGVERS) should already have the correct
|
|
81 |
# permissions, just cpio the distibution, and change the owner:group
|
|
82 |
# attributes
|
|
83 |
/bin/find . -name '.svn' -prune -o -print | cpio -pdmv ${PREFIX}
|
|
84 |
|
|
85 |
#
|
|
86 |
# We now need to copy the private modules. This is a litte trickier,
|
|
87 |
# as most perl modules want to install on the machine being built.
|
|
88 |
# However, the modules here have a 'pure_perl_install' target that
|
|
89 |
# allows them to be installed into the destination target that was
|
|
90 |
# defined in the makefile when it was built. It is possible, though,
|
|
91 |
# that some perl modules do not properly handle this case, so these
|
|
92 |
# shouldn't be done in this loop, but in a separate install.
|
|
93 |
#
|
|
94 |
for mod in ${PERL_MODS}
|
|
95 |
do
|
|
96 |
cd ${mod}
|
|
97 |
echo ${mod}
|
|
98 |
/usr/ccs/bin/make pure_perl_install
|
|
99 |
done
|
|
100 |
|
|
101 |
#
|
|
102 |
# And the configuration files
|
|
103 |
#
|
|
104 |
cd ${WEBMINCONFDIR}
|
|
105 |
find . -print | cpio -pdmv ${CONFDIR}
|
|
106 |
chmod -R go-rwx ${CONFDIR}
|
|
107 |
|
|
108 |
cd $TOP
|
|
109 |
|
|
110 |
#
|
|
111 |
# And lastly the manifest
|
|
112 |
#
|
|
113 |
_install N misc/webmin.xml ${SMFPREFIX}/webmin.xml 444
|
|
114 |
|
|
115 |
#
|
|
116 |
# Make sure that the $PREFIX permissions are all correct
|
|
117 |
#
|
|
118 |
find ${PREFIX} -type f -exec chmod 0644 {} \;
|
|
119 |
find ${PREFIX} \( -type d -o -name "*.pl" -o -name "*.cgi" -o -name "*.so" \) -exec chmod 0755 {} \;
|
|
120 |
|
|
121 |
#
|
|
122 |
# We treat setup*.sh and start as a special cases
|
|
123 |
#
|
|
124 |
chmod 0755 ${PREFIX}/setup*.sh ${PREFIX}/start
|
|
125 |
|
|
126 |
# Don't want the config.status file in the package
|
|
127 |
/bin/rm ${PREFIX}/config.status
|