Magellan Linux

Annotation of /branches/R11-unstable/extras/php/php-5.4.19-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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