1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
On Wednesday 02 July 2003 20:35, Max Kalika wrote: |
5 |
> There was a discussion a while back about where and how to install |
6 |
> web-related applications. As it is now, most webapps try to do some grep |
7 |
> magic to see where the apache/apache2 doc root is. Why not consolidate all |
8 |
> this into an eclass with the following (very rough) design spec: |
9 |
> |
10 |
> |
11 |
> --BEGIN--------------------------------------------------------- |
12 |
> inherit webapp |
13 |
> |
14 |
> # The directory to install. Defaults to "${S}" |
15 |
> WEBAPP_SOURCE="/path/to/source/dir" |
16 |
> |
17 |
> # Override which files to install relative to ${WEBAPP_SOURCE}. |
18 |
> # Allows files, and directories. Defaults to all (unset). |
19 |
> WEBAPP_FILES="file1.php file2.cgi dir1 dir2/file3.html" |
20 |
> |
21 |
> # Files to move to /etc/webapps/${PN} and link back so they |
22 |
> # can be taken into account via CONFIG_PROTECT. |
23 |
> # Defaults to none (unset). |
24 |
> WEBAPP_CONFIGS="file1.php dir/config.php" |
25 |
> |
26 |
> # Whether or not this webapp contains CGIs. See below. |
27 |
> # I can see a few packages benefiting from this: e.g. xmltv, mailman |
28 |
> # nut, apcupsd. Defaults to no (unset). |
29 |
> WEBAPP_CGI="yes" |
30 |
> |
31 |
> # Path to a file contain other directives for the generated apache |
32 |
> # configuration file. Defaults to none (unset) |
33 |
> WEBAPP_EXTRA="${FILESDIR}/somefile.conf" |
34 |
> |
35 |
> src_unpack() nothing changes -- unpack as normal; |
36 |
> src_compile() nothing changes -- should have nothing to compile; |
37 |
> src_install() by default runs webapp_src_install() |
38 |
> pkg_postinst() by default runs webapp_pkg_postinst() |
39 |
> pkg_config() by default runs webapp_pkg_config() |
40 |
> |
41 |
> |
42 |
> webapp_src_install() is the workhorse |
43 |
> - copies ${WEBAPP_SOURCE} all together or the items specified under |
44 |
> ${WEBAPP_FILES} to /usr/share/webapps/${PN}. (I believe /usr/share/web |
45 |
> was mentioned as a target candidate as well) |
46 |
> - copies anything in ${WEBAPP_CONFIG} to /etc/webapps/${PN} and links |
47 |
> back |
48 |
> to /usr/share/webapps/${PN}. (Maybe /etc/web?) |
49 |
> - generates a ${PN}.conf and places it into /etc/apache2/conf/modules.d |
50 |
> or |
51 |
> /etc/apache/conf/addon-modules (or both, depending on what exists). |
52 |
> - the conf file may look something like: |
53 |
> |
54 |
> Alias /${PN}/ /usr/share/webapps/${PN}/ |
55 |
> <Directory /usr/share/webapps/${PN}> |
56 |
> AllowOverride Limit |
57 |
> Options Indexes FollowSymLinks # ExecCGI if ${WEBAPP_CGI} |
58 |
> # contents of ${WEBAPP_EXTRA} if it exists |
59 |
> </Directory> |
60 |
> |
61 |
> webapp_pkg_postinst() |
62 |
> - prints an einfo about running /var/db/pkg/${PF}/${PF}.ebuild config |
63 |
> |
64 |
> webapp_pkg_config() |
65 |
> - activates the $PN.conf file created by webapp_src_install() |
66 |
> ----END--------------------------------------------------------- |
67 |
> |
68 |
> |
69 |
> Again, this is all very rough and is probably missing important features. |
70 |
> Here's a sample ebuild that can take advantage of this eclass (there's |
71 |
> absolutely zero testing done because the said eclass is not yet |
72 |
> implemented). |
73 |
> |
74 |
> |
75 |
> --BEGIN-[net-www/myweb-0.10.ebuild]----------------------------- |
76 |
> inherit webapp |
77 |
> |
78 |
> IUSE="" |
79 |
> DESCRIPTION="PHP scripts intended to manage MythTV from a web browser." |
80 |
> HOMEPAGE="http://www.mythtv.org/" |
81 |
> SRC_URI="http://www.mythtv.org/mc/${P}.tar.bz2" |
82 |
> |
83 |
> LICENSE="GPL-2" |
84 |
> SLOT="0" |
85 |
> KEYWORDS="~x86" |
86 |
> |
87 |
> RDEPEND="dev-db/mysql |
88 |
> dev-php/mod_php" |
89 |
> |
90 |
> src_install() { |
91 |
> |
92 |
> WEBAPP_CONFIGS="settings.php" |
93 |
> webapp_src_install() |
94 |
> |
95 |
> dodoc README |
96 |
> |
97 |
> } |
98 |
> ----END--------------------------------------------------------- |
99 |
> |
100 |
> ---max kalika |
101 |
> --max@×××××××××.edu |
102 |
> -lsit systems administrator |
103 |
> |
104 |
> -- |
105 |
> gentoo-dev@g.o mailing list |
106 |
|
107 |
|
108 |
ohh, I like it, I am working on ebuilds for ACID and its deps so ALL the |
109 |
ebuilds could use that eclass. |
110 |
-----BEGIN PGP SIGNATURE----- |
111 |
Version: GnuPG v1.2.2 (GNU/Linux) |
112 |
|
113 |
iD8DBQE/AySX0Q5UUdinJT4RAqX2AKDaoILdqePeaF4MCxQguiEsBEv+VACgsOkm |
114 |
QMaAvHaNpVpZPZvMLhWSKzE= |
115 |
=ktKt |
116 |
-----END PGP SIGNATURE----- |
117 |
|
118 |
-- |
119 |
gentoo-dev@g.o mailing list |