Lines 6-16
Link Here
|
6 |
|
6 |
|
7 |
MY_PV=$(replace_version_separator 3 '-') |
7 |
MY_PV=$(replace_version_separator 3 '-') |
8 |
MY_P="${PN}-${MY_PV}" |
8 |
MY_P="${PN}-${MY_PV}" |
9 |
|
|
|
10 |
DESCRIPTION="A Collaboration and Integration Server Environment" |
9 |
DESCRIPTION="A Collaboration and Integration Server Environment" |
11 |
HOMEPAGE="http://www.open-xchange.org/" |
10 |
HOMEPAGE="http://www.open-xchange.org/" |
12 |
SRC_URI="http://mirror.open-xchange.org/download/${MY_P}.tar.bz2 |
11 |
|
13 |
http://www.mikefetherston.ca/OX/Crystal_OX_Theme.tgz" |
12 |
SRC_URI="http://www.mikefetherston.ca/OX/Crystal_OX_Theme.tgz" |
|
|
13 |
if [[ $(get_version_component_range 3) -eq 0 ]]; then |
14 |
SRC_URI="${SRC_URI} http://mirror.open-xchange.org/download/archive/${MY_P}.tar.bz2" |
15 |
else |
16 |
SRC_URI="${SRC_URI} http://mirror.open-xchange.org/download/${MY_P}.tar.bz2" |
17 |
fi |
18 |
|
14 |
LICENSE="GPL-2" |
19 |
LICENSE="GPL-2" |
15 |
KEYWORDS="~x86" |
20 |
KEYWORDS="~x86" |
16 |
RESTRICT="primaryuri" |
21 |
RESTRICT="primaryuri" |
Lines 52-58
Link Here
|
52 |
use postgres || ! use mysql |
57 |
use postgres || ! use mysql |
53 |
} |
58 |
} |
54 |
|
59 |
|
55 |
pkg_setup() { |
60 |
#parameter $1 == 1 for config part or == 0 for preinst |
|
|
61 |
ox_setup(){ |
62 |
local config=$1 |
63 |
local WORKINGBASE="${IMAGE}" #is used during pkg_* |
64 |
if [[ $config -eq 1 ]]; then |
65 |
#executed from in pkg_config |
66 |
WORKINGBASE="${ROOT}" |
67 |
fi |
68 |
# Simple defaults |
69 |
# some have to defined global |
70 |
OX_DBNAME=${OX_DBNAME-"open_xchange"} |
71 |
OX_DBUSER=${OX_DBUSER-"open_xchange"} |
72 |
OX_DBPASS=${OX_DBPASS-"secret"} |
73 |
OX_DOMAIN=${OX_DOMAIN-"example.org"} |
74 |
# some just needed local |
75 |
local OX_DBHOST=${OX_DBHOST-"localhost"} |
76 |
local OX_ORG=${OX_ORG-"My Organization"} |
77 |
local OX_LDAPSERVER=${OX_LDAPSERVER-"localhost"} |
78 |
local OX_BASEDN=${OX_BASEDN-"dc=example,dc=org"} |
79 |
local OX_ROOTDN=${OX_ROOTDN-"cn=Manager,${OX_BASEDN}"} |
80 |
local OX_ROOTPW=${OX_ROOTPW-"secret"} |
81 |
|
82 |
# Guess base on the installed config but only if it exists |
83 |
if [[ -e "${ROOT}/etc/open-xchange/admintools.conf" ]] ; then |
84 |
local temp_var |
85 |
echo "Installation of OX detected" |
86 |
|
87 |
temp_var=$(get_oxvar DEFAULT_SQL_HOST) |
88 |
[[ -n ${temp_var} ]] && OX_DBHOST=${temp_var} |
89 |
|
90 |
temp_var=$(get_oxvar DEFAULT_SQL_DB) |
91 |
[[ -n ${temp_var} ]] && OX_DBNAME=${temp_var} |
92 |
|
93 |
temp_var=$(get_oxvar DEFAULT_SQL_USER) |
94 |
[[ -n ${temp_var} ]] && OX_DBUSER=${temp_var} |
95 |
|
96 |
temp_var=$(get_oxvar DEFAULT_SQL_PASS) |
97 |
[[ -n ${temp_var} ]] && OX_DBPASS=${temp_var} |
98 |
|
99 |
temp_var=$(get_oxvar ORGA) |
100 |
[[ -n ${temp_var} ]] && OX_ORG=${temp_var} |
101 |
|
102 |
temp_var=$(get_oxvar BINDDN) |
103 |
[[ -n ${temp_var} ]] && OX_ROOTDN=${temp_var} |
104 |
|
105 |
temp_var=$(get_oxvar BINDPW) |
106 |
[[ -n ${temp_var} ]] && OX_ROOTPW=${temp_var} |
107 |
|
108 |
if [[ -e "${ROOT}/etc/open-xchange/groupware/ldap.conf" ]] ; then |
109 |
# taken from admintools.conf self |
110 |
temp_var=`grep -v '^#' ${ROOT}/etc/open-xchange/groupware/ldap.conf | grep -i BASE | head -n 1 | awk {'print $2'}` |
111 |
[[ -n ${temp_var} ]] && OX_BASEDN=${temp_var} |
112 |
fi |
113 |
fi |
114 |
|
115 |
if [[ ${config} -eq 1 ]]; then |
116 |
# Now asking the user |
117 |
einfo "If values are correct just press enter else enter the new value" |
118 |
|
119 |
OX_DBHOST=$(get_user_config "${OX_DBHOST}" "Database Host") |
120 |
OX_DBNAME=$(get_user_config "${OX_DBNAME}" "Database Name") |
121 |
OX_DBUSER=$(get_user_config "${OX_DBUSER}" "Database User") |
122 |
OX_DBPASS=$(get_user_config "${OX_DBPASS}" "Database User's Password") |
123 |
OX_ORG=$(get_user_config "${OX_ORG}" "Organization") |
124 |
OX_DOMAIN=$(get_user_config "${OX_DOMAIN}" "Domain") |
125 |
OX_LDAPSERVER=$(get_user_config "${OX_LDAPSERVER}" "LDAP Server") |
126 |
OX_BASEDN=$(get_user_config "${OX_BASEDN}" "LDAP Base DN") |
127 |
OX_ROOTDN=$(get_user_config "${OX_ROOTDN}" "LDAP Root DN") |
128 |
OX_ROOTPW=$(get_user_config "${OX_ROOTPW}" "LDAP Root Password") |
129 |
|
130 |
einfo "Finished - now writing config" |
131 |
fi |
132 |
|
133 |
## now create configs with the right values |
134 |
# starting with ldap |
135 |
sed -i "s|@basedn@|${OX_BASEDN}|g" ${WORKINGBASE}/usr/share/open-xchange/init_ldap.ldif |
136 |
sed -i "s|@domain@|${OX_DOMAIN}|g" ${WORKINGBASE}/usr/share/open-xchange/init_ldap.ldif |
137 |
sed -i "s|@organization@|${OX_ORG}|g" ${WORKINGBASE}/usr/share/open-xchange/init_ldap.ldif |
138 |
|
139 |
local OX_BASEDC="`echo ${OX_BASEDN} | sed -n 's:dc=\([-A-Za-z_]*\).*:\1:p'|head -n 1`" |
140 |
sed -i "s|@basedc@|${OX_BASEDC}|g" ${WORKINGBASE}/usr/share/open-xchange/init_ldap.ldif |
141 |
sed -i "s|ORGA=\".*\"|ORGA=\"${OX_ORG}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
142 |
sed -i "s|BINDDN=\".*\"|BINDDN=\"${OX_ROOTDN}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
143 |
sed -i "s|BINDPW=\".*\"|BINDPW=\"${OX_ROOTPW}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
144 |
sed -i "s|DEFAULT_SQL_HOST=\".*\"|DEFAULT_SQL_HOST=\"${OX_DBHOST}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
145 |
sed -i "s|DEFAULT_SQL_DB=\".*\"|DEFAULT_SQL_DB=\"${OX_DBNAME}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
146 |
sed -i "s|DEFAULT_SQL_USER=\".*\"|DEFAULT_SQL_USER=\"${OX_DBUSER}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
147 |
sed -i "s|DEFAULT_SQL_PASS=\".*\"|DEFAULT_SQL_PASS=\"${OX_DBPASS}\"|g" ${WORKINGBASE}/etc/open-xchange/admintools.conf |
148 |
|
149 |
# setup correct ACIs |
150 |
sed -i "s|@basedn@|${OX_BASEDN}|g" ${ROOT}/etc/openldap/slapd.ox.inc |
151 |
|
152 |
# groupware : server.conf |
153 |
for f in /etc/open-xchange/groupware/server.conf /etc/open-xchange/webmail/server.conf ; do |
154 |
sed -i "s|NAS_CON_CLASS_NAME: jdbc:\(.*\)://.*|NAS_CON_CLASS_NAME: jdbc:\1://${OX_DBHOST}/${OX_DBNAME}|g" ${WORKINGBASE}/${f} |
155 |
sed -i "s|NAS_CON_USER:.*|NAS_CON_USER: ${OX_DBUSER}|g" ${WORKINGBASE}/${f} |
156 |
sed -i "s|NAS_CON_PASS:.*|NAS_CON_PASS: ${OX_DBPASS}|g" ${WORKINGBASE}/${f} |
157 |
sed -i "s|NAS_CON_PASS:.*|NAS_CON_PASS: ${OX_DBPASS}|g" ${WORKINGBASE}/${f} |
158 |
done |
159 |
|
160 |
# patching umin.war, somehow dirty |
161 |
[[ -d "${T}/ox_war" ]] && rm -rf ${T}/ox_war |
162 |
mkdir -p ${T}/ox_war |
163 |
|
164 |
echo "${WORKINGBASE}/${SERVLETDIR}" |
165 |
unzip ${WORKINGBASE}/${SERVLETDIR}/umin.war -d ${T}/ox_war |
166 |
|
167 |
sed -i "s|LDAP_SERVER=.*|LDAP_SERVER=${OX_LDAPSERVER}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
168 |
sed -i "s|LDAP_BASEDN=.*|LDAP_BASEDN=${OX_BASEDN}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
169 |
sed -i "s|SQL_SERVER_GROUPWARE=.*|SQL_SERVER_GROUPWARE=${OX_DBHOST}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
170 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_NAME=.*|SQL_SERVER_GROUPWARE_DATABASE_NAME=${OX_DBNAME}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
171 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_USERNAME=.*|SQL_SERVER_GROUPWARE_DATABASE_USERNAME=${OX_DBUSER}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
172 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_PASSWORD=.*|SQL_SERVER_GROUPWARE_DATABASE_PASSWORD=${OX_DBPASS}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
173 |
sed -i "s|CSS_PATH=/cfintranet/css/stylesheet.css|CSS_PATH=/open-xchange/cfintranet/css/stylesheet.css|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
174 |
|
175 |
cd ${T}/ox_war |
176 |
zip -r -9 umin.war * |
177 |
cp umin.war ${WORKINGBASE}/${SERVLETDIR} |
178 |
cd ${WORKINGBASE} |
179 |
rm -rf ${T}/ox_war |
180 |
} |
181 |
|
182 |
ox_setup_tomcat(){ |
56 |
TOMCAT_DIR=`java-config -g CATALINA_HOME` |
183 |
TOMCAT_DIR=`java-config -g CATALINA_HOME` |
57 |
if has_version '>=www-servers/tomcat-5.0.28-r4' ; then |
184 |
if has_version '>=www-servers/tomcat-5.0.28-r4' ; then |
58 |
# it is now installed to the profile-directory choosen from /etc/conf.d/tomcat-5 |
185 |
# it is now installed to the profile-directory choosen from /etc/conf.d/tomcat-5 |
Lines 62-69
Link Here
|
62 |
else |
189 |
else |
63 |
SERVLETDIR="${TOMCAT_DIR}/webapps" |
190 |
SERVLETDIR="${TOMCAT_DIR}/webapps" |
64 |
fi |
191 |
fi |
|
|
192 |
} |
193 |
|
65 |
|
194 |
|
|
|
195 |
pkg_setup() { |
66 |
webapp_pkg_setup |
196 |
webapp_pkg_setup |
|
|
197 |
ox_setup_tomcat |
67 |
} |
198 |
} |
68 |
|
199 |
|
69 |
src_unpack() { |
200 |
src_unpack() { |
Lines 72-77
Link Here
|
72 |
|
203 |
|
73 |
# http://www.open-xchange.org/cgi-bin/bugzilla/show_bug.cgi?id=734 |
204 |
# http://www.open-xchange.org/cgi-bin/bugzilla/show_bug.cgi?id=734 |
74 |
epatch ${FILESDIR}/${PN}-0.8.1.2-login.patch |
205 |
epatch ${FILESDIR}/${PN}-0.8.1.2-login.patch |
|
|
206 |
epatch ${FILESDIR}/${PN}-0.8.1.2-ssl.patch |
75 |
|
207 |
|
76 |
# http://www.open-xchange.org/cgi-bin/bugzilla/show_bug.cgi?id=656 |
208 |
# http://www.open-xchange.org/cgi-bin/bugzilla/show_bug.cgi?id=656 |
77 |
sed -i "s|\${DESTDIR}|\$(DESTDIR)|g" Makefile.am |
209 |
sed -i "s|\${DESTDIR}|\$(DESTDIR)|g" Makefile.am |
Lines 133-143
Link Here
|
133 |
|
265 |
|
134 |
myconf="${myconf} --with-servletdir=${SERVLETDIR}" |
266 |
myconf="${myconf} --with-servletdir=${SERVLETDIR}" |
135 |
|
267 |
|
136 |
# if has_version '>=www-servers/tomcat-5.0.28-r4' ; then |
268 |
myconf="${myconf} --with-jsdkjar=${TOMCAT_DIR}/common/lib/servlet-api.jar" |
137 |
myconf="${myconf} --with-jsdkjar=${TOMCAT_DIR}/common/lib/servlet-api.jar" |
|
|
138 |
# else |
139 |
# myconf="${myconf} --with-jsdkjar=/usr/share/servletapi-2.4/lib/servlet-api.jar" |
140 |
# fi |
141 |
|
269 |
|
142 |
myconf="${myconf} --with-mailjar=/usr/share/sun-javamail-bin/lib/mail.jar" |
270 |
myconf="${myconf} --with-mailjar=/usr/share/sun-javamail-bin/lib/mail.jar" |
143 |
myconf="${myconf} --with-activationjar=/usr/share/sun-jaf-bin/lib/activation.jar" |
271 |
myconf="${myconf} --with-activationjar=/usr/share/sun-jaf-bin/lib/activation.jar" |
Lines 238-243
Link Here
|
238 |
dosym ../../../etc/openldap/schema/openxchange.schema /usr/share/open-xchange/openxchange.schema |
366 |
dosym ../../../etc/openldap/schema/openxchange.schema /usr/share/open-xchange/openxchange.schema |
239 |
dosym ../../openldap/ldap.conf /etc/open-xchange/groupware/ldap.conf |
367 |
dosym ../../openldap/ldap.conf /etc/open-xchange/groupware/ldap.conf |
240 |
dosym ../../openldap/ldap.conf /etc/open-xchange/webmail/ldap.conf |
368 |
dosym ../../openldap/ldap.conf /etc/open-xchange/webmail/ldap.conf |
|
|
369 |
#create symlink to ssl directory for webmail |
370 |
dosym /etc/open-xchange/groupware/sslcerts /etc/open-xchange/webmail/sslcerts |
241 |
|
371 |
|
242 |
for x in settings/intranet settings/webmail filespool drafts webmailupload dictionary ; do |
372 |
for x in settings/intranet settings/webmail filespool drafts webmailupload dictionary ; do |
243 |
keepdir /var/open-xchange/${x} |
373 |
keepdir /var/open-xchange/${x} |
Lines 261-266
Link Here
|
261 |
} |
391 |
} |
262 |
|
392 |
|
263 |
pkg_preinst(){ |
393 |
pkg_preinst(){ |
|
|
394 |
#execute ox_setup from preinst(0) |
395 |
ox_setup_tomcat |
396 |
ox_setup 0 |
397 |
|
264 |
# create user mailadmin, needed for mailsupport |
398 |
# create user mailadmin, needed for mailsupport |
265 |
enewuser mailadmin -1 -1 /dev/null users |
399 |
enewuser mailadmin -1 -1 /dev/null users |
266 |
_UID=`getent passwd mailadmin | awk -F : '{print $3}'` |
400 |
_UID=`getent passwd mailadmin | awk -F : '{print $3}'` |
Lines 305-328
Link Here
|
305 |
|
439 |
|
306 |
chgrp -R apache /var/open-xchange/* |
440 |
chgrp -R apache /var/open-xchange/* |
307 |
einfo |
441 |
einfo |
|
|
442 |
einfo " You have successfully installed Open-Xchange" |
308 |
einfo |
443 |
einfo |
309 |
einfo " ===========================================================" |
|
|
310 |
einfo |
311 |
einfo " You have successfully installed Open-Xchange" |
312 |
einfo |
444 |
einfo |
313 |
einfo " ===========================================================" |
445 |
einfo " o STARTING and STOPPING Open-Xchange" |
314 |
einfo |
446 |
einfo " /etc/init.d/open-xchange start" |
315 |
einfo " o FILE LOCATIONS" |
447 |
einfo " /etc/init.d/open-xchange stop" |
316 |
einfo " 1. Configuration: /etc/open-xchange" |
448 |
einfo " /etc/init.d/open-xchange restart" |
317 |
einfo " 2. HTML Files: /usr/share/open-xchange" |
|
|
318 |
einfo |
319 |
einfo " o STARTING and STOPPING the Open-Xchange" |
320 |
einfo " /etc/init.d/openexchange start" |
321 |
einfo " /etc/init.d/openexchange stop" |
322 |
einfo " /etc/init.d/openexchange restart" |
323 |
einfo |
449 |
einfo |
324 |
einfo "Execute the following command" |
450 |
einfo "Execute the following command" |
325 |
einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config" |
451 |
|
|
|
452 |
if has_version '<=sys-apps/portage-2.0.51*' ; then |
453 |
einfo "ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config" |
454 |
else |
455 |
einfo "emerge --config ${CATEGORY}/${PN}" |
456 |
fi |
457 |
|
326 |
einfo "to setup the initial open-xchange environment." |
458 |
einfo "to setup the initial open-xchange environment." |
327 |
einfo |
459 |
einfo |
328 |
|
460 |
|
Lines 355-361
Link Here
|
355 |
} |
487 |
} |
356 |
|
488 |
|
357 |
pkg_config() { |
489 |
pkg_config() { |
358 |
pkg_setup |
490 |
ox_setup_tomcat |
|
|
491 |
#execute ox_setup from pkg_config(1) |
492 |
ox_setup 1 |
359 |
|
493 |
|
360 |
chown -R tomcat:tomcat ${ROOT}/etc/open-xchange |
494 |
chown -R tomcat:tomcat ${ROOT}/etc/open-xchange |
361 |
|
495 |
|
Lines 364-478
Link Here
|
364 |
find ${ROOT}/etc/open-xchange/groupware/sslcerts -name '*.pem' -exec chmod 440 {} \; |
498 |
find ${ROOT}/etc/open-xchange/groupware/sslcerts -name '*.pem' -exec chmod 440 {} \; |
365 |
fi |
499 |
fi |
366 |
|
500 |
|
367 |
# Simple defaults |
|
|
368 |
local OX_DBHOST=${OX_DBHOST-"localhost"} |
369 |
local OX_DBNAME=${OX_DBNAME-"open_xchange"} |
370 |
local OX_DBUSER=${OX_DBUSER-"open_xchange"} |
371 |
local OX_DBPASS=${OX_DBPASS-"secret"} |
372 |
local OX_ORG=${OX_ORG-"My Organization"} |
373 |
local OX_DOMAIN=${OX_DOMAIN-"example.org"} |
374 |
local OX_LDAPSERVER=${OX_LDAPSERVER-"localhost"} |
375 |
local OX_BASEDN=${OX_BASEDN-"dc=example,dc=org"} |
376 |
local OX_ROOTDN=${OX_ROOTDN-"cn=Manager,${OX_BASEDN}"} |
377 |
local OX_ROOTPW=${OX_ROOTPW-"secret"} |
378 |
|
501 |
|
379 |
# Guess base on the installed config |
|
|
380 |
if [[ -e "${ROOT}/etc/open-xchange/admintools.conf" ]] ; then |
381 |
local temp_var |
382 |
echo "Installation of OX detected" |
383 |
|
502 |
|
384 |
temp_var=$(get_oxvar DEFAULT_SQL_HOST) |
503 |
#set correct user rights for ldap |
385 |
[[ -n ${temp_var} ]] && OX_DBHOST=${temp_var} |
|
|
386 |
|
387 |
temp_var=$(get_oxvar DEFAULT_SQL_DB) |
388 |
[[ -n ${temp_var} ]] && OX_DBNAME=${temp_var} |
389 |
|
390 |
temp_var=$(get_oxvar DEFAULT_SQL_USER) |
391 |
[[ -n ${temp_var} ]] && OX_DBUSER=${temp_var} |
392 |
|
393 |
temp_var=$(get_oxvar DEFAULT_SQL_PASS) |
394 |
[[ -n ${temp_var} ]] && OX_DBPASS=${temp_var} |
395 |
|
396 |
temp_var=$(get_oxvar ORGA) |
397 |
[[ -n ${temp_var} ]] && OX_ORG=${temp_var} |
398 |
|
399 |
temp_var=$(get_oxvar BINDDN) |
400 |
[[ -n ${temp_var} ]] && OX_ROOTDN=${temp_var} |
401 |
|
402 |
temp_var=$(get_oxvar BINDPW) |
403 |
[[ -n ${temp_var} ]] && OX_ROOTPW=${temp_var} |
404 |
|
405 |
if [[ -e "${ROOT}/etc/open-xchange/groupware/ldap.conf" ]] ; then |
406 |
# taken from admintools.conf self |
407 |
temp_var=`grep -v '^#' ${ROOT}/etc/open-xchange/groupware/ldap.conf | grep -i BASE | head -n 1 | awk {'print $2'}` |
408 |
[[ -n ${temp_var} ]] && OX_BASEDN=${temp_var} |
409 |
fi |
410 |
fi |
411 |
|
412 |
# Now asking the user |
413 |
einfo "If values are correct just press enter else enter the new value" |
414 |
|
415 |
OX_DBHOST=$(get_user_config "${OX_DBHOST}" "Database Host") |
416 |
OX_DBNAME=$(get_user_config "${OX_DBNAME}" "Database Name") |
417 |
OX_DBUSER=$(get_user_config "${OX_DBUSER}" "Database User") |
418 |
OX_DBPASS=$(get_user_config "${OX_DBPASS}" "Database User's Password") |
419 |
OX_ORG=$(get_user_config "${OX_ORG}" "Organization") |
420 |
OX_DOMAIN=$(get_user_config "${OX_DOMAIN}" "Domain") |
421 |
OX_LDAPSERVER=$(get_user_config "${OX_LDAPSERVER}" "LDAP Server") |
422 |
OX_BASEDN=$(get_user_config "${OX_BASEDN}" "LDAP Base DN") |
423 |
OX_ROOTDN=$(get_user_config "${OX_ROOTDN}" "LDAP Root DN") |
424 |
OX_ROOTPW=$(get_user_config "${OX_ROOTPW}" "LDAP Root Password") |
425 |
|
426 |
einfo "Finished - now writing config" |
427 |
|
428 |
# patching umin.war, somehow dirty |
429 |
[[ -d "${T}/ox_war" ]] && rm -rf ${T}/ox_war |
430 |
mkdir -p ${T}/ox_war |
431 |
unzip ${ROOT}/${SERVLETDIR}/umin.war -d ${T}/ox_war |
432 |
|
433 |
sed -i "s|LDAP_SERVER=.*|LDAP_SERVER=${OX_LDAPSERVER}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
434 |
sed -i "s|LDAP_BASEDN=.*|LDAP_BASEDN=${OX_BASEDN}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
435 |
sed -i "s|SQL_SERVER_GROUPWARE=.*|SQL_SERVER_GROUPWARE=${OX_DBHOST}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
436 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_NAME=.*|SQL_SERVER_GROUPWARE_DATABASE_NAME=${OX_DBNAME}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
437 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_USERNAME=.*|SQL_SERVER_GROUPWARE_DATABASE_USERNAME=${OX_DBUSER}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
438 |
sed -i "s|SQL_SERVER_GROUPWARE_DATABASE_PASSWORD=.*|SQL_SERVER_GROUPWARE_DATABASE_PASSWORD=${OX_DBPASS}|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
439 |
sed -i "s|CSS_PATH=/cfintranet/css/stylesheet.css|CSS_PATH=/open-xchange/cfintranet/css/stylesheet.css|g" ${T}/ox_war/WEB-INF/classes/oxuserminconfig.properties |
440 |
|
441 |
cd ${T}/ox_war |
442 |
zip -r -9 umin.war * |
443 |
cp umin.war ${ROOT}/${SERVLETDIR} |
444 |
cd ${ROOT} |
445 |
rm -rf ${T}/ox_war |
446 |
|
447 |
## now create configs with the right values |
448 |
# starting with ldap |
449 |
sed -i "s|@basedn@|${OX_BASEDN}|g" ${ROOT}/usr/share/open-xchange/init_ldap.ldif |
450 |
sed -i "s|@domain@|${OX_DOMAIN}|g" ${ROOT}/usr/share/open-xchange/init_ldap.ldif |
451 |
sed -i "s|@organization@|${OX_ORG}|g" ${ROOT}/usr/share/open-xchange/init_ldap.ldif |
452 |
|
453 |
local OX_BASEDC="`echo ${OX_BASEDN} | sed -n 's:dc=\([-A-Za-z_]*\).*:\1:p'|head -n 1`" |
454 |
sed -i "s|@basedc@|${OX_BASEDC}|g" ${ROOT}/usr/share/open-xchange/init_ldap.ldif |
455 |
|
456 |
sed -i "s|ORGA=\".*\"|ORGA=\"${OX_ORG}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
457 |
sed -i "s|BINDDN=\".*\"|BINDDN=\"${OX_ROOTDN}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
458 |
sed -i "s|BINDPW=\".*\"|BINDPW=\"${OX_ROOTPW}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
459 |
sed -i "s|DEFAULT_SQL_HOST=\".*\"|DEFAULT_SQL_HOST=\"${OX_DBHOST}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
460 |
sed -i "s|DEFAULT_SQL_DB=\".*\"|DEFAULT_SQL_DB=\"${OX_DBNAME}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
461 |
sed -i "s|DEFAULT_SQL_USER=\".*\"|DEFAULT_SQL_USER=\"${OX_DBUSER}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
462 |
sed -i "s|DEFAULT_SQL_PASS=\".*\"|DEFAULT_SQL_PASS=\"${OX_DBPASS}\"|g" ${ROOT}/etc/open-xchange/admintools.conf |
463 |
|
464 |
# setup correct acis |
465 |
sed -i "s|@basedn@|${OX_BASEDN}|g" ${ROOT}/etc/openldap/slapd.ox.inc |
466 |
chown ldap:ldap ${ROOT}/etc/openldap/slapd.ox.inc |
504 |
chown ldap:ldap ${ROOT}/etc/openldap/slapd.ox.inc |
467 |
|
505 |
|
468 |
# groupware : server.conf |
|
|
469 |
for f in /etc/open-xchange/groupware/server.conf /etc/open-xchange/webmail/server.conf ; do |
470 |
sed -i "s|NAS_CON_CLASS_NAME: jdbc:\(.*\)://.*|NAS_CON_CLASS_NAME: jdbc:\1://${OX_DBHOST}/${OX_DBNAME}|g" ${ROOT}/${f} |
471 |
sed -i "s|NAS_CON_USER:.*|NAS_CON_USER: ${OX_DBUSER}|g" ${ROOT}/${f} |
472 |
sed -i "s|NAS_CON_PASS:.*|NAS_CON_PASS: ${OX_DBPASS}|g" ${ROOT}/${f} |
473 |
sed -i "s|NAS_CON_PASS:.*|NAS_CON_PASS: ${OX_DBPASS}|g" ${ROOT}/${f} |
474 |
done |
475 |
|
476 |
correctfilespool |
506 |
correctfilespool |
477 |
echo |
507 |
echo |
478 |
echo |
508 |
echo |
Lines 482-488
Link Here
|
482 |
|
512 |
|
483 |
echo |
513 |
echo |
484 |
einfo "And set JAVA_OPTS in /etc/conf.d/tomcat5 (or tomcat-5):" |
514 |
einfo "And set JAVA_OPTS in /etc/conf.d/tomcat5 (or tomcat-5):" |
485 |
einfo "JAVA_OPTS=\"-Dopenexchange.propfile=${ROOT}/etc/open-xchange/groupware/system.properties\"" |
515 |
einfo "JAVA_OPTS=\"-Dopenexchange.propfile=${ROOT}etc/open-xchange/groupware/system.properties\"" |
486 |
|
516 |
|
487 |
echo |
517 |
echo |
488 |
einfo "And setup /etc/conf.d/apache2" |
518 |
einfo "And setup /etc/conf.d/apache2" |
Lines 503-509
Link Here
|
503 |
if use_postgres ; then |
533 |
if use_postgres ; then |
504 |
einfo "echo \"CREATE USER ${OX_DBUSER} WITH PASSWORD '${OX_DBPASS}' CREATEDB NOCREATEUSER\" | psql -h localhost -U postgres template1 -f -" |
534 |
einfo "echo \"CREATE USER ${OX_DBUSER} WITH PASSWORD '${OX_DBPASS}' CREATEDB NOCREATEUSER\" | psql -h localhost -U postgres template1 -f -" |
505 |
einfo "echo \"CREATE DATABASE ${OX_DBNAME} WITH OWNER=${OX_DBUSER} ENCODING='UNICODE'\" | psql -h localhost -U postgres template1 -f -" |
535 |
einfo "echo \"CREATE DATABASE ${OX_DBNAME} WITH OWNER=${OX_DBUSER} ENCODING='UNICODE'\" | psql -h localhost -U postgres template1 -f -" |
506 |
einfo "psql -U ${OX_DBUSER} ${OX_DBNAME} < ${ROOT}/usr/share/open-xchange/init_database.sql" |
536 |
einfo "psql -U ${OX_DBUSER} ${OX_DBNAME} < ${ROOT}usr/share/open-xchange/init_database.sql" |
507 |
einfo "/usr/sbin/dbinit_ox" |
537 |
einfo "/usr/sbin/dbinit_ox" |
508 |
else |
538 |
else |
509 |
# COMMENT: we should tell them how to setup mysql also... |
539 |
# COMMENT: we should tell them how to setup mysql also... |
Lines 551-557
Link Here
|
551 |
echo |
581 |
echo |
552 |
einfo "HOWTO: Add a user" |
582 |
einfo "HOWTO: Add a user" |
553 |
einfo "+++++++++++++++++" |
583 |
einfo "+++++++++++++++++" |
554 |
einfo "/usr/sbin/adduser_ox --username=MYUSERNAME --password=MYPASSWORD --name=FORENAME --sname=SURENAME --maildomain=${OX_DOMAIN} --ox_timezone=\"Europe/Berlin\"" |
584 |
einfo "/usr/sbin/adduser_ox --username=MYUSERNAME --passwd=MYPASSWORD --name=FORENAME --sname=SURENAME --maildomain=${OX_DOMAIN} --ox_timezone=\"Europe/Berlin\"" |
555 |
einfo "Now you can add the user to a group." |
585 |
einfo "Now you can add the user to a group." |
556 |
einfo "/usr/sbin/addusertogroup_ox --user=MYUSERNAME --group=NEWGROUPNAME" |
586 |
einfo "/usr/sbin/addusertogroup_ox --user=MYUSERNAME --group=NEWGROUPNAME" |
557 |
echo |
587 |
echo |