| 1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2004 Gentoo Technologies, Inc. |
| 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.14 2004/05/01 00:45:45 stuart Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/webapp.eclass,v 1.15 2004/05/03 21:11:46 stuart 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 |
| … | |
… | |
| 18 | |
18 | |
| 19 | ECLASS=webapp |
19 | ECLASS=webapp |
| 20 | INHERITED="$INHERITED $ECLASS" |
20 | INHERITED="$INHERITED $ECLASS" |
| 21 | SLOT="${PVR}" |
21 | SLOT="${PVR}" |
| 22 | IUSE="$IUSE vhosts" |
22 | IUSE="$IUSE vhosts" |
| 23 | DEPEND="$DEPEND >=net-www/webapp-config-1.7" |
23 | DEPEND="$DEPEND >=net-www/webapp-config-1.6" |
| 24 | |
24 | |
| 25 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install |
25 | EXPORT_FUNCTIONS pkg_postinst pkg_setup src_install |
| 26 | |
26 | |
| 27 | INSTALL_DIR="/$PN" |
27 | INSTALL_DIR="/$PN" |
| 28 | IS_UPGRADE=0 |
28 | IS_UPGRADE=0 |
| … | |
… | |
| 241 | chmod -R g-s ${D}/ |
241 | chmod -R g-s ${D}/ |
| 242 | |
242 | |
| 243 | keepdir ${MY_PERSISTDIR} |
243 | keepdir ${MY_PERSISTDIR} |
| 244 | fowners root:root ${MY_PERSISTDIR} |
244 | fowners root:root ${MY_PERSISTDIR} |
| 245 | fperms 755 ${MY_PERSISTDIR} |
245 | fperms 755 ${MY_PERSISTDIR} |
|
|
246 | |
|
|
247 | HAS_webapp_src_install=1 |
| 246 | } |
248 | } |
| 247 | |
249 | |
| 248 | # ------------------------------------------------------------------------ |
250 | # ------------------------------------------------------------------------ |
| 249 | # EXPORTED FUNCTION - call from inside your ebuild's pkg_config AFTER |
251 | # EXPORTED FUNCTION - call from inside your ebuild's pkg_config AFTER |
| 250 | # everything else has run |
252 | # everything else has run |
| … | |
… | |
| 253 | # |
255 | # |
| 254 | # ------------------------------------------------------------------------ |
256 | # ------------------------------------------------------------------------ |
| 255 | |
257 | |
| 256 | function webapp_pkg_setup () |
258 | function webapp_pkg_setup () |
| 257 | { |
259 | { |
|
|
260 | # add sanity checks here |
|
|
261 | |
|
|
262 | if [ "$SLOT+" != "${PVR}+" ]; then |
|
|
263 | die "ebuild sets SLOT, overrides webapp.eclass" |
|
|
264 | fi |
|
|
265 | |
| 258 | # pull in the shared configuration file |
266 | # pull in the shared configuration file |
| 259 | |
267 | |
| 260 | . /etc/vhosts/webapp-config || die "Unable to open /etc/vhosts/webapp-config file" |
268 | . /etc/vhosts/webapp-config || die "Unable to open /etc/vhosts/webapp-config file" |
| 261 | } |
269 | } |
| 262 | |
270 | |
| … | |
… | |
| 314 | dodir ${MY_SQLSCRIPTSDIR} |
322 | dodir ${MY_SQLSCRIPTSDIR} |
| 315 | } |
323 | } |
| 316 | |
324 | |
| 317 | function webapp_pkg_postinst () |
325 | function webapp_pkg_postinst () |
| 318 | { |
326 | { |
|
|
327 | # sanity checks, to catch bugs in the ebuild |
|
|
328 | |
|
|
329 | if [ "$HAS_webapp_src_install+" == "+" ]; then |
|
|
330 | eerror |
|
|
331 | eerror "This ebuild did not call webapp_src_install() at the end" |
|
|
332 | eerror "of the src_install() function" |
|
|
333 | eerror |
|
|
334 | eerror "Please log a bug on http://bugs.gentoo.org" |
|
|
335 | eerror |
|
|
336 | eerror "You should use emerge -C to remove this package, as the" |
|
|
337 | eerror "installation is incomplete" |
|
|
338 | eerror |
|
|
339 | die "Ebuild did not call webapp_src_install() - report to http://bugs.gentoo.org" |
|
|
340 | fi |
|
|
341 | |
| 319 | # if 'vhosts' is not set in your USE flags, we install a copy of |
342 | # if 'vhosts' is not set in your USE flags, we install a copy of |
| 320 | # this application in /var/www/localhost/htdocs/${PN}/ for you |
343 | # this application in /var/www/localhost/htdocs/${PN}/ for you |
| 321 | |
344 | |
| 322 | if ! use vhosts ; then |
345 | if ! use vhosts ; then |
| 323 | echo |
346 | echo |