| 1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.20 2004/05/22 18:56:58 stuart Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.34 2005/07/11 15:08:06 swegener Exp $ |
| 4 | # |
4 | # |
| 5 | # eclass/webapp.eclass |
5 | # eclass/webapp.eclass |
| 6 | # Eclass for installing applications to run under a web server |
6 | # Eclass for installing applications to run under a web server |
| 7 | # |
7 | # |
| 8 | # Part of the implementation of GLEP #11 |
8 | # Part of the implementation of GLEP #11 |
| … | |
… | |
| 17 | # your changes will be overwritten the next time Stu releases a new version |
17 | # your changes will be overwritten the next time Stu releases a new version |
| 18 | # of webapp-config. |
18 | # of webapp-config. |
| 19 | # |
19 | # |
| 20 | # ------------------------------------------------------------------------ |
20 | # ------------------------------------------------------------------------ |
| 21 | |
21 | |
| 22 | ECLASS=webapp |
|
|
| 23 | INHERITED="$INHERITED $ECLASS" |
|
|
| 24 | SLOT="${PVR}" |
22 | SLOT="${PVR}" |
| 25 | IUSE="$IUSE vhosts" |
23 | IUSE="$IUSE vhosts" |
| 26 | DEPEND="$DEPEND >=net-www/webapp-config-1.7 app-portage/gentoolkit" |
24 | DEPEND="$DEPEND net-www/webapp-config app-portage/gentoolkit" |
| 27 | |
25 | |
| 28 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
26 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install pkg_prerm |
| 29 | |
27 | |
| 30 | INSTALL_DIR="/$PN" |
28 | INSTALL_DIR="/$PN" |
| 31 | IS_UPGRADE=0 |
29 | IS_UPGRADE=0 |
| 32 | IS_REPLACE=0 |
30 | IS_REPLACE=0 |
| 33 | |
31 | |
| 34 | INSTALL_CHECK_FILE="installed_by_webapp_eclass" |
32 | INSTALL_CHECK_FILE="installed_by_webapp_eclass" |
| 35 | |
33 | |
|
|
34 | ETC_CONFIG="/etc/vhosts/webapp-config" |
|
|
35 | |
| 36 | # ------------------------------------------------------------------------ |
36 | # ------------------------------------------------------------------------ |
| 37 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
37 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
| 38 | # |
38 | # |
| 39 | # Check whether a specified file exists within the image/ directory |
39 | # Check whether a specified file exists within the image/ directory |
| 40 | # or not. |
40 | # or not. |
| … | |
… | |
| 48 | { |
48 | { |
| 49 | local my_prefix |
49 | local my_prefix |
| 50 | |
50 | |
| 51 | [ -n "$2" ] && my_prefix="$2/" || my_prefix= |
51 | [ -n "$2" ] && my_prefix="$2/" || my_prefix= |
| 52 | |
52 | |
| 53 | if [ ! -e ${my_prefix}$1 ]; then |
53 | if [ ! -e "${my_prefix}$1" ]; then |
| 54 | msg="ebuild fault: file $1 not found" |
54 | msg="ebuild fault: file '$1' not found" |
| 55 | eerror "$msg" |
55 | eerror "$msg" |
| 56 | eerror "Please report this as a bug at http://bugs.gentoo.org/" |
56 | eerror "Please report this as a bug at http://bugs.gentoo.org/" |
| 57 | die "$msg" |
57 | die "$msg" |
| 58 | fi |
58 | fi |
| 59 | } |
59 | } |
| … | |
… | |
| 64 | |
64 | |
| 65 | function webapp_check_installedat |
65 | function webapp_check_installedat |
| 66 | { |
66 | { |
| 67 | local my_output |
67 | local my_output |
| 68 | |
68 | |
| 69 | /usr/sbin/webapp-config --show-installed -h localhost -d $INSTALL_DIR 2> /dev/null |
69 | /usr/sbin/webapp-config --show-installed -h localhost -d "$INSTALL_DIR" 2> /dev/null |
| 70 | } |
70 | } |
| 71 | |
71 | |
| 72 | # ------------------------------------------------------------------------ |
72 | # ------------------------------------------------------------------------ |
| 73 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
73 | # INTERNAL FUNCTION - USED BY THIS ECLASS ONLY |
| 74 | # ------------------------------------------------------------------------ |
74 | # ------------------------------------------------------------------------ |
| … | |
… | |
| 115 | # ------------------------------------------------------------------------ |
115 | # ------------------------------------------------------------------------ |
| 116 | |
116 | |
| 117 | function webapp_configfile () |
117 | function webapp_configfile () |
| 118 | { |
118 | { |
| 119 | webapp_checkfileexists "$1" "$D" |
119 | webapp_checkfileexists "$1" "$D" |
| 120 | echo $1 |
120 | |
| 121 | local MY_FILE="`webapp_strip_appdir $1`" |
121 | local MY_FILE="`webapp_strip_appdir \"$1\"`" |
| 122 | echo $MY_FILE |
122 | MY_FILE="`webapp_strip_cwd \"$MY_FILE\"`" |
| 123 | |
123 | |
| 124 | einfo "(config) $MY_FILE" |
124 | einfo "(config) $MY_FILE" |
| 125 | echo "$MY_FILE" >> ${D}${WA_CONFIGLIST} |
125 | echo "$MY_FILE" >> ${D}${WA_CONFIGLIST} |
| 126 | } |
126 | } |
| 127 | |
127 | |
| … | |
… | |
| 134 | # @param $1 - the script to run |
134 | # @param $1 - the script to run |
| 135 | # ------------------------------------------------------------------------ |
135 | # ------------------------------------------------------------------------ |
| 136 | |
136 | |
| 137 | function webapp_hook_script () |
137 | function webapp_hook_script () |
| 138 | { |
138 | { |
| 139 | webapp_checkfileexists "$2" |
139 | webapp_checkfileexists "$1" |
| 140 | |
140 | |
| 141 | einfo "(hook) $1" |
141 | einfo "(hook) $1" |
| 142 | cp "$1" "${D}${MY_HOOKSCRIPTSDIR}/`basename $1`" || die "Unable to install $1 into ${D}${MY_HOOKSCRIPTSDIR}/" |
142 | cp "$1" "${D}${MY_HOOKSCRIPTSDIR}/`basename $1`" || die "Unable to install $1 into ${D}${MY_HOOKSCRIPTSDIR}/" |
| 143 | chmod 555 "${D}${MY_HOOKSCRIPTSDIR}/`basename $1`" |
143 | chmod 555 "${D}${MY_HOOKSCRIPTSDIR}/`basename $1`" |
| 144 | } |
144 | } |
| … | |
… | |
| 150 | # |
150 | # |
| 151 | # @param $1 - language code (use 'en' for now) |
151 | # @param $1 - language code (use 'en' for now) |
| 152 | # @param $2 - the file to install |
152 | # @param $2 - the file to install |
| 153 | # ------------------------------------------------------------------------ |
153 | # ------------------------------------------------------------------------ |
| 154 | |
154 | |
| 155 | function webapp_postinst_txt |
155 | function webapp_postinst_txt () |
| 156 | { |
156 | { |
| 157 | webapp_checkfileexists "$2" |
157 | webapp_checkfileexists "$2" |
| 158 | |
158 | |
| 159 | einfo "(rtfm) $2 (lang: $1)" |
159 | einfo "(rtfm) $2 (lang: $1)" |
| 160 | cp "$2" "${D}${MY_APPDIR}/postinst-$1.txt" |
160 | cp "$2" "${D}${MY_APPDIR}/postinst-$1.txt" |
| 161 | } |
161 | } |
| 162 | |
162 | |
| 163 | # ------------------------------------------------------------------------ |
163 | # ------------------------------------------------------------------------ |
| 164 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
164 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
| 165 | # |
165 | # |
| 166 | # Identify a script file (usually, but not always PHP or Perl) which is |
166 | # Install a text file containing post-upgrade instructions. |
| 167 | # |
167 | # |
| 168 | # Files in this list may be modified to #! the required CGI engine when |
168 | # @param $1 - language code (use 'en' for now) |
| 169 | # installed by webapp-config tool in the future. |
169 | # @param $2 - the file to install |
| 170 | # |
|
|
| 171 | # @param $1 - the cgi engine to use |
|
|
| 172 | # @param $2 - the script file that could run under a cgi-bin |
|
|
| 173 | # |
|
|
| 174 | # ------------------------------------------------------------------------ |
170 | # ------------------------------------------------------------------------ |
|
|
171 | |
|
|
172 | function webapp_postupgrade_txt () |
|
|
173 | { |
|
|
174 | webapp_checkfileexists "$2" |
|
|
175 | |
|
|
176 | einfo "(rtfm) $2 (lang: $1)" |
|
|
177 | cp "$2" "${D}${MY_APPDIR}/postupgrade-$1.txt" |
|
|
178 | } |
|
|
179 | |
|
|
180 | # ------------------------------------------------------------------------ |
|
|
181 | # DEPRECATED FUNCTION |
|
|
182 | # |
|
|
183 | # It never worked anyway |
| 175 | |
184 | |
| 176 | function webapp_runbycgibin () |
185 | function webapp_runbycgibin () |
| 177 | { |
186 | { |
| 178 | webapp_checkfileexists "$2" "$D" |
187 | if [ -n "$WARN_RUNBYCGIBIN" ] ; then |
| 179 | local MY_FILE="`webapp_strip_appdir $2`" |
188 | return |
| 180 | MY_FILE="`webapp_strip_cwd $MY_FILE`" |
189 | fi |
| 181 | |
190 | |
| 182 | einfo "(cgi-bin) $1 - $MY_FILE" |
191 | ewarn "This ebuild uses webapp.eclass's webapp_runbycgibin, which is now" |
| 183 | echo "$1 $MY_FILE" >> ${D}${WA_RUNBYCGIBINLIST} |
192 | ewarn "deprecated. Please file a bug about this in Bugzilla." |
|
|
193 | WARN_RUNBYCGIBIN=1 |
| 184 | } |
194 | } |
| 185 | |
195 | |
| 186 | # ------------------------------------------------------------------------ |
196 | # ------------------------------------------------------------------------ |
| 187 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
197 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
| 188 | # |
198 | # |
| 189 | # Identify a file which must be owned by the webserver's user:group |
199 | # Identify a file which must be owned by the webserver's user:group |
| 190 | # settings. |
200 | # settings. |
| 191 | # |
201 | # |
| 192 | # The ownership of the file is NOT set until the application is installed |
202 | # The ownership of the file is NOT set until the application is installed |
| 193 | # using the webapp-config tool. |
203 | # using the webapp-config tool. |
| 194 | # |
204 | # |
| 195 | # @param $1 - file to be owned by the webserver user:group combo |
205 | # @param $1 - file to be owned by the webserver user:group combo |
| 196 | # |
206 | # |
| 197 | # ------------------------------------------------------------------------ |
207 | # ------------------------------------------------------------------------ |
| 198 | |
208 | |
| 199 | function webapp_serverowned () |
209 | function webapp_serverowned () |
| 200 | { |
210 | { |
| 201 | webapp_checkfileexists "$1" "$D" |
211 | webapp_checkfileexists "$1" "$D" |
| 202 | local MY_FILE="`webapp_strip_appdir $1`" |
212 | local MY_FILE="`webapp_strip_appdir \"$1\"`" |
| 203 | |
213 | MY_FILE="`webapp_strip_cwd \"$MY_FILE\"`" |
|
|
214 | |
| 204 | einfo "(server owned) $MY_FILE" |
215 | einfo "(server owned) $MY_FILE" |
| 205 | echo "$MY_FILE" >> ${D}${WA_SOLIST} |
216 | echo "$MY_FILE" >> "${D}${WA_SOLIST}" |
| 206 | } |
217 | } |
| 207 | |
218 | |
| 208 | # ------------------------------------------------------------------------ |
219 | # ------------------------------------------------------------------------ |
| 209 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
220 | # EXPORTED FUNCTION - FOR USE IN EBUILDS |
| 210 | # |
221 | # |
| … | |
… | |
| 217 | # NOTE: |
228 | # NOTE: |
| 218 | # this function will automagically prepend $1 to the front of your |
229 | # this function will automagically prepend $1 to the front of your |
| 219 | # config file's name |
230 | # config file's name |
| 220 | # ------------------------------------------------------------------------ |
231 | # ------------------------------------------------------------------------ |
| 221 | |
232 | |
| 222 | function webapp_server_config () |
233 | function webapp_server_configfile () |
| 223 | { |
234 | { |
| 224 | webapp_checkfileexists "$2" |
235 | webapp_checkfileexists "$2" |
| 225 | |
236 | |
| 226 | # sort out what the name will be of the config file |
237 | # sort out what the name will be of the config file |
| 227 | |
238 | |
| 228 | local my_file |
239 | local my_file |
| 229 | |
240 | |
| 230 | if [ -z "$3" ]; then |
241 | if [ -z "$3" ]; then |
| 231 | $my_file="$1-`basename $2`" |
242 | my_file="$1-`basename $2`" |
| 232 | else |
243 | else |
| 233 | $my_file="$1-$3" |
244 | my_file="$1-$3" |
| 234 | fi |
245 | fi |
| 235 | |
246 | |
| 236 | # warning: |
247 | # warning: |
| 237 | # |
248 | # |
| 238 | # do NOT change the naming convention used here without changing all |
249 | # do NOT change the naming convention used here without changing all |
| 239 | # the other scripts that also rely upon these names |
250 | # the other scripts that also rely upon these names |
| 240 | |
251 | |
| 241 | einfo "($1) config file '$my_file'" |
252 | einfo "($1) config file '$my_file'" |
| 242 | cp "$2" "${D}${MY_SERVERCONFIGDIR}/${my_file}" |
253 | cp "$2" "${D}${MY_SERVERCONFIGDIR}/${my_file}" |
| 243 | } |
254 | } |
| 244 | |
255 | |
| 245 | # ------------------------------------------------------------------------ |
256 | # ------------------------------------------------------------------------ |
| … | |
… | |
| 269 | |
280 | |
| 270 | # warning: |
281 | # warning: |
| 271 | # |
282 | # |
| 272 | # do NOT change the naming convention used here without changing all |
283 | # do NOT change the naming convention used here without changing all |
| 273 | # the other scripts that also rely upon these names |
284 | # the other scripts that also rely upon these names |
| 274 | |
285 | |
| 275 | # are we dealing with an 'upgrade'-type script? |
286 | # are we dealing with an 'upgrade'-type script? |
| 276 | if [ -n "$3" ]; then |
287 | if [ -n "$3" ]; then |
| 277 | # yes we are |
288 | # yes we are |
| 278 | einfo "($1) upgrade script from ${PN}-${PVR} to $3" |
289 | einfo "($1) upgrade script from ${PN}-${PVR} to $3" |
| 279 | cp $2 ${D}${MY_SQLSCRIPTSDIR}/$1/${3}_to_${PVR}.sql |
290 | cp "$2" "${D}${MY_SQLSCRIPTSDIR}/$1/${3}_to_${PVR}.sql" |
|
|
291 | chmod 600 "${D}${MY_SQLSCRIPTSDIR}/$1/${3}_to_${PVR}.sql" |
| 280 | else |
292 | else |
| 281 | # no, we are not |
293 | # no, we are not |
| 282 | einfo "($1) create script for ${PN}-${PVR}" |
294 | einfo "($1) create script for ${PN}-${PVR}" |
| 283 | cp $2 ${D}${MY_SQLSCRIPTSDIR}/$1/${PVR}_create.sql |
295 | cp "$2" "${D}${MY_SQLSCRIPTSDIR}/$1/${PVR}_create.sql" |
|
|
296 | chmod 600 "${D}${MY_SQLSCRIPTSDIR}/$1/${PVR}_create.sql" |
| 284 | fi |
297 | fi |
| 285 | } |
298 | } |
| 286 | |
299 | |
| 287 | # ------------------------------------------------------------------------ |
300 | # ------------------------------------------------------------------------ |
| 288 | # EXPORTED FUNCTION - call from inside your ebuild's src_install AFTER |
301 | # EXPORTED FUNCTION - call from inside your ebuild's src_install AFTER |
| … | |
… | |
| 293 | # the final version! |
306 | # the final version! |
| 294 | # ------------------------------------------------------------------------ |
307 | # ------------------------------------------------------------------------ |
| 295 | |
308 | |
| 296 | function webapp_src_install () |
309 | function webapp_src_install () |
| 297 | { |
310 | { |
| 298 | chown -R ${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID} ${D}/ |
311 | chown -R "${VHOST_DEFAULT_UID}:${VHOST_DEFAULT_GID}" "${D}/" |
| 299 | chmod -R u-s ${D}/ |
312 | chmod -R u-s "${D}/" |
| 300 | chmod -R g-s ${D}/ |
313 | chmod -R g-s "${D}/" |
| 301 | |
314 | |
| 302 | keepdir ${MY_PERSISTDIR} |
315 | keepdir "${MY_PERSISTDIR}" |
| 303 | fowners root:root ${MY_PERSISTDIR} |
316 | fowners "root:root" "${MY_PERSISTDIR}" |
| 304 | fperms 755 ${MY_PERSISTDIR} |
317 | fperms 755 "${MY_PERSISTDIR}" |
| 305 | |
318 | |
| 306 | # to test whether or not the ebuild has correctly called this function |
319 | # to test whether or not the ebuild has correctly called this function |
| 307 | # we add an empty file to the filesystem |
320 | # we add an empty file to the filesystem |
| 308 | # |
321 | # |
| 309 | # we used to just set a variable in the shell script, but we can |
322 | # we used to just set a variable in the shell script, but we can |
| 310 | # no longer rely on Portage calling both webapp_src_install() and |
323 | # no longer rely on Portage calling both webapp_src_install() and |
| 311 | # webapp_pkg_postinst() within the same shell process |
324 | # webapp_pkg_postinst() within the same shell process |
| 312 | |
325 | |
| 313 | touch ${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE} |
326 | touch "${D}/${MY_APPDIR}/${INSTALL_CHECK_FILE}" |
| 314 | } |
327 | } |
| 315 | |
328 | |
| 316 | # ------------------------------------------------------------------------ |
329 | # ------------------------------------------------------------------------ |
| 317 | # EXPORTED FUNCTION - call from inside your ebuild's pkg_config AFTER |
330 | # EXPORTED FUNCTION - call from inside your ebuild's pkg_config AFTER |
| 318 | # everything else has run |
331 | # everything else has run |
| … | |
… | |
| 330 | fi |
343 | fi |
| 331 | |
344 | |
| 332 | # pull in the shared configuration file |
345 | # pull in the shared configuration file |
| 333 | |
346 | |
| 334 | G_HOSTNAME="localhost" |
347 | G_HOSTNAME="localhost" |
| 335 | . /etc/vhosts/webapp-config || die "Unable to open /etc/vhosts/webapp-config file" |
348 | . "${ETC_CONFIG}" || die "Unable to open file ${ETC_CONFIG}" |
| 336 | |
349 | |
| 337 | # are we installing a webapp-config solution over the top of a |
350 | # are we installing a webapp-config solution over the top of a |
| 338 | # non-webapp-config solution? |
351 | # non-webapp-config solution? |
| 339 | |
352 | |
| 340 | if ! use vhosts ; then |
353 | if ! use vhosts ; then |
| 341 | local my_dir="$VHOST_ROOT/$MY_HTDOCSBASE/$PN" |
354 | local my_dir="$VHOST_ROOT/$MY_HTDOCSBASE/$PN" |
| 342 | local my_output |
355 | local my_output |
| … | |
… | |
| 420 | |
433 | |
| 421 | function webapp_src_preinst () |
434 | function webapp_src_preinst () |
| 422 | { |
435 | { |
| 423 | # create the directories that we need |
436 | # create the directories that we need |
| 424 | |
437 | |
| 425 | dodir ${MY_HTDOCSDIR} |
438 | dodir "${MY_HTDOCSDIR}" |
| 426 | dodir ${MY_HOSTROOTDIR} |
439 | dodir "${MY_HOSTROOTDIR}" |
| 427 | dodir ${MY_CGIBINDIR} |
440 | dodir "${MY_CGIBINDIR}" |
| 428 | dodir ${MY_ICONSDIR} |
441 | dodir "${MY_ICONSDIR}" |
| 429 | dodir ${MY_ERRORSDIR} |
442 | dodir "${MY_ERRORSDIR}" |
| 430 | dodir ${MY_SQLSCRIPTSDIR} |
443 | dodir "${MY_SQLSCRIPTSDIR}" |
|
|
444 | dodir "${MY_HOOKSCRIPTSDIR}" |
|
|
445 | dodir "${MY_SERVERCONFIGDIR}" |
| 431 | } |
446 | } |
| 432 | |
447 | |
| 433 | function webapp_pkg_postinst () |
448 | function webapp_pkg_postinst () |
| 434 | { |
449 | { |
|
|
450 | . "${ETC_CONFIG}" |
|
|
451 | |
| 435 | # sanity checks, to catch bugs in the ebuild |
452 | # sanity checks, to catch bugs in the ebuild |
| 436 | |
453 | |
| 437 | if [ ! -f ${MY_APPDIR}/${INSTALL_CHECK_FILE} ]; then |
454 | if [ ! -f "${MY_APPDIR}/${INSTALL_CHECK_FILE}" ]; then |
| 438 | eerror |
455 | eerror |
| 439 | eerror "This ebuild did not call webapp_src_install() at the end" |
456 | eerror "This ebuild did not call webapp_src_install() at the end" |
| 440 | eerror "of the src_install() function" |
457 | eerror "of the src_install() function" |
| 441 | eerror |
458 | eerror |
| 442 | eerror "Please log a bug on http://bugs.gentoo.org" |
459 | eerror "Please log a bug on http://bugs.gentoo.org" |
| … | |
… | |
| 447 | die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org" |
464 | die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org" |
| 448 | fi |
465 | fi |
| 449 | |
466 | |
| 450 | # if 'vhosts' is not set in your USE flags, we install a copy of |
467 | # if 'vhosts' is not set in your USE flags, we install a copy of |
| 451 | # this application in /var/www/localhost/htdocs/${PN}/ for you |
468 | # this application in /var/www/localhost/htdocs/${PN}/ for you |
| 452 | |
469 | |
| 453 | if ! use vhosts ; then |
470 | if ! use vhosts ; then |
| 454 | echo |
471 | echo |
| 455 | einfo "vhosts USE flag not set - auto-installing using webapp-config" |
472 | einfo "vhosts USE flag not set - auto-installing using webapp-config" |
| 456 | |
473 | |
| 457 | webapp_getinstalltype |
474 | webapp_getinstalltype |
| 458 | |
475 | |
| 459 | G_HOSTNAME="localhost" |
476 | G_HOSTNAME="localhost" |
| 460 | . /etc/vhosts/webapp-config |
477 | . "${ETC_CONFIG}" |
| 461 | |
478 | |
| 462 | local my_mode=-I |
479 | local my_mode=-I |
| 463 | |
480 | |
| 464 | if [ "$IS_REPLACE" = "1" ]; then |
481 | if [ "$IS_REPLACE" = "1" ]; then |
| 465 | einfo "${PN}-${PVR} is already installed - replacing" |
482 | einfo "${PN}-${PVR} is already installed - replacing" |
| 466 | /usr/sbin/webapp-config -C -d "$INSTALL_DIR" |
483 | my_mode=-I |
| 467 | elif [ "$IS_UPGRADE" = "1" ]; then |
484 | elif [ "$IS_UPGRADE" = "1" ]; then |
| 468 | einfo "$REMOVE_PKG is already installed - upgrading" |
485 | einfo "$REMOVE_PKG is already installed - upgrading" |
| 469 | my_mode=-U |
486 | my_mode=-U |
| 470 | else |
487 | else |
| 471 | einfo "${PN}-${PVR} is not installed - using install mode" |
488 | einfo "${PN}-${PVR} is not installed - using install mode" |
| 472 | fi |
489 | fi |
| 473 | |
490 | |
| 474 | my_cmd="/usr/sbin/webapp-config $my_mode -h localhost -u root -d $INSTALL_DIR ${PN} ${PVR}" |
491 | my_cmd="/usr/sbin/webapp-config $my_mode -h localhost -u root -d $INSTALL_DIR ${PN} ${PVR}" |
| 475 | einfo "Running $my_cmd" |
492 | einfo "Running $my_cmd" |
| 476 | $my_cmd |
493 | $my_cmd |
| 477 | |
494 | |
| 478 | # remove the old version |
495 | # remove the old version |
| … | |
… | |
| 487 | # the user is relying on portage to do the magical thing for it |
504 | # the user is relying on portage to do the magical thing for it |
| 488 | |
505 | |
| 489 | if [ "$IS_UPGRADE" = "1" ] ; then |
506 | if [ "$IS_UPGRADE" = "1" ] ; then |
| 490 | einfo "Removing old version $REMOVE_PKG" |
507 | einfo "Removing old version $REMOVE_PKG" |
| 491 | |
508 | |
| 492 | emerge -C $CATEGORY/$REMOVE_PKG |
509 | emerge -C "$REMOVE_PKG" |
| 493 | fi |
510 | fi |
| 494 | else |
511 | else |
| 495 | # vhosts flag is on |
512 | # vhosts flag is on |
| 496 | # |
513 | # |
| 497 | # let's tell the administrator what to do next |
514 | # let's tell the administrator what to do next |