Sat, 27 Oct 2012 19:16:45 +0200
Install tcpdf PDF generator to fulfill dependency of print_pdf.
1 ##
2 ## 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 ##
24 # package information
25 Name: php
26 Summary: Personal HomePage (PHP)
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: Language
33 License: PHP
34 Version: 5.4.5
35 Release: 20120800
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
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
119 # list of sources
120 Source0: http://static.php.net/www.php.net/distributions/php-%{version}.tar.bz2
121 Source1: php.ini
122 Patch0: php.patch
124 # build information
125 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, flex, bison
126 PreReq: OpenPKG, openpkg >= 20100101
127 BuildPreReq: pcre
128 PreReq: pcre
129 %if "%{with_sqlite}" == "yes"
130 BuildPreReq: sqlite
131 PreReq: sqlite
132 %endif
133 %if "%{with_mysql}" == "yes"
134 BuildPreReq: mysql
135 PreReq: mysql
136 %endif
137 %if "%{with_pgsql}" == "yes"
138 BuildPreReq: postgresql
139 PreReq: postgresql
140 %endif
141 %if "%{with_gd}" == "yes"
142 BuildPreReq: gd >= 2.0.20, jpeg, png
143 PreReq: gd >= 2.0.20, jpeg, png
144 %endif
145 %if "%{with_bdb}" == "yes"
146 BuildPreReq: db
147 PreReq: db
148 %endif
149 %if "%{with_zlib}" == "yes"
150 BuildPreReq: zlib
151 PreReq: zlib
152 %endif
153 %if "%{with_bzip2}" == "yes"
154 BuildPreReq: bzip2
155 PreReq: bzip2
156 %endif
157 %if "%{with_ssl}" == "yes"
158 BuildPreReq: openssl
159 PreReq: openssl
160 %endif
161 %if "%{with_openldap}" == "yes"
162 BuildPreReq: openldap
163 PreReq: openldap
164 %if "%{with_openldapsasl}" == "yes"
165 BuildPreReq: openldap::with_sasl = yes
166 PreReq: openldap::with_sasl = yes
167 %else
168 BuildPreReq: openldap::with_sasl = no
169 PreReq: openldap::with_sasl = no
170 %endif
171 %endif
172 %if "%{with_mm}" == "yes"
173 BuildPreReq: mm
174 PreReq: mm
175 %endif
176 %if "%{with_freetype}" == "yes"
177 BuildPreReq: freetype
178 PreReq: freetype
179 %endif
180 %if "%{with_gettext}" == "yes"
181 BuildPreReq: gettext, libiconv
182 PreReq: gettext, libiconv
183 %endif
184 %if "%{with_iconv}" == "yes"
185 BuildPreReq: libiconv
186 PreReq: libiconv
187 %endif
188 %if "%{with_imap}" == "yes"
189 BuildPreReq: imap, openssl
190 PreReq: imap, openssl
191 %endif
192 %if "%{with_xml}" == "yes"
193 BuildPreReq: libxml
194 PreReq: libxml
195 %endif
196 %if "%{with_xslt}" == "yes"
197 BuildPreReq: libxslt
198 PreReq: libxslt
199 %endif
200 %if "%{with_dom}" == "yes"
201 BuildPreReq: libxml, libxslt
202 PreReq: libxml, libxslt
203 %endif
204 %if "%{with_curl}" == "yes"
205 BuildPreReq: curl
206 PreReq: curl
207 %endif
208 %if "%{with_mhash}" == "yes"
209 BuildPreReq: mhash
210 PreReq: mhash
211 %endif
212 %if "%{with_mcrypt}" == "yes"
213 BuildPreReq: libmcrypt
214 PreReq: libmcrypt
215 %endif
216 %if "%{with_gdbm}" == "yes"
217 BuildPreReq: gdbm, gdbm::with_ndbm = yes
218 PreReq: gdbm, gdbm::with_ndbm = yes
219 %endif
220 %if "%{with_oci8}" == "yes"
221 BuildPreReq: oracle
222 PreReq: oracle
223 %endif
224 %if "%{with_snmp}" == "yes"
225 BuildPreReq: snmp
226 PreReq: snmp
227 %endif
228 %if "%{with_odbc}" == "yes"
229 BuildPreReq: unixodbc
230 PreReq: unixodbc
231 %endif
232 %if "%{with_sendmail}" == "yes"
233 BuildPreReq: MTA
234 PreReq: MTA
235 %endif
236 %if "%{with_simplexml}" == "yes"
237 BuildPreReq: libxml
238 PreReq: libxml
239 %endif
240 %if "%{with_tidy}" == "yes"
241 BuildPreReq: tidy
242 PreReq: tidy
243 %endif
245 %description
246 PHP is an HTML-embedded scripting language. Much of its syntax is
247 borrowed from C, Java and Perl with a couple of unique PHP-specific
248 features thrown in. The goal of the language is to allow web
249 developers to write dynamically generated pages quickly.
251 This is the Command Line Interface (CLI) and Common Gateway
252 Interface (CGI) version of PHP, intended for use in the "shebang"
253 line ("#!%{l_prefix}/bin/php") of stand-alone PHP based programs
254 and for use in the "shebang" line ("#!%{l_prefix}/cgi/php") of
255 stand-alone webserver-independent CGI scripts.
257 %track
258 prog php = {
259 version = %{version}
260 url = http://www.php.net/downloads.php
261 regex = php-(5\.\d+\.\d+)\.tar\.(bz2|gz)
262 }
264 %prep
265 %setup -q
266 %{l_shtool} subst \
267 -e 's;\(/include\)/freetype2;\1;' \
268 configure \
269 ext/gd/config.m4
270 %patch -p0
272 %build
273 # configure package
274 case "%{l_platform -t}" in
275 *-sunos5.10 ) cflags="%{l_cflags}" ;;
276 * ) cflags="%{l_cflags -O}" ;;
277 esac
278 cppflags="%{l_cppflags}"
279 ldflags="%{l_ldflags}"
280 libs=""
281 %if "%{with_gdbm}" == "yes"
282 libs="$libs -lndbm -lgdbm"
283 %endif
284 %if "%{with_gd}" == "yes"
285 libs="$libs -lpng -lz"
286 %endif
287 %if "%{with_gettext}" == "yes"
288 libs="$libs -liconv"
289 %endif
290 %if "%{with_openldap}" == "yes" && "%{with_openldapsasl}" == "yes"
291 libs="$libs -lsasl2"
292 %endif
293 %if "%{with_imap}" == "yes"
294 libs="$libs -lssl -lcrypto"
295 %endif
296 %if "%{with_bdb}" == "yes"
297 libs="$libs -ldb"
298 %endif
299 %if "%{with_pgsql}" == "yes"
300 libs="$libs `pg_config --libs`"
301 %endif
302 %if "%{with_oci8}" == "yes"
303 ORACLE_HOME="`%{l_rc} --query oracle_home`"
304 export ORACLE_HOME
305 %endif
306 CC="%{l_cc}" \
307 CFLAGS="$cflags" \
308 CPPFLAGS="$cppflags" \
309 LDFLAGS="$ldflags" \
310 LIBS="$libs" \
311 %if "%{with_sendmail}" == "yes"
312 PROG_SENDMAIL="%{l_prefix}/sbin/sendmail" \
313 %else
314 PROG_SENDMAIL="`%{l_shtool} path false`" \
315 %endif
316 ./configure \
317 --prefix=%{l_prefix} \
318 --sysconfdir=%{l_prefix}/etc/php \
319 --with-config-file-path=%{l_prefix}/etc/php \
320 --libdir=%{l_prefix}/lib/php \
321 --mandir=%{l_prefix}/man \
322 --disable-all \
323 --enable-pdo \
324 --enable-filter \
325 --with-pcre-regex=%{l_prefix} \
326 %if "%{with_calendar}" == "yes"
327 --enable-calendar \
328 %endif
329 %if "%{with_sqlite}" == "yes"
330 --with-sqlite3=%{l_prefix} \
331 --with-pdo-sqlite=%{l_prefix} \
332 %else
333 --without-sqlite3 \
334 --without-pdo-sqlite \
335 %endif
336 %if "%{with_mysql}" == "yes" || "%{with_mysqlnd}" == "yes"
337 %if "%{with_mysqlnd}" == "yes"
338 --with-mysql=mysqlnd \
339 --with-pdo-mysql=mysqlnd \
340 %else
341 --with-mysql=%{l_prefix} \
342 --with-pdo-mysql=%{l_prefix} \
343 %endif
344 --with-mysqli=mysqlnd \
345 --with-mysql-sock=%{l_prefix}/var/mysql/mysql.sock \
346 %else
347 --without-mysql \
348 --without-pdo-mysql \
349 %endif
350 %if "%{with_pgsql}" == "yes"
351 --with-pgsql=%{l_prefix} \
352 --with-pdo-pgsql=%{l_prefix} \
353 %else
354 --without-pgsql \
355 %endif
356 %if "%{with_posix}" == "yes"
357 --enable-posix \
358 %endif
359 %if "%{with_gd}" == "yes"
360 --with-gd=yes \
361 --with-jpeg-dir=%{l_prefix} \
362 --with-png-dir=%{l_prefix} \
363 %endif
364 %if "%{with_freetype}" == "yes"
365 --enable-gd-native-ttf \
366 --with-freetype-dir=%{l_prefix} \
367 %endif
368 %if "%{with_bdb}" == "yes"
369 --with-db4=%{l_prefix} \
370 %endif
371 %if "%{with_debug}" == "yes"
372 --enable-debug \
373 %else
374 --disable-debug \
375 %endif
376 %if "%{with_zlib}" == "yes"
377 --with-zlib=%{l_prefix} \
378 --with-zlib-dir=%{l_prefix} \
379 %endif
380 %if "%{with_bzip2}" == "yes"
381 --with-bz2=%{l_prefix} \
382 %endif
383 %if "%{with_ssl}" == "yes" || "%{with_openldap}" == "yes"
384 --with-openssl=%{l_prefix} \
385 %endif
386 %if "%{with_openldap}" == "yes"
387 --with-ldap=%{l_prefix} \
388 %endif
389 %if "%{with_session}" == "yes"
390 --enable-session \
391 %endif
392 %if "%{with_mm}" == "yes"
393 --with-mm=%{l_prefix} \
394 %endif
395 %if "%{with_ftp}" == "yes"
396 --enable-ftp \
397 %endif
398 %if "%{with_oci8}" == "yes"
399 --with-oci8 \
400 %endif
401 %if "%{with_gettext}" == "yes"
402 --with-gettext=%{l_prefix} \
403 %endif
404 %if "%{with_imap}" == "yes"
405 --with-imap=%{l_prefix} \
406 --with-imap-ssl=%{l_prefix} \
407 %endif
408 %if "%{with_json}" == "yes"
409 --enable-json \
410 %else
411 --disable-json \
412 %endif
413 %if "%{with_tokenizer}" == "yes"
414 --enable-tokenizer \
415 %else
416 --disable-tokenizer \
417 %endif
418 %if "%{with_xml}" == "yes"
419 --enable-xml \
420 --enable-xmlreader \
421 --enable-libxml \
422 --with-libxml-dir=%{l_prefix} \
423 %else
424 --disable-xml \
425 %endif
426 %if "%{with_xslt}" == "yes"
427 --with-xsl=%{l_prefix} \
428 %else
429 --without-xsl \
430 %endif
431 %if "%{with_dom}" == "yes"
432 --enable-dom \
433 %else
434 --disable-dom \
435 %endif
436 %if "%{with_wddx}" == "yes"
437 --enable-wddx \
438 %endif
439 %if "%{with_soap}" == "yes"
440 --enable-soap \
441 %endif
442 %if "%{with_bc}" == "yes"
443 --enable-bcmath \
444 %endif
445 %if "%{with_mhash}" == "yes"
446 --with-mhash=%{l_prefix} \
447 %endif
448 %if "%{with_mcrypt}" == "yes"
449 --with-mcrypt=%{l_prefix} \
450 %endif
451 %if "%{with_ctype}" == "yes"
452 --enable-ctype \
453 %endif
454 %if "%{with_curl}" == "yes"
455 --with-curl=%{l_prefix} \
456 %endif
457 %if "%{with_gdbm}" == "yes"
458 --with-gdbm=%{l_prefix} \
459 %endif
460 %if "%{with_versioning}" == "yes"
461 --enable-versioning \
462 %endif
463 %if "%{with_pear}" == "yes"
464 --with-pear=%{l_prefix}/lib/php \
465 %else
466 --without-pear \
467 %endif
468 %if "%{with_simplexml}" == "yes"
469 --enable-simplexml \
470 --enable-libxml \
471 --with-libxml-dir=%{l_prefix} \
472 %else
473 --disable-simplexml \
474 %endif
475 %if "%{with_snmp}" == "yes"
476 --with-snmp=%{l_prefix} \
477 --with-openssl-dir=%{l_prefix} \
478 %endif
479 %if "%{with_odbc}" == "yes"
480 --with-unixODBC=%{l_prefix} \
481 --with-pdo-odbc=unixODBC,%{l_prefix} \
482 %endif
483 %if "%{with_mbregex}" == "yes"
484 --enable-mbregex \
485 %endif
486 %if "%{with_mbstring}" == "yes"
487 --enable-mbstring \
488 %endif
489 %if "%{with_exif}" == "yes"
490 --with-exif \
491 %endif
492 %if "%{with_iconv}" == "yes"
493 --with-iconv=%{l_prefix} \
494 %endif
495 %if "%{with_tidy}" == "yes"
496 --with-tidy=%{l_prefix} \
497 %else
498 --without-tidy \
499 %endif
500 %if "%{with_zip}" == "yes"
501 --enable-zip \
502 %endif
503 --enable-cli \
504 --enable-cgi
506 # build package
507 %{l_make} %{l_mflags -O}
509 %install
510 # install package
511 %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
513 # move CGI executale
514 %{l_shtool} mkdir -f -p -m 755 \
515 $RPM_BUILD_ROOT%{l_prefix}/cgi
516 mv $RPM_BUILD_ROOT%{l_prefix}/bin/php-cgi \
517 $RPM_BUILD_ROOT%{l_prefix}/cgi/php
519 # install default configuration file
520 %{l_shtool} mkdir -f -p -m 755 \
521 $RPM_BUILD_ROOT%{l_prefix}/etc/php
522 %{l_shtool} install -c -m 644 %{l_value -s -a} \
523 %{SOURCE php.ini} \
524 $RPM_BUILD_ROOT%{l_prefix}/etc/php/
526 # strip down installation
527 rmdir $RPM_BUILD_ROOT%{l_prefix}/lib/php >/dev/null 2>&1 || true
528 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
530 # determine installation files
531 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
532 '%config %{l_prefix}/etc/php/*'
534 %files -f files
536 %clean