Annotation of /branches/R11-stable/extras/php/php-5.4.19-r1.smage2
Parent Directory | Revision Log
Revision 19541 -
(hide annotations)
(download)
Thu Sep 19 13:19:51 2013 UTC (11 years ago) by niro
Original Path: trunk/extras/php/php-5.4.19-r1.smage2
File size: 17524 byte(s)
Thu Sep 19 13:19:51 2013 UTC (11 years ago) by niro
Original Path: trunk/extras/php/php-5.4.19-r1.smage2
File size: 17524 byte(s)
-revert changes, use a patch
1 | niro | 19539 | # $Id$ |
2 | |||
3 | PNAME="php" | ||
4 | PVER="5.4.19" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | SPLIT_PACKAGES="php | ||
8 | php-cgi | ||
9 | php-apache | ||
10 | php-fpm | ||
11 | php-embedded | ||
12 | php-pear | ||
13 | php-bcmath | ||
14 | php-curl | ||
15 | php-dba | ||
16 | php-enchant | ||
17 | php-gd | ||
18 | php-gmp | ||
19 | php-intl | ||
20 | php-ldap | ||
21 | php-mbstring | ||
22 | php-pdo | ||
23 | php-mysql | ||
24 | php-odbc | ||
25 | php-process | ||
26 | php-pspell | ||
27 | php-soap | ||
28 | php-sqlite | ||
29 | php-tidy | ||
30 | php-xml | ||
31 | php-xmlrpc" | ||
32 | |||
33 | # splits with more then one module: | ||
34 | # php-odbc = odbc, pdo_odbc | ||
35 | # php-mysql = mysql, mysqli, pdo_mysql | ||
36 | # php-xml = xsl, wddx, dom, xmlreader, xmlwriter | ||
37 | # php-process = sysvmsg, sysvsem, sysvshm, posix | ||
38 | # php-sqlite = sqlite, sqlite3, pdo_sqlite | ||
39 | # | ||
40 | # todo: mssql -> requires freetds | ||
41 | # mcrypt -> requires libmcrypt | ||
42 | |||
43 | PCAT="dev-lang" | ||
44 | HOMEPAGE="http://php.net/" | ||
45 | |||
46 | DEPEND_COMMON=">= sys-libs/ncurses-5.9 | ||
47 | >= sys-libs/readline-6.2 | ||
48 | >= sys-libs/zlib-1.2 | ||
49 | >= app-arch/bzip2-1 | ||
50 | >= dev-libs/openssl-1.0.0e" | ||
51 | DEPEND_APACHE=">= net-www/apache2-2.4" | ||
52 | DEPEND_ASPELL=">= app-text/aspell-0.60" | ||
53 | DEPEND_BDB=">= dev-db/db-6.0" | ||
54 | DEPEND_CURL=">= net-misc/curl-7.24" | ||
55 | DEPEND_ENCHANT=">= app-text/enchant-1.6" | ||
56 | DEPEND_GD=">= media-libs/libjpeg-8d | ||
57 | >= media-libs/libpng-1.5 | ||
58 | >= x11-libs/libXpm-4 | ||
59 | >= media-libs/freetype-2.4 | ||
60 | >= media-libs/gd-2.0.35 | ||
61 | >= media-libs/t1lib-5.1" | ||
62 | DEPEND_GMP=">= dev-libs/gmp-5" | ||
63 | DEPEND_INTL=">= dev-libs/icu-50 | ||
64 | >= sys-libs/libgcc-4.7" | ||
65 | DEPEND_LDAP=">= net-nds/libldap-2.4" | ||
66 | DEPEND_MYSQL=">= dev-db/mysql-5.5" | ||
67 | DEPEND_ODBC=">= dev-db/unixodbc-2.3" | ||
68 | DEPEND_PCRE=">= dev-libs/libpcre-8.33" | ||
69 | DEPEMD_SASL=">= dev-libs/cyrus-sasl-2.1.23" | ||
70 | DEPEND_SQLITE=">= dev-db/sqlite-3.7" | ||
71 | DEPEND_TIDY=">= app-text/htmltidy-1.46" | ||
72 | DEPEND_XML=">= dev-libs/libxml2-2.7" | ||
73 | DEPEND_XSLT=">= dev-libs/libxslt-1.1.26" | ||
74 | DEPEND_SYSTEMD=">= sys-apps/systemd-204" | ||
75 | |||
76 | # ToDO: mcrypt, imap, mhash, maintainer-zts, intl | ||
77 | SDEPEND="${DEPEND_COMMON} | ||
78 | ${DEPEND_APACHE} | ||
79 | ${DEPEND_ASPELL} | ||
80 | ${DEPEND_BDB} | ||
81 | ${DEPEND_CURL} | ||
82 | ${DEPEND_ENCHANT} | ||
83 | ${DEPEND_GD} | ||
84 | ${DEPEND_GMP} | ||
85 | ${DEPEND_INTL} | ||
86 | ${DEPEND_LDAP} | ||
87 | ${DEPEND_MYSQL} | ||
88 | ${DEPEND_ODBC} | ||
89 | ${DEPEND_PCRE} | ||
90 | ${DEPEND_SASL} | ||
91 | ${DEPEND_SQLITE} | ||
92 | ${DEPEND_TIDY} | ||
93 | ${DEPEND_XML} | ||
94 | ${DEPEND_XSLT} | ||
95 | ${DEPEND_SYSTEMD} | ||
96 | >= sys-dev/m4-1.4 | ||
97 | >= sys-dev/libtool-1.5 | ||
98 | >= sys-dev/gettext-0.17 | ||
99 | >= virtual/sed" | ||
100 | |||
101 | SRCFILE="${PNAME/5/}-${PVER}.tar.bz2" | ||
102 | SRCDIR="${BUILDDIR}/${PNAME/5/}-${PVER}" | ||
103 | |||
104 | sminclude mtools php | ||
105 | msetfeature "!check" # no check target | ||
106 | |||
107 | SRC_URI=( | ||
108 | http://de2.php.net/distributions/${SRCFILE} | ||
109 | http://us2.php.net/distributions/${SRCFILE} | ||
110 | mirror://${PNAME}/${SRCFILE} | ||
111 | niro | 19541 | mirror://${PNAME}/${PNAME}-${PVER}-db6.patch |
112 | niro | 19539 | mirror://${PNAME}/${PNAME}-5.2.4-multilib.patch |
113 | mirror://${PNAME}/${PNAME}-5.2.3-httpd-config.patch | ||
114 | mirror://${PNAME}/php5_module.conf | ||
115 | mirror://${PNAME}/php-fpm.conf | ||
116 | mirror://${PNAME}/php-fpm-www.conf | ||
117 | mirror://${PNAME}/php-fpm.service | ||
118 | mirror://${PNAME}/php-fpm.logrotate | ||
119 | mirror://${PNAME}/php-fpm.confd | ||
120 | mirror://${PNAME}/php-fpm.tmpfilesd | ||
121 | ) | ||
122 | |||
123 | # 5.4 stable series | ||
124 | UP2TAG="5.4" | ||
125 | UP2DATE="updatecmd ${HOMEPAGE} | grep 'Current.*${UP2TAG}.*Stable' | sed 's/.*\:\ \(.*\)/\1/'" | ||
126 | |||
127 | split_info_php() | ||
128 | { | ||
129 | DESCRIPTION="PHP Hypertext Preprocessor, a scripting language especially suited for web development." | ||
130 | DEPEND="${DEPEND_COMMON} | ||
131 | ${DEPEND_XML} | ||
132 | ${DEPEND_PCRE} | ||
133 | ${DEPEND_SYSTEMD}" | ||
134 | } | ||
135 | |||
136 | split_info_php-cgi() | ||
137 | { | ||
138 | DESCRIPTION="GI and FCGI SAPI for PHP." | ||
139 | DEPEND="== dev-lang/php-${PVER} | ||
140 | ${DEPEND_XML} | ||
141 | ${DEPEND_PCRE}" | ||
142 | PCAT="dev-php" | ||
143 | } | ||
144 | |||
145 | split_info_php-apache() | ||
146 | { | ||
147 | DESCRIPTION="Apache SAPI for PHP." | ||
148 | DEPEND="== dev-lang/php-${PVER} | ||
149 | ${DEPEND_XML} | ||
150 | ${DEPEND_PCRE} | ||
151 | ${DEPEND_APACHE}" | ||
152 | PCAT="dev-php" | ||
153 | } | ||
154 | |||
155 | split_info_php-embedded() | ||
156 | { | ||
157 | DESCRIPTION="PHP library for embedding in applications." | ||
158 | DEPEND="== dev-lang/php-${PVER} | ||
159 | ${DEPEND_XML} | ||
160 | ${DEPEND_PCRE}" | ||
161 | PCAT="dev-php" | ||
162 | } | ||
163 | |||
164 | split_info_php-pear() | ||
165 | { | ||
166 | DESCRIPTION="PHP Extension and Application Repository." | ||
167 | DEPEND="== dev-lang/php-${PVER}" | ||
168 | PCAT="dev-php" | ||
169 | } | ||
170 | |||
171 | split_info_php-fpm() | ||
172 | { | ||
173 | DESCRIPTION="PHP FastCGI Process Manager." | ||
174 | DEPEND="== dev-lang/php-${PVER} | ||
175 | ${DEPEND_SYSTEMD}" | ||
176 | PCAT="dev-php" | ||
177 | } | ||
178 | |||
179 | split_info_php-bcmath() | ||
180 | { | ||
181 | DESCRIPTION="A module for PHP applications for using the bcmath library." | ||
182 | DEPEND="== dev-lang/php-${PVER}" | ||
183 | PCAT="dev-php" | ||
184 | } | ||
185 | |||
186 | split_info_php-curl() | ||
187 | { | ||
188 | DESCRIPTION="A module for PHP applications that use curl." | ||
189 | DEPEND="== dev-lang/php-${PVER} | ||
190 | ${DEPEND_CURL}" | ||
191 | PCAT="dev-php" | ||
192 | } | ||
193 | |||
194 | split_info_php-dba() | ||
195 | { | ||
196 | DESCRIPTION="A database abstraction layer module for PHP applications." | ||
197 | DEPEND="== dev-lang/php-${PVER}" | ||
198 | PCAT="dev-php" | ||
199 | } | ||
200 | |||
201 | split_info_php-enchant() | ||
202 | { | ||
203 | DESCRIPTION="Human Language and Character Encoding Support." | ||
204 | DEPEND="== dev-lang/php-${PVER} | ||
205 | ${DEPEND_ENCHANT}" | ||
206 | PCAT="dev-php" | ||
207 | } | ||
208 | |||
209 | split_info_php-gd() | ||
210 | { | ||
211 | DESCRIPTION="A module for PHP applications for using the gd graphics library." | ||
212 | DEPEND="== dev-lang/php-${PVER} | ||
213 | ${DEPEND_GD}" | ||
214 | PCAT="dev-php" | ||
215 | } | ||
216 | |||
217 | split_info_php-gmp() | ||
218 | { | ||
219 | DESCRIPTION="A module for PHP applications for using the gmp library." | ||
220 | DEPEND="== dev-lang/php-${PVER} | ||
221 | ${DEPEND_GMP}" | ||
222 | PCAT="dev-php" | ||
223 | } | ||
224 | |||
225 | split_info_php-intl() | ||
226 | { | ||
227 | DESCRIPTION="Internationalization extension for PHP applications." | ||
228 | DEPEND="== dev-lang/php-${PVER} | ||
229 | ${DEPEND_INTL}" | ||
230 | PCAT="dev-php" | ||
231 | } | ||
232 | |||
233 | split_info_php-ldap() | ||
234 | { | ||
235 | DESCRIPTION="A module for PHP applications that use LDAP." | ||
236 | DEPEND="== dev-lang/php-${PVER} | ||
237 | ${DEPEND_SASL} | ||
238 | ${DEPEND_LDAP}" | ||
239 | PCAT="dev-php" | ||
240 | } | ||
241 | |||
242 | split_info_php-mbstring() | ||
243 | { | ||
244 | DESCRIPTION="A module for PHP applications which need multi-byte string handling." | ||
245 | DEPEND="== dev-lang/php-${PVER}" | ||
246 | PCAT="dev-php" | ||
247 | } | ||
248 | |||
249 | split_info_php-mysql() | ||
250 | { | ||
251 | DESCRIPTION="Modules for PHP applications that use MySQL databases." | ||
252 | DEPEND="== dev-lang/php-${PVER} | ||
253 | == dev-php/php-pdo-${PVER} | ||
254 | ${DEPEND_MYSQL}" | ||
255 | PCAT="dev-php" | ||
256 | } | ||
257 | |||
258 | split_info_php-odbc() | ||
259 | { | ||
260 | DESCRIPTION="Modules for PHP applications that use ODBC databases." | ||
261 | DEPEND="== dev-lang/php-${PVER} | ||
262 | == dev-php/php-pdo-${PVER} | ||
263 | ${DEPEND_ODBC}" | ||
264 | PCAT="dev-php" | ||
265 | } | ||
266 | |||
267 | split_info_php-pdo() | ||
268 | { | ||
269 | DESCRIPTION="A database access abstraction module for PHP applications." | ||
270 | DEPEND="== dev-lang/php-${PVER}" | ||
271 | PCAT="dev-php" | ||
272 | } | ||
273 | |||
274 | split_info_php-process() | ||
275 | { | ||
276 | DESCRIPTION="Modules for PHP script using system process interfaces." | ||
277 | DEPEND="== dev-lang/php-${PVER}" | ||
278 | PCAT="dev-php" | ||
279 | } | ||
280 | |||
281 | split_info_php-pspell() | ||
282 | { | ||
283 | DESCRIPTION="A module for PHP applications for using pspell interfaces." | ||
284 | DEPEND="== dev-lang/php-${PVER} | ||
285 | ${DEPEND_ASPELL}" | ||
286 | PCAT="dev-php" | ||
287 | } | ||
288 | |||
289 | split_info_php-soap() | ||
290 | { | ||
291 | DESCRIPTION="A module for PHP applications that use the SOAP protocol." | ||
292 | DEPEND="== dev-lang/php-${PVER} | ||
293 | ${DEPEND_XML}" | ||
294 | PCAT="dev-php" | ||
295 | } | ||
296 | |||
297 | split_info_php-sqlite() | ||
298 | { | ||
299 | DESCRIPTION="Modules for PHP applications that use SQLite databases." | ||
300 | DEPEND="== dev-lang/php-${PVER} | ||
301 | == dev-php/php-pdo-${PVER} | ||
302 | ${DEPEND_SQLITE}" | ||
303 | PCAT="dev-php" | ||
304 | } | ||
305 | |||
306 | split_info_php-tidy() | ||
307 | { | ||
308 | DESCRIPTION="Standard PHP module provides tidy library support." | ||
309 | DEPEND="== dev-lang/php-${PVER} | ||
310 | ${DEPEND_TIDY}" | ||
311 | PCAT="dev-php" | ||
312 | } | ||
313 | |||
314 | split_info_php-xml() | ||
315 | { | ||
316 | DESCRIPTION="Modules for PHP applications which use XML." | ||
317 | DEPEND="== dev-lang/php-${PVER} | ||
318 | ${DEPEND_XML} | ||
319 | ${DEPEND_XSLT}" | ||
320 | PCAT="dev-php" | ||
321 | } | ||
322 | |||
323 | split_info_php-xmlrpc() | ||
324 | { | ||
325 | DESCRIPTION="A module for PHP applications which use the XML-RPC protocol." | ||
326 | DEPEND="== dev-lang/php-${PVER} | ||
327 | ${DEPEND_XML}" | ||
328 | PCAT="dev-php" | ||
329 | } | ||
330 | |||
331 | # install-helper function | ||
332 | install_php_extensions() | ||
333 | { | ||
334 | local extensions="$@" | ||
335 | [[ -z ${extensions} ]] && die "no extensions given" | ||
336 | |||
337 | # set default PHP_BUILD_DIR, env can override this | ||
338 | : ${PHP_BUILD_DIR="${BUILDDIR}/build-php"} | ||
339 | |||
340 | cd ${PHP_BUILD_DIR} | ||
341 | |||
342 | # needed directories | ||
343 | minstalldir ${PHP_CONFIG_SCAN_DIR} || die | ||
344 | minstalldir ${PHP_EXTENSIONS_DIR} || die | ||
345 | |||
346 | local MCONFIG | ||
347 | local ext | ||
348 | for ext in ${extensions} | ||
349 | do | ||
350 | # install extensions and the config ini | ||
351 | minstallexec modules/${ext}.so ${PHP_EXTENSIONS_DIR} || die "mod ${ext}" | ||
352 | MCONFIG="${PHP_CONFIG_SCAN_DIR}/${ext}.ini" | ||
353 | mclearconfig || die "ini ${ext}" | ||
354 | maddconfig "extension=${ext}.so" || die "ini ${ext}" | ||
355 | done | ||
356 | } | ||
357 | |||
358 | src_prepare() | ||
359 | { | ||
360 | munpack ${SRCFILE} || die | ||
361 | cd ${SRCDIR} | ||
362 | |||
363 | # version branding | ||
364 | sed -i "s:^\(EXTRA_VERSION=\).*:\1-magellan-${PBUILD}:" configure.in || die | ||
365 | |||
366 | niro | 19541 | # support >= db-6.0 |
367 | # see for more issues: https://bugs.php.net/bug.php?id=65426 | ||
368 | mpatch ${PNAME}-${PVER}-db6.patch || die | ||
369 | |||
370 | niro | 19539 | # fixes multilib search pathes |
371 | mpatch ${PNAME}-5.2.4-multilib.patch || die | ||
372 | |||
373 | # do not touch the system httpd.conf | ||
374 | mpatch ${PNAME}-5.2.3-httpd-config.patch || die | ||
375 | |||
376 | # fully regenerate aclocal too | ||
377 | if [ -f aclocal.m4 ] | ||
378 | then | ||
379 | rm aclocal.m4 || die | ||
380 | fi | ||
381 | |||
382 | # rebuild configure | ||
383 | mautoreconf || die | ||
384 | |||
385 | # force use of system libtool | ||
386 | mlibtoolize || die | ||
387 | } | ||
388 | |||
389 | src_compile() | ||
390 | { | ||
391 | local php_base_config | ||
392 | local php_extensions | ||
393 | local php_disable_shared_extensions | ||
394 | local current_run | ||
395 | |||
396 | # --with-libdir needed, doesn't honor --libdir | ||
397 | php_base_config="--libdir=/usr/lib \ | ||
398 | --with-libdir=$(mlibdir) \ | ||
399 | --with-config-file-path=${PHP_CONFIG_DIR} \ | ||
400 | --with-config-file-scan-dir=${PHP_CONFIG_SCAN_DIR} \ | ||
401 | --enable-inline-optimization \ | ||
402 | --disable-rpath \ | ||
403 | --disable-debug \ | ||
404 | --disable-static \ | ||
405 | --enable-shared \ | ||
406 | --without-pear" | ||
407 | |||
408 | php_extensions="--with-zlib \ | ||
409 | --with-bz2=shared \ | ||
410 | --enable-bcmath=shared \ | ||
411 | --enable-calendar=shared \ | ||
412 | --enable-exif=shared \ | ||
413 | --enable-ftp=shared \ | ||
414 | --with-gettext=shared \ | ||
415 | --enable-mbstring=shared \ | ||
416 | --enable-mbregex \ | ||
417 | --with-ncurses=shared \ | ||
418 | --with-openssl=shared \ | ||
419 | --with-jpeg-dir=/usr \ | ||
420 | --with-png-dir=/usr \ | ||
421 | --with-xpm-dir=/usr \ | ||
422 | --with-gd=shared \ | ||
423 | --enable-gd-native-ttf \ | ||
424 | --with-freetype-dir=shared,/usr \ | ||
425 | --with-ttf \ | ||
426 | --with-t1lib=/usr \ | ||
427 | --with-pcre-regex \ | ||
428 | --with-gmp=shared \ | ||
429 | --with-curl=shared \ | ||
430 | --with-curlwrappers \ | ||
431 | --enable-dba=shared \ | ||
432 | niro | 19541 | --with-db4=shared \ |
433 | niro | 19539 | --with-mysql=shared \ |
434 | --with-mysqli=shared \ | ||
435 | --with-unixODBC=shared,/usr \ | ||
436 | --with-sqlite=shared \ | ||
437 | --with-sqlite3=shared \ | ||
438 | --enable-pdo=shared \ | ||
439 | --with-pdo-odbc=shared,unixODBC,/usr \ | ||
440 | --with-pdo-mysql=shared,/usr \ | ||
441 | --with-pdo-sqlite=shared,/usr \ | ||
442 | --enable-dbase=shared \ | ||
443 | --enable-dom=shared \ | ||
444 | --with-xmlrpc=shared \ | ||
445 | --enable-xmlreader=shared \ | ||
446 | --enable-xmlwriter=shared \ | ||
447 | --with-xsl=shared,/usr \ | ||
448 | --enable-wddx=shared \ | ||
449 | --enable-soap=shared \ | ||
450 | --enable-json=shared \ | ||
451 | --enable-zip=shared \ | ||
452 | --enable-phar=shared \ | ||
453 | --enable-posix=shared \ | ||
454 | --enable-fileinfo=shared \ | ||
455 | --enable-intl=shared \ | ||
456 | --enable-sockets=shared \ | ||
457 | --enable-sysvsem=shared \ | ||
458 | --enable-sysvshm=shared \ | ||
459 | --enable-sysvmsg=shared \ | ||
460 | --with-tidy=shared \ | ||
461 | --with-ldap=shared \ | ||
462 | --with-ldap-sasl \ | ||
463 | --with-enchant=shared \ | ||
464 | --with-pspell=shared" | ||
465 | # ToDo: | ||
466 | # --with-mcrypt=shared \ | ||
467 | # --with-mhash=shared \ | ||
468 | # --with-imap=shared \ | ||
469 | # --with-imap-ssl \ | ||
470 | # --enable-maintainer-zts <- threaded apache2 support | ||
471 | |||
472 | # required for fpm | ||
473 | php_disable_shared_extensions="--without-gd \ | ||
474 | --disable-dom \ | ||
475 | --disable-dba \ | ||
476 | --without-unixODBC \ | ||
477 | --disable-xmlreader \ | ||
478 | --disable-xmlwriter \ | ||
479 | --without-sqlite3 \ | ||
480 | --disable-phar \ | ||
481 | --disable-fileinfo \ | ||
482 | --disable-json \ | ||
483 | --without-pspell \ | ||
484 | --disable-wddx \ | ||
485 | --without-curl \ | ||
486 | --disable-posix \ | ||
487 | --disable-sysvmsg \ | ||
488 | --disable-sysvshm \ | ||
489 | --disable-sysvsem" | ||
490 | |||
491 | # set default extension_dir for all builds | ||
492 | export EXTENSION_DIR=${PHP_EXTENSIONS_DIR} | ||
493 | # set default pear dir for all builds | ||
494 | export PEAR_INSTALLDIR=${PHP_PEAR_DIR} | ||
495 | |||
496 | # | ||
497 | # build php: | ||
498 | # | ||
499 | |||
500 | # prepare build outside of the SRCDIR | ||
501 | install -d ${BUILDDIR}/build-php | ||
502 | cd ${BUILDDIR}/build-php | ||
503 | ln -snf ${SRCDIR}/configure | ||
504 | |||
505 | mconfigure \ | ||
506 | --srcdir=${SRCDIR} \ | ||
507 | ${php_base_config} \ | ||
508 | --disable-cgi \ | ||
509 | --with-readline \ | ||
510 | ${php_extensions} \ | ||
511 | || die | ||
512 | |||
513 | mmake || die | ||
514 | |||
515 | |||
516 | # | ||
517 | # build cgi/fastcgi | ||
518 | # | ||
519 | |||
520 | # prepare build with the previous run, to save a lot of time | ||
521 | current_run=cgi | ||
522 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} | ||
523 | cd ${BUILDDIR}/build-${current_run} | ||
524 | |||
525 | mconfigure \ | ||
526 | --srcdir=${SRCDIR} \ | ||
527 | ${php_base_config} \ | ||
528 | --enable-cgi \ | ||
529 | --enable-force-cgi-redirect \ | ||
530 | --enable-fastcgi \ | ||
531 | --disable-cli \ | ||
532 | ${php_extensions} \ | ||
533 | || die | ||
534 | |||
535 | mmake || die | ||
536 | |||
537 | |||
538 | # | ||
539 | # build apache mod | ||
540 | # | ||
541 | |||
542 | # prepare build with the previous run, to save a lot of time | ||
543 | current_run=apache | ||
544 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} | ||
545 | cd ${BUILDDIR}/build-${current_run} | ||
546 | |||
547 | mconfigure \ | ||
548 | --srcdir=${SRCDIR} \ | ||
549 | ${php_base_config} \ | ||
550 | --with-apxs2 \ | ||
551 | --disable-cli \ | ||
552 | ${php_extensions} \ | ||
553 | || die | ||
554 | |||
555 | mmake || die | ||
556 | |||
557 | |||
558 | # | ||
559 | # build embedded | ||
560 | # | ||
561 | |||
562 | # prepare build with the previous run, to save a lot of time | ||
563 | current_run=embedded | ||
564 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} | ||
565 | cd ${BUILDDIR}/build-${current_run} | ||
566 | |||
567 | mconfigure \ | ||
568 | --srcdir=${SRCDIR} \ | ||
569 | ${php_base_config} \ | ||
570 | --enable-embed=shared \ | ||
571 | --disable-cli \ | ||
572 | ${php_extensions} \ | ||
573 | || die | ||
574 | |||
575 | mmake || die | ||
576 | |||
577 | |||
578 | # | ||
579 | # build pear | ||
580 | # | ||
581 | |||
582 | # prepare build with the previous run, to save a lot of time | ||
583 | current_run=pear | ||
584 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} | ||
585 | cd ${BUILDDIR}/build-${current_run} | ||
586 | |||
587 | mconfigure \ | ||
588 | --srcdir=${SRCDIR} \ | ||
589 | ${php_base_config} \ | ||
590 | --disable-cgi \ | ||
591 | --with-readline \ | ||
592 | --enable-pcntl \ | ||
593 | --with-pear \ | ||
594 | ${php_extensions} \ | ||
595 | || die | ||
596 | |||
597 | mmake || die | ||
598 | |||
599 | # | ||
600 | # build fpm | ||
601 | # | ||
602 | |||
603 | # prepare build with the previous run, to save a lot of time | ||
604 | current_run=fpm | ||
605 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} | ||
606 | cd ${BUILDDIR}/build-${current_run} | ||
607 | |||
608 | mconfigure \ | ||
609 | --srcdir=${SRCDIR} \ | ||
610 | ${php_base_config} \ | ||
611 | --enable-fpm \ | ||
612 | --without-mysql \ | ||
613 | --disable-pdo \ | ||
614 | ${php_disable_shared_extensions} \ | ||
615 | || die | ||
616 | |||
617 | } | ||
618 | |||
619 | src_install_php() | ||
620 | { | ||
621 | cd ${BUILDDIR}/build-php | ||
622 | mmake -j1 INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install || die | ||
623 | |||
624 | # fix a broken symlink | ||
625 | mlink phar.phar /usr/bin/phar || die | ||
626 | |||
627 | local php_ini=${SRCDIR}/php.ini-production | ||
628 | |||
629 | # php config | ||
630 | minstalldir /etc/php/conf.d || die | ||
631 | # remove windows remark | ||
632 | sed -i -e '/^; extension_dir = "ext"/d' -e '/^; On windows:$/d' ${php_ini} || die | ||
633 | # fix extensions dir location | ||
634 | sed -i "s:^; \(extension_dir =\).*:\1 ${PHP_EXTENSIONS_DIR}:" ${php_ini} || die | ||
635 | # allow short php open-tags | ||
636 | sed -i "s:^\(short_open_tag =\).*:\1 On:" ${php_ini} || die | ||
637 | minstallfile ${php_ini} /etc/php/php.ini || die | ||
638 | |||
639 | # fix extension_dir also in phmp-config | ||
640 | sed -i "s:^\(extension_dir=\).*:\1${PHP_EXTENSIONS_DIR}:" ${BINDIR}/usr/bin/php-config || die | ||
641 | |||
642 | # remove all extensions provided by other split-packages | ||
643 | local ext | ||
644 | for ext in curl bcmath dba enchant gd gmp intl ldap mbstring mysql mysqli \ | ||
645 | pdo_mysql odbc pdo_odbc pdo pspell sqlite3 pdo_sqlite \ | ||
646 | soap sysvmsg sysvsem sysvshm posix tidy xsl wddx dom xmlreader \ | ||
647 | xmlwriter xmlrpc | ||
648 | do | ||
649 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/${ext}.so || die ${ext} | ||
650 | done | ||
651 | |||
652 | # remove all static extensions too | ||
653 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.a || die | ||
654 | |||
655 | # enable all default extensions | ||
656 | local MCONFIG | ||
657 | local i | ||
658 | for i in $(ls ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.so | sort ) | ||
659 | do | ||
660 | MCONFIG="/etc/php/conf.d/$(basename ${i} .so).ini" | ||
661 | mclearconfig || die | ||
662 | maddconfig "extension=$(basename ${i})" || die | ||
663 | done | ||
664 | |||
665 | # disable config-protect for modules conf dir | ||
666 | minstalldir /etc/env.d || die | ||
667 | MCONFIG="/etc/env.d/30php" | ||
668 | mclearconfig || die | ||
669 | maddconfig 'CONFIG_PROTECT_MASK="/etc/php/conf.d"' || die | ||
670 | |||
671 | minstalldocs CREDITS CODING_STANDARDS EXTENSIONS LICENSE NEWS README* TODO* || die | ||
672 | } | ||
673 | |||
674 | src_install_php-cgi() | ||
675 | { | ||
676 | cd ${BUILDDIR}/build-cgi | ||
677 | minstallexec sapi/cgi/php-cgi || die | ||
678 | } | ||
679 | |||
680 | src_install_php-apache() | ||
681 | { | ||
682 | cd ${BUILDDIR}/build-apache | ||
683 | |||
684 | # install apache sapi | ||
685 | local APACHE_MOD_DIR="$(apxs -q LIBEXECDIR)" | ||
686 | minstalldir ${APACHE_MOD_DIR} || die | ||
687 | minstallexec libs/libphp5.so ${APACHE_MOD_DIR} || die | ||
688 | |||
689 | # install apache module config | ||
690 | local APACHE_SYSCONFDIR="$(apxs -q SYSCONFDIR)" | ||
691 | minstalldir ${APACHE_SYSCONFDIR}/modules.d || die | ||
692 | minstallfile -s php5_module.conf ${APACHE_SYSCONFDIR}/modules.d/php5.conf || die | ||
693 | } | ||
694 | |||
695 | src_install_php-embedded() | ||
696 | { | ||
697 | cd ${BUILDDIR}/build-embedded | ||
698 | |||
699 | # install sapi library | ||
700 | minstalldir /usr/$(mlibdir) || die | ||
701 | minstallexec libs/libphp5.so /usr/$(mlibdir)/libphp5.so || die | ||
702 | |||
703 | # install include | ||
704 | minstalldir /usr/include/${PNAME}/sapi/embed || die | ||
705 | minstallfile ${SRCDIR}/sapi/embed/php_embed.h /usr/include/${PNAME}/sapi/embed || die | ||
706 | } | ||
707 | |||
708 | src_install_php-pear() | ||
709 | { | ||
710 | cd ${BUILDDIR}/build-pear | ||
711 | mmake INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install-pear || die | ||
712 | |||
713 | local i | ||
714 | for i in $(find ${BINDIR}/ -name '.*') | ||
715 | do | ||
716 | if [[ -e ${i} ]] | ||
717 | then | ||
718 | rm -rf ${i} || die ${i} | ||
719 | fi | ||
720 | done | ||
721 | } | ||
722 | |||
723 | src_install_php-fpm() | ||
724 | { | ||
725 | cd ${BUILDDIR}/build-fpm | ||
726 | mmake INSTALL_ROOT=${BINDIR} install-fpm || die | ||
727 | |||
728 | mkeepdir /var/log/php-fpm || die | ||
729 | mkeepdir /run/php-fpm || die | ||
730 | |||
731 | # config | ||
732 | minstalldir /etc/php || die | ||
733 | minstalldir /etc/php/fpm.conf.d || die | ||
734 | minstallfile -s php-fpm.conf /etc/php/ || die | ||
735 | minstallfile -s php-fpm-www.conf /etc/php/fpm.conf.d/www.conf || die | ||
736 | |||
737 | # systemd | ||
738 | minstalltmp php-fpm.tmpfilesd php-fpm.conf || die | ||
739 | minstallunit php-fpm.service || die | ||
740 | minstalllog php-fpm.logrotate php-fpm || die | ||
741 | minstallconf php-fpm.confd php-fpm || die | ||
742 | } | ||
743 | |||
744 | # being a little tricky here: | ||
745 | for subpackage in ${SPLIT_PACKAGES} | ||
746 | do | ||
747 | # exclude all other packages than php-addon-modules | ||
748 | case ${subpackage} in | ||
749 | php) continue ;; | ||
750 | php-cgi) continue ;; | ||
751 | php-apache) continue ;; | ||
752 | php-embedded) continue ;; | ||
753 | php-pear) continue ;; | ||
754 | php-fpm) continue ;; | ||
755 | esac | ||
756 | |||
757 | eval "src_install_${subpackage}(){ install_php_extensions ${subpackage#*-} || die; }" | ||
758 | done | ||
759 | |||
760 | # exceptions | ||
761 | src_install_php-mysql() | ||
762 | { | ||
763 | install_php_extensions mysql mysqli pdo_mysql || die | ||
764 | } | ||
765 | |||
766 | src_install_php-odbc() | ||
767 | { | ||
768 | install_php_extensions odbc pdo_odbc || die | ||
769 | } | ||
770 | |||
771 | src_install_php-process() | ||
772 | { | ||
773 | install_php_extensions sysvmsg sysvsem sysvshm posix || die | ||
774 | } | ||
775 | |||
776 | src_install_php-sqlite() | ||
777 | { | ||
778 | install_php_extensions sqlite3 pdo_sqlite || die | ||
779 | } | ||
780 | |||
781 | src_install_php-xml() | ||
782 | { | ||
783 | install_php_extensions dom wddx xmlreader xmlwriter xsl || die | ||
784 | } |