Magellan Linux

Contents of /trunk/extras/php/php-5.4.42-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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