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