0
|
1 |
#!/bin/sh
|
|
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) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
0
|
25 |
#
|
14
|
26 |
#ident "@(#)install-bind 1.12 10/04/22 SMI"
|
0
|
27 |
|
|
28 |
# Install BIND's objects into the proto area ready for packaging.
|
|
29 |
#
|
|
30 |
|
|
31 |
# VERS should be provided on command line or set in environment
|
|
32 |
if [ $# -gt 0 ]; then
|
|
33 |
VERS=$1;
|
|
34 |
elif [ "${VERS}" = "" ]; then
|
|
35 |
echo "$0: Version not specified and Enviroment variable VERS not set!" 1>&2
|
|
36 |
exit 1
|
|
37 |
fi
|
|
38 |
|
|
39 |
if [ ! -d ${VERS} ]; then
|
|
40 |
echo "$0: Error: \"$VERS\" not a directory!" 1>&2
|
|
41 |
exit 1
|
|
42 |
fi
|
|
43 |
|
|
44 |
# Make sure post_process exists and is executable. It may not exist
|
|
45 |
# if it was missed by 'bringover'. It may not be executable if
|
|
46 |
# make(1) has not been used in parent directories previously
|
|
47 |
POSTPROCESS=${SRC}/tools/post_process
|
|
48 |
if [ -f ${POSTPROCESS} ]; then
|
|
49 |
if [ ! -x ${POSTPROCESS} ]; then
|
|
50 |
/usr/bin/chmod +x ${POSTPROCESS}
|
|
51 |
if [ ! -x ${POSTPROCESS} ]; then
|
|
52 |
echo "$0: Error: ${POSTPROCESS}: Failed to make executable!" >&2
|
|
53 |
exit 1
|
|
54 |
fi
|
|
55 |
fi
|
|
56 |
else
|
|
57 |
echo "$0: Error: ${POSTPROCESS}: Not found and is required!" >&2
|
|
58 |
exit 1
|
|
59 |
fi
|
|
60 |
|
|
61 |
PREFIX=${ROOT}/usr
|
|
62 |
BINDIR=${PREFIX}/sbin
|
|
63 |
LIBDIR=${PREFIX}/lib/dns
|
|
64 |
SBINDIR=${PREFIX}/sbin
|
|
65 |
DOCDIR=${PREFIX}/share/doc
|
14
|
66 |
MANIFESTDIR=${ROOT}/lib/svc/manifest/network
|
0
|
67 |
METHODDIR=${ROOT}/lib/svc/method
|
|
68 |
|
|
69 |
cd ${VERS}
|
|
70 |
cur_src="`pwd`"
|
|
71 |
LIBTOOL="${cur_src}/libtool"
|
|
72 |
INSTALL="${cur_src}/install-sh -c"
|
|
73 |
INSTALL_PROGRAM="${INSTALL} -m 555 "
|
|
74 |
INSTALL_DATA="${INSTALL} -m 444"
|
|
75 |
MKINSTALLDIRS="${cur_src}/mkinstalldirs"
|
|
76 |
|
|
77 |
# Install libraries.
|
|
78 |
# Both the dynamic and static libraries are installed.
|
|
79 |
# The static libraries are later removed!
|
|
80 |
# The order of lib subdir is important.
|
|
81 |
#
|
|
82 |
# libtool may moan that libraries are not installed in /usr/lib/dns.
|
|
83 |
# That's because we are installing to the proto area for packaging.
|
|
84 |
/bin/bash ${MKINSTALLDIRS} ${LIBDIR}
|
|
85 |
chmod 755 ${LIBDIR}
|
|
86 |
for f in "lib/isc/libisc.la" \
|
|
87 |
"lib/isccc/libisccc.la" \
|
|
88 |
"lib/dns/libdns.la" \
|
|
89 |
"lib/isccfg/libisccfg.la" \
|
|
90 |
"lib/lwres/liblwres.la" \
|
|
91 |
"lib/bind9/libbind9.la"
|
|
92 |
do
|
|
93 |
cd ${cur_src}/`dirname ${f}`
|
|
94 |
fn=`basename ${f}`
|
|
95 |
${LIBTOOL} --mode=install ${INSTALL_DATA} ${fn} ${LIBDIR}
|
|
96 |
if [ ! -f ${LIBDIR}/$fn ]; then
|
|
97 |
echo "$0: Error: ${fn} not installed in ${LIBDIR}!" >&2
|
|
98 |
exit 1
|
|
99 |
fi
|
|
100 |
done
|
|
101 |
|
|
102 |
# Install binaries
|
|
103 |
/bin/bash ${MKINSTALLDIRS} ${SBINDIR}
|
|
104 |
for f in "bin/named/named" \
|
|
105 |
"bin/rndc/rndc" "bin/rndc/rndc-confgen" \
|
|
106 |
"bin/dig/dig" "bin/dig/host" "bin/dig/nslookup" \
|
|
107 |
"bin/dnssec/dnssec-keygen" "bin/dnssec/dnssec-signzone" \
|
|
108 |
"bin/dnssec/dnssec-dsfromkey" "bin/dnssec/dnssec-keyfromlabel" \
|
|
109 |
"bin/nsupdate/nsupdate" \
|
|
110 |
"bin/check/named-checkconf" "bin/check/named-checkzone"
|
|
111 |
do
|
|
112 |
if [ ! -f ${cur_src}/${f} ]; then
|
|
113 |
echo "$0: Error: Binary file \"$f\" does not exist!" >&2
|
|
114 |
exit 1
|
|
115 |
fi
|
|
116 |
cd ${cur_src}/`dirname ${f}`
|
|
117 |
iprog=`basename ${f}`
|
|
118 |
|
|
119 |
${LIBTOOL} --mode=install ${INSTALL_PROGRAM} ${iprog} ${SBINDIR}/${iprog}
|
|
120 |
cd ${SBINDIR}
|
|
121 |
# Postprocess needs file to be writeable
|
|
122 |
if [ ! -w ${iprog} ]; then
|
|
123 |
# Try and make it writable for non-root building.
|
|
124 |
chmod u+w $iprog
|
|
125 |
if [ ! -w ${iprog} ]; then
|
|
126 |
echo "$0: Warning: $iprog: binary not writeable!" >&2
|
|
127 |
fi
|
|
128 |
${POSTPROCESS} ${iprog}
|
|
129 |
chmod u-w ${iprog}
|
|
130 |
else
|
|
131 |
${POSTPROCESS} ${iprog}
|
|
132 |
fi
|
|
133 |
done
|
|
134 |
|
|
135 |
# Create symbolic links for backward compatability.
|
|
136 |
cd ${SBINDIR}
|
|
137 |
rm -rf in.named
|
|
138 |
rm -rf ndc
|
|
139 |
ln -s named in.named
|
|
140 |
ln -s rndc ndc
|
|
141 |
|
|
142 |
# Install migration.txt documentation.
|
|
143 |
cd ${cur_src}
|
|
144 |
/bin/bash ${MKINSTALLDIRS} ${DOCDIR}/bind
|
|
145 |
chmod 755 ${DOCDIR}
|
|
146 |
chmod 755 ${DOCDIR}/bind
|
|
147 |
${INSTALL_DATA} ../migration.txt ${DOCDIR}/bind
|
|
148 |
|
|
149 |
# Install smf(5) manifest file.
|
|
150 |
if [ ! -d ${MANIFESTDIR} ]; then
|
|
151 |
/bin/bash ${MKINSTALLDIRS} ${MANIFESTDIR}
|
|
152 |
chmod 755 ${MANIFESTDIR}
|
|
153 |
fi
|
|
154 |
if [ ! -d ${MANIFESTDIR}/dns ]; then
|
|
155 |
/bin/bash ${MKINSTALLDIRS} ${MANIFESTDIR}/dns
|
|
156 |
chmod 755 ${MANIFESTDIR}/dns
|
|
157 |
fi
|
|
158 |
${INSTALL_DATA} ../server.xml ${MANIFESTDIR}/dns
|
|
159 |
|
|
160 |
# Install smf_method(5) script, removing .sh suffix.
|
|
161 |
if [ ! -d ${METHODDIR} ]; then
|
|
162 |
/bin/bash ${MKINSTALLDIRS} ${METHODDIR}
|
|
163 |
chmod 755 ${METHODDIR}
|
|
164 |
fi
|
|
165 |
${INSTALL_PROGRAM} ../dns-server.sh -t="s/\.sh\$//" ${METHODDIR}
|
|
166 |
|
|
167 |
# Remove static libraries which were installed above!
|
|
168 |
# We don't ship any static libraries.
|
|
169 |
rm -rf ${LIBDIR}/libdns.*a*
|
|
170 |
rm -rf ${LIBDIR}/libisc*.*a*
|
|
171 |
rm -rf ${LIBDIR}/liblwres.*a*
|
|
172 |
rm -rf ${LIBDIR}/libbind9.*a*
|
|
173 |
|
|
174 |
exit 0
|