Magellan Linux

Contents of /trunk/extras/apache2/apache2-2.2.14-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4024 - (show annotations) (download)
Tue Nov 17 17:46:22 2009 UTC (14 years, 5 months ago) by niro
File size: 7409 byte(s)
auto added: ver bump to 2.2.14-r1
1 # $Id$
2
3 PNAME="apache2"
4 PVER="2.2.14"
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.7
15 >= dev-libs/apr-1.3
16 >= dev-libs/apr-util-1.3
17 >= dev-libs/expat-2
18 >= dev-libs/libpcre-7.9
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.5
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}-2.2.9-default-server-root.patch
37 mirror://${PNAME}/${PNAME}-2.2.8-default-mpm-settings.patch
38 mirror://${PNAME}/${PNAME}-2.2.9-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 UP2DATE="updatecmd http://www.apache.org/dist/httpd/ | grep httpd- | lasttarball"
49
50 src_prepare()
51 {
52 munpack ${SRCFILE} || die
53 cd ${SRCDIR}
54
55 # add our own layout
56 mpatch ${PNAME}-2.2.4-magellan-layout.patch || die
57
58 # report version description with 'Magellan' instead of 'UNIX'
59 mpatch ${PNAME}-2.2.4-magellan-vendor.patch || die
60
61 # use 'apache' as http-user instead of daemon
62 mpatch ${PNAME}-2.2.8-default-user.patch || die
63
64 # fixes the default server root in the httpd.conf
65 # defaults to $(prefix) but $(libdir)/apache2 is safer
66 mpatch ${PNAME}-2.2.9-default-server-root.patch || die
67
68 # fixes the default pid- and lockfile
69 # try to be compatible with apache1 and apache2 installations
70 # -> the pidfile should be named apache2.pid
71 # also all other unneeded mpm settings are removed
72 mpatch ${PNAME}-2.2.8-default-mpm-settings.patch || die
73
74 # use same sane default dav settings that match our layout
75 mpatch ${PNAME}-2.2.9-default-dav-settings.patch || die
76
77 # fixes the default ssl pathes
78 mpatch ${PNAME}-2.2.6-default-ssl-settings.patch || die
79
80 # use modules.d instead of extra directory for addons
81 # and renamed the config files without the 'httpd-' prefix
82 # and now load mpm.conf and default.conf
83 mpatch ${PNAME}-2.2.4-default-httpd-config.patch || die
84
85 # fixes apxs to not use progname.conf but httpd.conf as httpd config
86 # and fixes to modules path relative to server root also
87 mpatch ${PNAME}-2.2.4-apxs-httpd-config-2.patch || die
88
89 # taken from gentoo: provides AddDirectyIndex directive
90 # better support for adding indexes, needed at least by php5
91 mpatch ${PNAME}-2.2.4-mod_dir-adddirectoryindex.patch || die
92
93 # fix ServerRoot path in the initscript
94 # to respect $(mlibdir) on 64bit-Arches
95 sed -i "s:@@ServerRoot@@:/usr/$(mlibdir)/apache2:g" \
96 ${SOURCEDIR}/${PNAME}/apache2.rc-${RC_VER} || die
97 }
98
99 src_compile()
100 {
101 cd ${SRCDIR}
102
103 # beware! mconfigure overwrite our layout pathes!
104 mconfigure \
105 --libexecdir=/usr/$(mlibdir)/apache2/modules \
106 --includedir=/usr/include/apache2 \
107 --datadir=/var/www \
108 --sysconfdir=/etc/apache2 \
109 --localstatedir=/var \
110 --enable-layout=Magellan \
111 --with-program-name=apache2 \
112 --with-port=80 \
113 --enable-so \
114 --enable-modules=all \
115 --enable-mods-shared=all \
116 --enable-suexec \
117 --with-suexec-safepath='/usr/local/bin:/usr/bin:/bin' \
118 --with-suexec-logfile=/var/log/apache2/suexec_log \
119 --with-suexec-bin=/usr/sbin/suexec \
120 --with-suexec-userdir=public_html \
121 --with-suexec-caller=apache \
122 --with-suexec-docroot=/var/www \
123 --with-suexec-uidmin=1000 \
124 --with-suexec-gidmin=100 \
125 --with-suexec-umask=077 \
126 --with-ssl=/usr \
127 --enable-ssl \
128 --enable-deflate \
129 --with-gdbm \
130 --with-mpm=prefork \
131 --with-pcre \
132 --with-pcre=/usr \
133 --with-perl=/usr/bin/perl \
134 --with-expat=/usr \
135 --with-z=/usr \
136 --with-apr=/usr \
137 --with-apr-util=/usr \
138 || die
139
140 # include/ap_config_auto.h is created by configure and
141 # --with-program-name renames http.conf to the given program name,
142 # but we want to use httpd.conf instead of apache2.conf
143 sed -i 's:apache2\.conf:httpd.conf:' include/ap_config_auto.h || die
144 # fix up the server root, default is $prefix but we want /usr/lib/apache2
145 sed -i "s:^\(#define HTTPD_ROOT \).*:\1\"/usr/$(mlibdir)/apache2\":" include/ap_config_auto.h || die
146 # multilib build fixes, like this one:
147 # /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
148 # /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
149 # /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
150 # /usr/lib/libexpat.so: could not read symbols: File in wrong format
151 sed -i "s:/usr/lib$:/usr/$(mlibdir):" build/config_vars.mk || die
152
153 mmake || die
154 }
155
156 src_install()
157 {
158 cd ${SRCDIR}
159 mmake DESTDIR=${BINDIR} install || die
160 minstalldocs ABOUT* CHANGES LICENSE NOTICE README* ROADMAP VERSIONING || die
161
162 # fix permissions of suexec
163 mchown root:apache /usr/sbin/suexec || die
164 mchmod 4710 /usr/sbin/suexec || die
165
166 # create some needed dirs
167 mkeepdir /etc/apache2/ssl || die
168 mkeepdir /var/lib/apache || die
169 mchown apache:apache /var/lib/apache || die
170 mkeepdir /var/lib/dav || die
171 mchown apache:apache /var/lib/dav || die
172 mkeepdir /var/log/apache2 || die
173 mchown apache:apache /var/log/apache2 || die
174 mkeepdir /var/cache/apache2/proxy || die
175 mchown apache:apache /var/cache/apache2/proxy || die
176
177 # install certificate helper
178 minstallexec -s gentestcrt.sh /usr/sbin/gentestcrt || die
179
180 # install logrotate config
181 minstalllog apache2.logrotate apache2 || die
182
183 # install the initscript
184 minstallrc apache2.rc-${RC_VER} apache2 || die
185
186 # rename apache2.conf
187 mv ${BINDIR}/etc/apache2/{apache2,httpd}.conf || die
188
189 # rename extra dir to modules.d and remove the 'httpd-'
190 # prefix from every module configuration file
191 mv ${BINDIR}/etc/apache2/{extra,modules.d} || die
192 local i
193 for i in ${BINDIR}/etc/apache2/modules.d/*
194 do
195 mv ${i} ${i/httpd-/} || die ${i}
196 done
197
198 # prune backup files
199 if [[ -d ${BINDIR}/etc/apache2/original ]]
200 then
201 rm -r ${BINDIR}/etc/apache2/original || die
202 fi
203
204 # add /var/www to CONFIG_PROTECT
205 minstalldir /etc/env.d || die
206 echo "CONFIG_PROTECT=\"/var/www\"" > ${BINDIR}/etc/env.d/30apache2 || die
207 echo "CONFIG_PROTECT_MASK=\"/var/www/manual\"" >> ${BINDIR}/etc/env.d/30apache2 || die
208 }
209
210 preinstall()
211 {
212 # adding apache user
213 ${MLIBDIR}/mgroupadd -o "-g 81" apache
214 ${MLIBDIR}/museradd -o "-u 81 -g apache -d /var/lib/apache -s /bin/false" apache
215 }
216
217 postinstall()
218 {
219 # taken from gentoo - generate a test ssl certificate
220 if [[ ! -e ${MROOT}/etc/apache2/ssl/server.crt ]]
221 then
222 [[ -d ${MROOT}/etc/apache2/ssl ]] && install -d ${MROOT}/etc/apache2/ssl
223 cd ${MROOT}/etc/apache2/ssl
224 echo
225 echo "Generating self-signed test certificate in ${MROOT}/etc/apache2/ssl ..."
226 echo
227 yes "" 2> /dev/null | ${MROOT}/usr/sbin/gentestcrt > /dev/null 2>&1
228 fi
229
230 mstartservice apache2
231 }
232
233 postremove()
234 {
235 [[ ! -f /usr/sbin/apache2 ]] && mstopservice apache2
236 }

Properties

Name Value
svn:keywords Id