Contents of /trunk/extras/apache2/apache2-2.2.9-r1.smage2
Parent Directory | Revision Log
Revision 2 -
(show annotations)
(download)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
File size: 7432 byte(s)
Fri Oct 10 13:29:42 2008 UTC (15 years, 11 months ago) by niro
File size: 7432 byte(s)
import repo
1 | # $Header: /magellan-cvs/smage/apache2/apache2-2.2.9-r1.smage2,v 1.1 2008/08/02 14:42:19 niro Exp $ |
2 | |
3 | PNAME="apache2" |
4 | PVER="2.2.9" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="net-www" |
8 | STATE="unstable" |
9 | |
10 | DESCRIPTION="The Apache HTTP web server." |
11 | HOMEPAGE="http://httpd.apache.org/" |
12 | |
13 | DEPEND=">= virtual/glibc |
14 | >= dev-db/db-4.6 |
15 | >= dev-libs/apr-1.2.12 |
16 | >= dev-libs/apr-util-1.2.12 |
17 | >= dev-libs/expat-2 |
18 | >= dev-libs/libpcre-7.6 |
19 | >= dev-libs/openssl-0.9.8 |
20 | >= dev-lang/perl-5.10 |
21 | >= sys-libs/zlib-1.2" |
22 | |
23 | SRCFILE="httpd-${PVER}.tar.bz2" |
24 | SRCDIR="${BUILDDIR}/httpd-${PVER}" |
25 | |
26 | RC_VER=1.4 |
27 | |
28 | sminclude mtools |
29 | |
30 | SRC_URI=( |
31 | http://www.apache.org/dist/httpd/${SRCFILE} |
32 | mirror://${PNAME}/${SRCFILE} |
33 | mirror://${PNAME}/${PNAME}-2.2.4-magellan-layout.patch |
34 | mirror://${PNAME}/${PNAME}-2.2.4-magellan-vendor.patch |
35 | mirror://${PNAME}/${PNAME}-2.2.8-default-user.patch |
36 | mirror://${PNAME}/${PNAME}-${PVER}-default-server-root.patch |
37 | mirror://${PNAME}/${PNAME}-2.2.8-default-mpm-settings.patch |
38 | mirror://${PNAME}/${PNAME}-${PVER}-default-dav-settings.patch |
39 | mirror://${PNAME}/${PNAME}-2.2.6-default-ssl-settings.patch |
40 | mirror://${PNAME}/${PNAME}-2.2.4-default-httpd-config.patch |
41 | mirror://${PNAME}/${PNAME}-2.2.4-apxs-httpd-config-2.patch |
42 | mirror://${PNAME}/${PNAME}-2.2.4-mod_dir-adddirectoryindex.patch |
43 | mirror://${PNAME}/apache2.rc-${RC_VER} |
44 | mirror://${PNAME}/apache2.logrotate |
45 | mirror://${PNAME}/gentestcrt.sh |
46 | ) |
47 | |
48 | src_prepare() |
49 | { |
50 | munpack ${SRCFILE} || die |
51 | cd ${SRCDIR} |
52 | |
53 | # add our own layout |
54 | mpatch ${PNAME}-2.2.4-magellan-layout.patch || die |
55 | |
56 | # report version description with 'Magellan' instead of 'UNIX' |
57 | mpatch ${PNAME}-2.2.4-magellan-vendor.patch || die |
58 | |
59 | # use 'apache' as http-user instead of daemon |
60 | mpatch ${PNAME}-2.2.8-default-user.patch || die |
61 | |
62 | # fixes the default server root in the httpd.conf |
63 | # defaults to $(prefix) but $(libdir)/apache2 is safer |
64 | mpatch ${PNAME}-${PVER}-default-server-root.patch || die |
65 | |
66 | # fixes the default pid- and lockfile |
67 | # try to be compatible with apache1 and apache2 installations |
68 | # -> the pidfile should be named apache2.pid |
69 | # also all other unneeded mpm settings are removed |
70 | mpatch ${PNAME}-2.2.8-default-mpm-settings.patch || die |
71 | |
72 | # use same sane default dav settings that match our layout |
73 | mpatch ${PNAME}-${PVER}-default-dav-settings.patch || die |
74 | |
75 | # fixes the default ssl pathes |
76 | mpatch ${PNAME}-2.2.6-default-ssl-settings.patch || die |
77 | |
78 | # use modules.d instead of extra directory for addons |
79 | # and renamed the config files without the 'httpd-' prefix |
80 | # and now load mpm.conf and default.conf |
81 | mpatch ${PNAME}-2.2.4-default-httpd-config.patch || die |
82 | |
83 | # fixes apxs to not use progname.conf but httpd.conf as httpd config |
84 | # and fixes to modules path relative to server root also |
85 | mpatch ${PNAME}-2.2.4-apxs-httpd-config-2.patch || die |
86 | |
87 | # taken from gentoo: provides AddDirectyIndex directive |
88 | # better support for adding indexes, needed at least by php5 |
89 | mpatch ${PNAME}-2.2.4-mod_dir-adddirectoryindex.patch || die |
90 | |
91 | # fix ServerRoot path in the initscript |
92 | # to respect $(mlibdir) on 64bit-Arches |
93 | sed -i "s:@@ServerRoot@@:/usr/$(mlibdir)/apache2:g" \ |
94 | ${SOURCEDIR}/${PNAME}/apache2.rc-${RC_VER} || die |
95 | } |
96 | |
97 | src_compile() |
98 | { |
99 | cd ${SRCDIR} |
100 | |
101 | # beware! mconfigure overwrite our layout pathes! |
102 | mconfigure \ |
103 | --libexecdir=/usr/$(mlibdir)/apache2/modules \ |
104 | --includedir=/usr/include/apache2 \ |
105 | --datadir=/var/www \ |
106 | --sysconfdir=/etc/apache2 \ |
107 | --localstatedir=/var \ |
108 | --enable-layout=Magellan \ |
109 | --with-program-name=apache2 \ |
110 | --with-port=80 \ |
111 | --enable-so \ |
112 | --enable-modules=all \ |
113 | --enable-mods-shared=all \ |
114 | --enable-suexec \ |
115 | --with-suexec-safepath='/usr/local/bin:/usr/bin:/bin' \ |
116 | --with-suexec-logfile=/var/log/apache2/suexec_log \ |
117 | --with-suexec-bin=/usr/sbin/suexec \ |
118 | --with-suexec-userdir=public_html \ |
119 | --with-suexec-caller=apache \ |
120 | --with-suexec-docroot=/var/www \ |
121 | --with-suexec-uidmin=1000 \ |
122 | --with-suexec-gidmin=100 \ |
123 | --with-suexec-umask=077 \ |
124 | --with-ssl=/usr \ |
125 | --enable-ssl \ |
126 | --enable-deflate \ |
127 | --with-gdbm \ |
128 | --with-mpm=prefork \ |
129 | --with-pcre \ |
130 | --with-pcre=/usr \ |
131 | --with-perl=/usr/bin/perl \ |
132 | --with-expat=/usr \ |
133 | --with-z=/usr \ |
134 | --with-apr=/usr \ |
135 | --with-apr-util=/usr \ |
136 | || die |
137 | |
138 | # include/ap_config_auto.h is created by configure and |
139 | # --with-program-name renames http.conf to the given program name, |
140 | # but we want to use httpd.conf instead of apache2.conf |
141 | sed -i 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die |
142 | # fix up the server root, default is $prefix but we want /usr/lib/apache2 |
143 | sed -i "s:^\(#define HTTPD_ROOT \).*:\1\"/usr/$(mlibdir)/apache2\":" include/ap_config_auto.h || die |
144 | # multilib build fixes, like this one: |
145 | # /usr/lib64/apr-1/build/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc -pthread -L/usr/lib -o htpasswd htpasswd.lo -lm -L/usr/lib64 -lpcre /usr/lib64/libaprutil-1.la -ldb -lexpat /usr/lib64/libapr-1.la -luuid -lrt -lcrypt -lpthread -ldl |
146 | # /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm |
147 | # /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm |
148 | # /usr/lib/libexpat.so: could not read symbols: File in wrong format |
149 | sed -i "s:/usr/lib$:/usr/$(mlibdir):" build/config_vars.mk || die |
150 | |
151 | mmake || die |
152 | } |
153 | |
154 | src_install() |
155 | { |
156 | cd ${SRCDIR} |
157 | mmake DESTDIR=${BINDIR} install || die |
158 | minstalldocs ABOUT* CHANGES LICENSE NOTICE README* ROADMAP VERSIONING || die |
159 | |
160 | # fix permissions of suexec |
161 | mchown root:apache /usr/sbin/suexec || die |
162 | mchmod 4710 /usr/sbin/suexec || die |
163 | |
164 | # create some needed dirs |
165 | mkeepdir /etc/apache2/ssl || die |
166 | mkeepdir /var/lib/apache || die |
167 | mchown apache:apache /var/lib/apache || die |
168 | mkeepdir /var/lib/dav || die |
169 | mchown apache:apache /var/lib/dav || die |
170 | mkeepdir /var/log/apache2 || die |
171 | mchown apache:apache /var/log/apache2 || die |
172 | mkeepdir /var/cache/apache2/proxy || die |
173 | mchown apache:apache /var/cache/apache2/proxy || die |
174 | |
175 | # install certificate helper |
176 | minstallexec -s gentestcrt.sh /usr/sbin/gentestcrt || die |
177 | |
178 | # install logrotate config |
179 | minstalllog apache2.logrotate apache2 || die |
180 | |
181 | # install the initscript |
182 | minstallrc apache2.rc-${RC_VER} apache2 || die |
183 | |
184 | # rename apache2.conf |
185 | mv ${BINDIR}/etc/apache2/{apache2,httpd}.conf || die |
186 | |
187 | # rename extra dir to modules.d and remove the 'httpd-' |
188 | # prefix from every module configuration file |
189 | mv ${BINDIR}/etc/apache2/{extra,modules.d} || die |
190 | local i |
191 | for i in ${BINDIR}/etc/apache2/modules.d/* |
192 | do |
193 | mv ${i} ${i/httpd-/} || die ${i} |
194 | done |
195 | |
196 | # prune backup files |
197 | if [[ -d ${BINDIR}/etc/apache2/original ]] |
198 | then |
199 | rm -r ${BINDIR}/etc/apache2/original || die |
200 | fi |
201 | |
202 | # add /var/www to CONFIG_PROTECT |
203 | minstalldir /etc/env.d || die |
204 | echo "CONFIG_PROTECT=\"/var/www\"" > ${BINDIR}/etc/env.d/30apache2 || die |
205 | echo "CONFIG_PROTECT_MASK=\"/var/www/manual\"" >> ${BINDIR}/etc/env.d/30apache2 || die |
206 | } |
207 | |
208 | preinstall() |
209 | { |
210 | # adding apache user |
211 | ${MLIBDIR}/mgroupadd -o "-g 81" apache |
212 | ${MLIBDIR}/museradd -o "-u 81 -g apache -d /var/lib/apache -s /bin/false" apache |
213 | } |
214 | |
215 | postinstall() |
216 | { |
217 | # taken from gentoo - generate a test ssl certificate |
218 | if [[ ! -e ${MROOT}/etc/apache2/ssl/server.crt ]] |
219 | then |
220 | [[ -d ${MROOT}/etc/apache2/ssl ]] && install -d ${MROOT}/etc/apache2/ssl |
221 | cd ${MROOT}/etc/apache2/ssl |
222 | echo |
223 | echo "Generating self-signed test certificate in ${MROOT}/etc/apache2/ssl ..." |
224 | echo |
225 | yes "" 2> /dev/null | ${MROOT}/usr/sbin/gentestcrt > /dev/null 2>&1 |
226 | fi |
227 | |
228 | mstartservice apache2 |
229 | } |
230 | |
231 | postremove() |
232 | { |
233 | [[ ! -f /usr/sbin/apache2 ]] && mstopservice apache2 |
234 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |