author | Cyril Plisko <cyril.plisko@grigale.com> |
Fri, 11 Jun 2010 23:41:07 -0700 | |
changeset 16 | 4481d72bca2d |
parent 14 | ebdd963f7d5e |
child 154 | b8fe83024c4a |
permissions | -rw-r--r-- |
0 | 1 |
#!/bin/ksh |
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 |
# |
|
14 | 22 |
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 23 |
# |
16
4481d72bca2d
Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
14
diff
changeset
|
24 |
#ident "@(#)install-openldap 1.6 10/06/02 SMI" |
0 | 25 |
|
26 |
# VERS should be provided on command line or set in environment |
|
27 |
if [ $# -ge 2 ]; then |
|
28 |
VERS=$1; |
|
29 |
LVERS=$2; |
|
30 |
elif [ "${VERS}" = "" ]; then |
|
31 |
echo "$0: Version not specified and Enviroment variable VERS not set!" 1>&2 |
|
32 |
exit 1 |
|
33 |
fi |
|
34 |
||
35 |
if [ ! -d ${VERS} ]; then |
|
36 |
echo "$0: Error: \"$VERS\" not a directory!" 1>&2 |
|
37 |
exit 1 |
|
38 |
fi |
|
39 |
||
40 |
. ${SRC}/tools/install.subr |
|
41 |
||
42 |
PREFIX=${ROOT} |
|
43 |
EPREFIX=${ROOT}/usr |
|
44 |
BINDIR=${EPREFIX}/bin |
|
45 |
ETCDIR=${PREFIX}/etc/openldap |
|
46 |
SCHEMADIR=${PREFIX}/etc/openldap/schema |
|
47 |
REALCONFDIR=/etc/openldap |
|
48 |
INCDIR=${EPREFIX}/include/openldap |
|
49 |
LIBDIR=${EPREFIX}/lib |
|
50 |
LIBEXECDIR=${EPREFIX}/lib |
|
51 |
LIBOLBIN=${LIBDIR}/openldap/bin |
|
52 |
SHARE=${EPREFIX}/share |
|
53 |
MAN1DIR=${SHARE}/man/man1oldap |
|
54 |
MAN3DIR=${SHARE}/man/man3oldap |
|
55 |
MAN5DIR=${SHARE}/man/man5oldap |
|
56 |
MAN8DIR=${SHARE}/man/man8oldap |
|
57 |
MANTAG=oldap |
|
58 |
DOCADMDIR=${SHARE}/doc/openldap/admin24 |
|
59 |
DOCIMGDIR=${SHARE}/doc/openldap/images |
|
60 |
SBINDIR=${EPREFIX}/sbin |
|
61 |
REALVARRUNDIR=/var/run/openldap |
|
62 |
REALVARDIR=/var/openldap |
|
63 |
CPREFIX=open |
|
64 |
||
65 |
setrunpath() |
|
66 |
{ |
|
67 |
elfedit -e "dyn:runpath /usr/sfw/lib" $1 |
|
68 |
} |
|
69 |
||
70 |
cd ${VERS} |
|
71 |
TOP=`pwd` |
|
72 |
||
73 |
## Client Tools |
|
74 |
cd clients/tools |
|
75 |
for i in ldapcompare ldapdelete ldapexop ldapmodify ldapmodrdn \ |
|
16
4481d72bca2d
Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
14
diff
changeset
|
76 |
ldappasswd ldapsearch ldapwhoami ldapurl |
0 | 77 |
do |
78 |
setrunpath ${i} |
|
79 |
_install E ${i} ${BINDIR}/${CPREFIX}${i} 555 |
|
80 |
_install L ../../../bin/${CPREFIX}${i} ${LIBOLBIN}/${i} 555 |
|
81 |
done |
|
82 |
_install L ${CPREFIX}ldapmodify ${BINDIR}/${CPREFIX}ldapadd 555 |
|
83 |
_install L ../../../bin/${CPREFIX}ldapmodify ${LIBOLBIN}/ldapadd 555 |
|
84 |
cd $TOP |
|
85 |
||
86 |
## Config files |
|
87 |
_install N libraries/libldap/ldap.conf ${ETCDIR}/ldap.conf 444 |
|
88 |
_install N libraries/libldap/ldap.conf ${ETCDIR}/ldap.conf.default 444 |
|
89 |
cat servers/slapd/slapd.conf | \ |
|
90 |
sed -e "s#%SYSCONFDIR%#${REALCONFDIR}#" \ |
|
91 |
-e "s#%LOCALSTATEDIR%/run#${REALVARRUNDIR}#" \ |
|
92 |
-e "s#%LOCALSTATEDIR%/openldap-data#${REALVARDIR}#" \ |
|
93 |
> servers/slapd/slapd.conf.tmp |
|
94 |
_install N servers/slapd/slapd.conf.tmp ${ETCDIR}/slapd.conf 400 |
|
95 |
_install N servers/slapd/DB_CONFIG ${ETCDIR}/DB_CONFIG.example 400 |
|
96 |
||
97 |
## Server Schema |
|
98 |
cd servers/slapd/schema |
|
99 |
for i in * |
|
100 |
do |
|
101 |
_install N ${i} ${SCHEMADIR}/${i} 444 |
|
102 |
done |
|
103 |
cd $TOP |
|
104 |
||
105 |
## Includes |
|
106 |
cd include |
|
107 |
for i in lber.h lber_types.h ldap_cdefs.h ldap_features.h ldap.h \ |
|
108 |
ldap_schema.h ldap_utf8.h slapi-plugin.h |
|
109 |
do |
|
110 |
_install N ${i} ${INCDIR}/${i} 444 |
|
111 |
done |
|
112 |
cd $TOP |
|
113 |
||
114 |
## Libraries |
|
115 |
LBERDIR=libraries/liblber/.libs |
|
116 |
LBERLIB=liblber-2.4.so.${LVERS} |
|
117 |
LBERSOV=liblber-2.4.so.2 |
|
118 |
LBERSO=liblber-2.4.so |
|
119 |
setrunpath ${LBERDIR}/${LBERLIB} |
|
120 |
_install D ${LBERDIR}/${LBERLIB} ${LIBDIR}/${LBERLIB} 555 |
|
121 |
cd ${LIBDIR} |
|
122 |
_install L ${LBERLIB} ${LBERSOV} 555 |
|
123 |
_install L ${LBERLIB} ${LBERSO} 555 |
|
124 |
cd $TOP |
|
125 |
||
126 |
#non _r version |
|
127 |
LDAPDIR=libraries/libldap/.libs |
|
128 |
LDAPLIB=libldap-2.4.so.${LVERS} |
|
129 |
LDAPSOV=libldap-2.4.so.2 |
|
130 |
LDAPSO=libldap-2.4.so |
|
131 |
setrunpath ${LDAPDIR}/${LDAPLIB} |
|
132 |
_install D ${LDAPDIR}/${LDAPLIB} ${LIBDIR}/${LDAPLIB} 555 |
|
133 |
cd ${LIBDIR} |
|
134 |
_install L ${LDAPLIB} ${LDAPSOV} 555 |
|
135 |
_install L ${LDAPLIB} ${LDAPSO} 555 |
|
136 |
cd $TOP |
|
137 |
||
138 |
#_r version |
|
139 |
LDAPDIR=libraries/libldap_r/.libs |
|
140 |
LDAPLIB=libldap_r-2.4.so.${LVERS} |
|
141 |
LDAPSOV=libldap_r-2.4.so.2 |
|
142 |
LDAPSO=libldap_r-2.4.so |
|
143 |
setrunpath ${LDAPDIR}/${LDAPLIB} |
|
144 |
_install D ${LDAPDIR}/${LDAPLIB} ${LIBDIR}/${LDAPLIB} 555 |
|
145 |
cd ${LIBDIR} |
|
146 |
_install L ${LDAPLIB} ${LDAPSOV} 555 |
|
147 |
_install L ${LDAPLIB} ${LDAPSO} 555 |
|
148 |
cd $TOP |
|
149 |
||
150 |
## Server in its various forms |
|
151 |
setrunpath servers/slapd/slapd |
|
152 |
_install E servers/slapd/slapd ${LIBEXECDIR}/slapd 555 |
|
153 |
cd ${SBINDIR} |
|
16
4481d72bca2d
Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
14
diff
changeset
|
154 |
for i in slapacl slapadd slapauth slapcat slapdn slapindex \ |
4481d72bca2d
Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
14
diff
changeset
|
155 |
slappasswd slapschema slaptest |
0 | 156 |
do |
157 |
_install L ../lib/slapd ${i} 555 |
|
158 |
done |
|
159 |
cd $TOP |
|
160 |
||
161 |
## Solaris specific stuff (SMF etc) |
|
162 |
cd ../Solaris |
|
163 |
i=ldap-olslapd.xml |
|
14 | 164 |
_install N ${i} ${ROOT}/lib/svc/manifest/network/ldap/${i} 444 |
7 | 165 |
i=ldap-olslapd |
166 |
_install N ${i} ${ROOT}/lib/svc/method/${i} 555 |
|
0 | 167 |
cd $TOP |
168 |
||
169 |
# |
|
170 |
# The manpages are updated by Sun to include a comment, an |
|
171 |
# ATTRIBUTES section with stability classification, and a NOTES |
|
172 |
# section containing a pointer to the source package. We do this |
|
173 |
# automatically at install time. If the package is revised, it is |
|
174 |
# possible that additional changes may be required. This can be |
|
175 |
# generally be done by updating the sunman-stability file. |
|
176 |
||
177 |
MAN1SCRIPT=$TOP/../sun1man-stability |
|
178 |
MANnSCRIPT=$TOP/../sunman-stability |
|
179 |
||
180 |
for j in man1 man3 man5 man8 |
|
181 |
do |
|
182 |
C= |
|
183 |
case $j in |
|
184 |
man1) MANSCRIPT=$MAN1SCRIPT; DIR=$MAN1DIR; C=${CPREFIX};; |
|
185 |
man3) MANSCRIPT=$MANnSCRIPT; DIR=$MAN3DIR;; |
|
186 |
man5) MANSCRIPT=$MANnSCRIPT; DIR=$MAN5DIR;; |
|
187 |
man8) MANSCRIPT=$MANnSCRIPT; DIR=$MAN8DIR;; |
|
188 |
esac |
|
189 |
MD=doc/man/$j |
|
190 |
cd $MD |
|
191 |
for i in *.tmp |
|
192 |
do |
|
193 |
manpage=`basename $i .tmp` |
|
194 |
mmanpage=${C}`basename $i .tmp`${MANTAG} |
|
195 |
_install M ${i} ${DIR}/${mmanpage} 444 |
|
196 |
if [ -f ${manpage}.links ] ; then |
|
197 |
for k in `cat ${manpage}.links` |
|
198 |
do |
|
199 |
[ `pwd` != ${DIR} ] && cd $DIR |
|
200 |
_install L ${mmanpage} ./${C}${k}${MANTAG} 444 |
|
201 |
done |
|
202 |
cd $TOP/$MD |
|
203 |
fi |
|
204 |
done |
|
205 |
cd $TOP |
|
206 |
done |
|
207 |
||
208 |
# |
|
209 |
# the Admin guide has been built for html by the sdf tool |
|
210 |
# Install that as well |
|
211 |
||
212 |
cd doc/guide/admin |
|
213 |
for i in *.html *.png |
|
214 |
do |
|
215 |
if [ ${i} = "index.html" ] ; then |
|
216 |
: # Skip sym link afterwards |
|
217 |
else |
|
218 |
_install N ${i} ${DOCADMDIR}/${i} 444 |
|
219 |
fi |
|
220 |
done |
|
221 |
_install L guide.html ${DOCADMDIR}/index.html 444 |
|
222 |
cd $TOP |
|
9 | 223 |
|
224 |
_install N ../exec_attr ${ROOT}/etc/security/exec_attr.d/openldap 0444 |
|
225 |
_install N ../prof_attr ${ROOT}/etc/security/prof_attr.d/openldap 0444 |
|
226 |
||
0 | 227 |
cd doc/guide/images |
228 |
for i in *.gif |
|
229 |
do |
|
230 |
_install N ${i} ${DOCIMGDIR}/${i} 444 |
|
231 |
done |
|
232 |
cd $TOP |
|
233 |
||
234 |
exit 0 |