|
1 ## |
|
2 ## apache-php.spec -- OpenPKG RPM Package Specification |
|
3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
4 ## |
|
5 ## Permission to use, copy, modify, and distribute this software for |
|
6 ## any purpose with or without fee is hereby granted, provided that |
|
7 ## the above copyright notice and this permission notice appear in all |
|
8 ## copies. |
|
9 ## |
|
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
21 ## SUCH DAMAGE. |
|
22 ## |
|
23 |
|
24 # package information |
|
25 Name: apache-php |
|
26 Summary: Apache Extension: PHP Scripting Language |
|
27 URL: http://www.php.net/ |
|
28 Vendor: The PHP Project |
|
29 Packager: OpenPKG Foundation e.V. |
|
30 Distribution: OpenPKG Community |
|
31 Class: BASE |
|
32 Group: Web |
|
33 License: PHP |
|
34 Version: 5.4.5 |
|
35 Release: 20120723 |
|
36 |
|
37 # package options |
|
38 %option with_bc no |
|
39 %option with_bdb no |
|
40 %option with_bzip2 no |
|
41 %option with_calendar no |
|
42 %option with_ctype no |
|
43 %option with_curl no |
|
44 %option with_debug no |
|
45 %option with_dom no |
|
46 %option with_exif no |
|
47 %option with_freetype no |
|
48 %option with_ftp no |
|
49 %option with_gd no |
|
50 %option with_gdbm no |
|
51 %option with_gettext no |
|
52 %option with_iconv no |
|
53 %option with_imap no |
|
54 %option with_json no |
|
55 %option with_tokenizer no |
|
56 %option with_mbregex no |
|
57 %option with_mbstring no |
|
58 %option with_mcrypt no |
|
59 %option with_mhash no |
|
60 %option with_mm no |
|
61 %option with_mysql no |
|
62 %option with_mysqlnd no |
|
63 %option with_oci8 no |
|
64 %option with_odbc no |
|
65 %option with_openldap no |
|
66 %option with_openldapsasl no |
|
67 %option with_pear no |
|
68 %option with_pgsql no |
|
69 %option with_posix no |
|
70 %option with_sendmail no |
|
71 %option with_session no |
|
72 %option with_simplexml no |
|
73 %option with_snmp no |
|
74 %option with_soap no |
|
75 %option with_sqlite no |
|
76 %option with_ssl no |
|
77 %option with_tidy no |
|
78 %option with_versioning no |
|
79 %option with_wddx no |
|
80 %option with_xml no |
|
81 %option with_xslt no |
|
82 %option with_zlib no |
|
83 %option with_zip no |
|
84 |
|
85 # fixing implicit extension dependencies and correlations |
|
86 %if "%{with_mm}" == "yes" |
|
87 %undefine with_session |
|
88 %define with_session yes |
|
89 %endif |
|
90 %if "%{with_pear}" == "yes" |
|
91 %undefine with_xml |
|
92 %define with_xml yes |
|
93 %endif |
|
94 %if "%{with_freetype}" == "yes" |
|
95 %undefine with_gd |
|
96 %define with_gd yes |
|
97 %endif |
|
98 %if "%{with_mysql}" == "yes" || "%{with_gd}" == "yes" || "%{with_dom}" == "yes" || "%{with_zip}" == "yes" |
|
99 %undefine with_zlib |
|
100 %define with_zlib yes |
|
101 %endif |
|
102 %if "%{with_xslt}" == "yes" |
|
103 %undefine with_dom |
|
104 %define with_dom yes |
|
105 %endif |
|
106 %if "%{with_dom}" == "yes" |
|
107 %undefine with_xml |
|
108 %define with_xml yes |
|
109 %endif |
|
110 %if "%{with_soap}" == "yes" |
|
111 %undefine with_xml |
|
112 %define with_xml yes |
|
113 %endif |
|
114 %if "%{with_pgsql}" == "yes" |
|
115 %undefine with_ssl |
|
116 %define with_ssl yes |
|
117 %endif |
|
118 |
|
119 # list of sources |
|
120 Source0: http://static.php.net/www.php.net/distributions/php-%{version}.tar.bz2 |
|
121 Source1: apache-php.ini |
|
122 Source2: apache-php.conf |
|
123 Patch0: apache-php.patch |
|
124 |
|
125 # build information |
|
126 BuildPreReq: OpenPKG, openpkg >= 20120101, gcc, flex, bison |
|
127 PreReq: OpenPKG, openpkg >= 20120101 |
|
128 BuildPreReq: apache |
|
129 PreReq: apache |
|
130 BuildPreReq: pcre |
|
131 PreReq: pcre |
|
132 %if "%{with_sqlite}" == "yes" |
|
133 BuildPreReq: sqlite |
|
134 PreReq: sqlite |
|
135 %endif |
|
136 %if "%{with_mysql}" == "yes" |
|
137 BuildPreReq: mysql |
|
138 PreReq: mysql |
|
139 %endif |
|
140 %if "%{with_pgsql}" == "yes" |
|
141 BuildPreReq: postgresql |
|
142 PreReq: postgresql |
|
143 %endif |
|
144 %if "%{with_gd}" == "yes" |
|
145 BuildPreReq: gd >= 2.0.20, jpeg, png |
|
146 PreReq: gd >= 2.0.20, jpeg, png |
|
147 %endif |
|
148 %if "%{with_bdb}" == "yes" |
|
149 BuildPreReq: db |
|
150 PreReq: db |
|
151 %endif |
|
152 %if "%{with_zlib}" == "yes" |
|
153 BuildPreReq: zlib |
|
154 PreReq: zlib |
|
155 %endif |
|
156 %if "%{with_bzip2}" == "yes" |
|
157 BuildPreReq: bzip2 |
|
158 PreReq: bzip2 |
|
159 %endif |
|
160 %if "%{with_ssl}" == "yes" |
|
161 BuildPreReq: openssl |
|
162 PreReq: openssl |
|
163 %endif |
|
164 %if "%{with_openldap}" == "yes" |
|
165 BuildPreReq: openldap |
|
166 PreReq: openldap |
|
167 %if "%{with_openldapsasl}" == "yes" |
|
168 BuildPreReq: openldap::with_sasl = yes |
|
169 PreReq: openldap::with_sasl = yes |
|
170 %else |
|
171 BuildPreReq: openldap::with_sasl = no |
|
172 PreReq: openldap::with_sasl = no |
|
173 %endif |
|
174 %endif |
|
175 %if "%{with_mm}" == "yes" |
|
176 BuildPreReq: mm |
|
177 PreReq: mm |
|
178 %endif |
|
179 %if "%{with_freetype}" == "yes" |
|
180 BuildPreReq: freetype |
|
181 PreReq: freetype |
|
182 %endif |
|
183 %if "%{with_gettext}" == "yes" |
|
184 BuildPreReq: gettext, libiconv |
|
185 PreReq: gettext, libiconv |
|
186 %endif |
|
187 %if "%{with_iconv}" == "yes" |
|
188 BuildPreReq: libiconv |
|
189 PreReq: libiconv |
|
190 %endif |
|
191 %if "%{with_imap}" == "yes" |
|
192 BuildPreReq: imap, openssl |
|
193 PreReq: imap, openssl |
|
194 %endif |
|
195 %if "%{with_xml}" == "yes" |
|
196 BuildPreReq: libxml |
|
197 PreReq: libxml |
|
198 %endif |
|
199 %if "%{with_xslt}" == "yes" |
|
200 BuildPreReq: libxslt |
|
201 PreReq: libxslt |
|
202 %endif |
|
203 %if "%{with_dom}" == "yes" |
|
204 BuildPreReq: libxml, libxslt |
|
205 PreReq: libxml, libxslt |
|
206 %endif |
|
207 %if "%{with_curl}" == "yes" |
|
208 BuildPreReq: curl |
|
209 PreReq: curl |
|
210 %endif |
|
211 %if "%{with_mhash}" == "yes" |
|
212 BuildPreReq: mhash |
|
213 PreReq: mhash |
|
214 %endif |
|
215 %if "%{with_mcrypt}" == "yes" |
|
216 BuildPreReq: libmcrypt |
|
217 PreReq: libmcrypt |
|
218 %endif |
|
219 %if "%{with_gdbm}" == "yes" |
|
220 BuildPreReq: gdbm, gdbm::with_ndbm = yes |
|
221 PreReq: gdbm, gdbm::with_ndbm = yes |
|
222 %endif |
|
223 %if "%{with_oci8}" == "yes" |
|
224 BuildPreReq: oracle |
|
225 PreReq: oracle |
|
226 %endif |
|
227 %if "%{with_snmp}" == "yes" |
|
228 BuildPreReq: snmp |
|
229 PreReq: snmp |
|
230 %endif |
|
231 %if "%{with_odbc}" == "yes" |
|
232 BuildPreReq: unixodbc |
|
233 PreReq: unixodbc |
|
234 %endif |
|
235 %if "%{with_sendmail}" == "yes" |
|
236 BuildPreReq: MTA |
|
237 PreReq: MTA |
|
238 %endif |
|
239 %if "%{with_simplexml}" == "yes" |
|
240 BuildPreReq: libxml |
|
241 PreReq: libxml |
|
242 %endif |
|
243 %if "%{with_tidy}" == "yes" |
|
244 BuildPreReq: tidy |
|
245 PreReq: tidy |
|
246 %endif |
|
247 |
|
248 %description |
|
249 PHP is an HTML-embedded scripting language. Much of its syntax is |
|
250 borrowed from C, Java and Perl with a couple of unique PHP-specific |
|
251 features thrown in. The goal of the language is to allow web |
|
252 developers to write dynamically generated pages quickly. |
|
253 |
|
254 This package provides a Dynamic Shared Object (DSO) for the Apache |
|
255 HTTP 2.2 web server. In general speaking, this module is also known |
|
256 as mod_php. |
|
257 |
|
258 %track |
|
259 prog apache-php = { |
|
260 version = %{version} |
|
261 url = http://www.php.net/downloads.php |
|
262 regex = php-(5\.\d+\.\d+)\.tar\.(bz2|gz) |
|
263 } |
|
264 |
|
265 %prep |
|
266 %setup -q -n php-%{version} |
|
267 %{l_shtool} subst \ |
|
268 -e 's;-i -a -n php5;-i -n php5;' \ |
|
269 configure |
|
270 %{l_shtool} subst \ |
|
271 -e 's;\(/include\)/freetype2;\1;' \ |
|
272 configure \ |
|
273 ext/gd/config.m4 |
|
274 %patch -p0 |
|
275 |
|
276 %build |
|
277 # configure package |
|
278 case "%{l_platform -t}" in |
|
279 *-sunos5.10 ) cflags="%{l_cflags}" ;; |
|
280 * ) cflags="%{l_cflags -O}" ;; |
|
281 esac |
|
282 cppflags="%{l_cppflags}" |
|
283 ldflags="%{l_ldflags}" |
|
284 libs="" |
|
285 %if "%{with_gdbm}" == "yes" |
|
286 libs="$libs -lndbm -lgdbm" |
|
287 %endif |
|
288 %if "%{with_gd}" == "yes" |
|
289 libs="$libs -lpng -lz" |
|
290 %endif |
|
291 %if "%{with_gettext}" == "yes" |
|
292 libs="$libs -liconv" |
|
293 %endif |
|
294 %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes" |
|
295 libs="$libs -lsasl2" |
|
296 %endif |
|
297 %if "%{with_imap}" == "yes" |
|
298 libs="$libs -lssl -lcrypto" |
|
299 %endif |
|
300 %if "%{with_bdb}" == "yes" |
|
301 libs="$libs -ldb" |
|
302 %endif |
|
303 %if "%{with_pgsql}" == "yes" |
|
304 libs="$libs `pg_config --libs`" |
|
305 %endif |
|
306 %if "%{with_oci8}" == "yes" |
|
307 ORACLE_HOME="`%{l_rc} --query oracle_home`" |
|
308 export ORACLE_HOME |
|
309 %endif |
|
310 CC="%{l_cc}" \ |
|
311 CFLAGS="$cflags" \ |
|
312 CPPFLAGS="$cppflags" \ |
|
313 LDFLAGS="$ldflags" \ |
|
314 LIBS="$libs" \ |
|
315 %if "%{with_sendmail}" == "yes" |
|
316 PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \ |
|
317 %else |
|
318 PROG_SENDMAIL="`%{l_shtool} path false`" \ |
|
319 %endif |
|
320 ./configure \ |
|
321 --prefix=%{l_prefix} \ |
|
322 --sysconfdir=%{l_prefix}/etc/apache \ |
|
323 --with-config-file-path=%{l_prefix}/etc/apache \ |
|
324 --libdir=%{l_prefix}/lib/php \ |
|
325 --disable-all \ |
|
326 --enable-pdo \ |
|
327 --enable-filter \ |
|
328 --with-pcre-regex=%{l_prefix} \ |
|
329 %if "%{with_calendar}" == "yes" |
|
330 --enable-calendar \ |
|
331 %endif |
|
332 %if "%{with_sqlite}" == "yes" |
|
333 --with-sqlite3=%{l_prefix} \ |
|
334 --with-pdo-sqlite=%{l_prefix} \ |
|
335 %else |
|
336 --without-pdo-sqlite \ |
|
337 %endif |
|
338 %if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes" |
|
339 %if "%{with_mysqlnd}" == "yes" |
|
340 --with-mysql=mysqlnd \ |
|
341 --with-pdo-mysql=mysqlnd \ |
|
342 %else |
|
343 --with-mysql=%{l_prefix} \ |
|
344 --with-pdo-mysql=%{l_prefix} \ |
|
345 %endif |
|
346 --with-mysqli=mysqlnd \ |
|
347 --with-mysql-sock=%{l_prefix}/var/mysql/mysql.sock \ |
|
348 %else |
|
349 --without-mysql \ |
|
350 --without-pdo-mysql \ |
|
351 %endif |
|
352 %if "%{with_pgsql}" == "yes" |
|
353 --with-pgsql=%{l_prefix} \ |
|
354 --with-pdo-pgsql=%{l_prefix} \ |
|
355 %else |
|
356 --without-pgsql \ |
|
357 %endif |
|
358 %if "%{with_posix}" == "yes" |
|
359 --enable-posix \ |
|
360 %endif |
|
361 %if "%{with_gd}" == "yes" |
|
362 --with-gd=yes \ |
|
363 --with-jpeg-dir=%{l_prefix} \ |
|
364 --with-png-dir=%{l_prefix} \ |
|
365 %endif |
|
366 %if "%{with_freetype}" == "yes" |
|
367 --enable-gd-native-ttf \ |
|
368 --with-freetype-dir=%{l_prefix} \ |
|
369 %endif |
|
370 %if "%{with_bdb}" == "yes" |
|
371 --with-db4=%{l_prefix} \ |
|
372 %endif |
|
373 %if "%{with_debug}" == "yes" |
|
374 --enable-debug \ |
|
375 %else |
|
376 --disable-debug \ |
|
377 %endif |
|
378 %if "%{with_zlib}" == "yes" |
|
379 --with-zlib=%{l_prefix} \ |
|
380 --with-zlib-dir=%{l_prefix} \ |
|
381 %endif |
|
382 %if "%{with_bzip2}" == "yes" |
|
383 --with-bz2=%{l_prefix} \ |
|
384 %endif |
|
385 %if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes" |
|
386 --with-openssl=%{l_prefix} \ |
|
387 %endif |
|
388 %if "%{with_openldap}" == "yes" |
|
389 --with-ldap=%{l_prefix} \ |
|
390 %endif |
|
391 %if "%{with_session}" == "yes" |
|
392 --enable-session \ |
|
393 %endif |
|
394 %if "%{with_mm}" == "yes" |
|
395 --with-mm=%{l_prefix} \ |
|
396 %endif |
|
397 %if "%{with_ftp}" == "yes" |
|
398 --enable-ftp \ |
|
399 %endif |
|
400 %if "%{with_oci8}" == "yes" |
|
401 --with-oci8 \ |
|
402 %endif |
|
403 %if "%{with_gettext}" == "yes" |
|
404 --with-gettext=%{l_prefix} \ |
|
405 %endif |
|
406 %if "%{with_imap}" == "yes" |
|
407 --with-imap=%{l_prefix} \ |
|
408 --with-imap-ssl=%{l_prefix} \ |
|
409 %endif |
|
410 %if "%{with_json}" == "yes" |
|
411 --enable-json \ |
|
412 %else |
|
413 --disable-json \ |
|
414 %endif |
|
415 %if "%{with_tokenizer}" == "yes" |
|
416 --enable-tokenizer \ |
|
417 %else |
|
418 --disable-tokenizer \ |
|
419 %endif |
|
420 %if "%{with_xml}" == "yes" |
|
421 --enable-xml \ |
|
422 --enable-xmlreader \ |
|
423 --enable-libxml \ |
|
424 --with-libxml-dir=%{l_prefix} \ |
|
425 %else |
|
426 --disable-xml \ |
|
427 %endif |
|
428 %if "%{with_xslt}" == "yes" |
|
429 --with-xsl=%{l_prefix} \ |
|
430 %else |
|
431 --without-xsl \ |
|
432 %endif |
|
433 %if "%{with_dom}" == "yes" |
|
434 --enable-dom \ |
|
435 %else |
|
436 --disable-dom \ |
|
437 %endif |
|
438 %if "%{with_wddx}" == "yes" |
|
439 --enable-wddx \ |
|
440 %endif |
|
441 %if "%{with_soap}" == "yes" |
|
442 --enable-soap \ |
|
443 %endif |
|
444 %if "%{with_bc}" == "yes" |
|
445 --enable-bcmath \ |
|
446 %endif |
|
447 %if "%{with_mhash}" == "yes" |
|
448 --with-mhash=%{l_prefix} \ |
|
449 %endif |
|
450 %if "%{with_mcrypt}" == "yes" |
|
451 --with-mcrypt=%{l_prefix} \ |
|
452 %endif |
|
453 %if "%{with_ctype}" == "yes" |
|
454 --enable-ctype \ |
|
455 %endif |
|
456 %if "%{with_curl}" == "yes" |
|
457 --with-curl=%{l_prefix} \ |
|
458 %endif |
|
459 %if "%{with_gdbm}" == "yes" |
|
460 --with-gdbm=%{l_prefix} \ |
|
461 %endif |
|
462 %if "%{with_versioning}" == "yes" |
|
463 --enable-versioning \ |
|
464 %endif |
|
465 %if "%{with_pear}" == "yes" |
|
466 --with-pear=%{l_prefix}/lib/php \ |
|
467 %else |
|
468 --without-pear \ |
|
469 %endif |
|
470 %if "%{with_simplexml}" == "yes" |
|
471 --enable-simplexml \ |
|
472 --enable-libxml \ |
|
473 --with-libxml-dir=%{l_prefix} \ |
|
474 %else |
|
475 --disable-simplexml \ |
|
476 %endif |
|
477 %if "%{with_snmp}" == "yes" |
|
478 --with-snmp=%{l_prefix} \ |
|
479 --with-openssl-dir=%{l_prefix} \ |
|
480 %endif |
|
481 %if "%{with_odbc}" == "yes" |
|
482 --with-unixODBC=%{l_prefix} \ |
|
483 --with-pdo-odbc=unixODBC,%{l_prefix} \ |
|
484 %endif |
|
485 %if "%{with_mbregex}" == "yes" |
|
486 --enable-mbregex \ |
|
487 %endif |
|
488 %if "%{with_mbstring}" == "yes" |
|
489 --enable-mbstring \ |
|
490 %endif |
|
491 %if "%{with_exif}" == "yes" |
|
492 --with-exif \ |
|
493 %endif |
|
494 %if "%{with_iconv}" == "yes" |
|
495 --with-iconv=%{l_prefix} \ |
|
496 %endif |
|
497 %if "%{with_tidy}" == "yes" |
|
498 --with-tidy=%{l_prefix} \ |
|
499 %else |
|
500 --without-tidy \ |
|
501 %endif |
|
502 %if "%{with_zip}" == "yes" |
|
503 --enable-zip \ |
|
504 %endif |
|
505 --with-apxs2=%{l_prefix}/sbin/apxs \ |
|
506 --disable-cli \ |
|
507 --disable-cgi |
|
508 |
|
509 # build package |
|
510 %{l_make} %{l_mflags} |
|
511 |
|
512 %install |
|
513 # install package |
|
514 %{l_make} %{l_mflags} install-sapi INSTALL_ROOT=$RPM_BUILD_ROOT |
|
515 mv $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/libphp5.so \ |
|
516 $RPM_BUILD_ROOT%{l_prefix}/libexec/apache/mod_php.so |
|
517 |
|
518 # install default configuration file |
|
519 %{l_shtool} mkdir -f -p -m 755 \ |
|
520 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d |
|
521 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
522 %{SOURCE apache-php.ini} \ |
|
523 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/ |
|
524 %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
|
525 %{SOURCE apache-php.conf} \ |
|
526 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/ |
|
527 |
|
528 # create session storage directory |
|
529 %if "%{with_session}" == "yes" |
|
530 %{l_shtool} mkdir -f -p -m 755 \ |
|
531 $RPM_BUILD_ROOT%{l_prefix}/var/apache/run/apache-php.session |
|
532 %endif |
|
533 |
|
534 # determine installation files |
|
535 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
|
536 %if "%{with_session}" == "yes" |
|
537 '%attr(0750,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/apache/run/apache-php.session' \ |
|
538 %endif |
|
539 '%config %{l_prefix}/etc/apache/apache-php.ini' \ |
|
540 '%config %{l_prefix}/etc/apache/apache.d/apache-php.conf' |
|
541 |
|
542 %files -f files |
|
543 |
|
544 %clean |
|
545 |
|
546 %post |
|
547 # after upgrade, restart service |
|
548 [ $1 -eq 2 ] || exit 0 |
|
549 eval `%{l_rc} apache status 2>/dev/null` |
|
550 [ ".$apache_active" = .yes ] && %{l_rc} apache restart |
|
551 exit 0 |
|
552 |