Magellan Linux

Annotation of /trunk/extras/php/php-5.6.30-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29253 - (hide annotations) (download)
Wed May 31 11:08:32 2017 UTC (7 years ago) by niro
File size: 18308 byte(s)
auto added: ver bump to 5.6.30-r1
1 niro 29253 # $Id$
2    
3     PNAME="php"
4     PVER="5.6.30"
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-7.0
54     >= sys-libs/zlib-1.2
55     >= app-arch/bzip2-1
56     >= dev-libs/openssl-1.0.2"
57     DEPEND_STDCPP=">= sys-libs/libstdc++-6.3"
58     DEPEND_APACHE=">= net-www/apache2-2.4"
59     DEPEND_ASPELL=">= app-text/aspell-0.60"
60     DEPEND_BDB=">= dev-db/db-6.2"
61     DEPEND_CURL=">= net-libs/libcurl-7.43"
62     DEPEND_ENCHANT=">= app-text/enchant-1.6"
63     DEPEND_GD=">= virtual/libjpeg
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-59.1
71     >= sys-libs/libgcc-6.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.14"
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-230"
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     install -d ${BUILDDIR}/build-php/Zend || die
525     cp ${SRCDIR}/Zend/zend_{language,ini}_{parser,scanner}.[ch] ${BUILDDIR}/build-php/Zend || die
526    
527     mconfigure \
528     --srcdir=${SRCDIR} \
529     ${php_base_config} \
530     --disable-cgi \
531     --with-readline \
532     ${php_extensions} \
533     || die
534    
535     mmake || die
536    
537    
538     #
539     # build cgi/fastcgi
540     #
541    
542     # prepare build with the previous run, to save a lot of time
543     current_run=cgi
544     echo "preparing build for '${current_run}'"
545     cp -arv ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} || die
546     cd ${BUILDDIR}/build-${current_run}
547    
548     mconfigure \
549     --srcdir=${SRCDIR} \
550     ${php_base_config} \
551     --enable-cgi \
552     --enable-force-cgi-redirect \
553     --enable-fastcgi \
554     --disable-cli \
555     ${php_extensions} \
556     || die
557    
558     mmake || die
559    
560    
561     #
562     # build apache mod
563     #
564    
565     # prepare build with the previous run, to save a lot of time
566     current_run=apache
567     echo "preparing build for '${current_run}'"
568     cp -arv ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} || die
569     cd ${BUILDDIR}/build-${current_run}
570    
571     mconfigure \
572     --srcdir=${SRCDIR} \
573     ${php_base_config} \
574     --with-apxs2 \
575     --disable-cli \
576     ${php_extensions} \
577     || die
578    
579     mmake || die
580    
581    
582     #
583     # build embedded
584     #
585    
586     # prepare build with the previous run, to save a lot of time
587     current_run=embedded
588     echo "preparing build for '${current_run}'"
589     cp -arv ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} || die
590     cd ${BUILDDIR}/build-${current_run}
591    
592     mconfigure \
593     --srcdir=${SRCDIR} \
594     ${php_base_config} \
595     --enable-embed=shared \
596     --disable-cli \
597     ${php_extensions} \
598     || die
599    
600     mmake || die
601    
602    
603     #
604     # build pear
605     #
606    
607     # prepare build with the previous run, to save a lot of time
608     current_run=pear
609     echo "preparing build for '${current_run}'"
610     cp -arv ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} || die
611     cd ${BUILDDIR}/build-${current_run}
612    
613     mconfigure \
614     --srcdir=${SRCDIR} \
615     ${php_base_config} \
616     --disable-cgi \
617     --with-readline \
618     --enable-pcntl \
619     --with-pear \
620     ${php_extensions} \
621     || die
622    
623     mmake || die
624    
625     #
626     # build fpm
627     #
628    
629     # prepare build with the previous run, to save a lot of time
630     current_run=fpm
631     echo "preparing build for '${current_run}'"
632     cp -arv ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} || die
633     cd ${BUILDDIR}/build-${current_run}
634    
635     mconfigure \
636     --srcdir=${SRCDIR} \
637     ${php_base_config} \
638     --enable-fpm \
639     --without-mysql \
640     --disable-pdo \
641     ${php_disable_shared_extensions} \
642     || die
643    
644     }
645    
646     src_install_php()
647     {
648     cd ${BUILDDIR}/build-php
649     mmake -j1 INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install || die
650    
651     # fix a broken symlink
652     mlink phar.phar /usr/bin/phar || die
653    
654     local php_ini=${SRCDIR}/php.ini-production
655    
656     # php config
657     minstalldir /etc/php/conf.d || die
658     # remove windows remark
659     sed -i -e '/^; extension_dir = "ext"/d' -e '/^; On windows:$/d' ${php_ini} || die
660     # fix extensions dir location
661     sed -i "s:^; \(extension_dir =\).*:\1 ${PHP_EXTENSIONS_DIR}:" ${php_ini} || die
662     # allow short php open-tags
663     sed -i "s:^\(short_open_tag =\).*:\1 On:" ${php_ini} || die
664     minstallfile ${php_ini} /etc/php/php.ini || die
665    
666     # fix extension_dir also in phmp-config
667     sed -i "s:^\(extension_dir=\).*:\1${PHP_EXTENSIONS_DIR}:" ${BINDIR}/usr/bin/php-config || die
668    
669     # remove all extensions provided by other split-packages
670     local ext
671     for ext in curl bcmath dba enchant gd gmp intl ldap mbstring mysql mysqli \
672     opcache pdo_mysql odbc pdo_odbc pdo pspell sqlite3 pdo_sqlite \
673     soap sysvmsg sysvsem sysvshm posix tidy xsl wddx dom xmlreader \
674     xmlwriter xmlrpc
675     do
676     rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/${ext}.so || die ${ext}
677     done
678    
679     # remove all static extensions too
680     rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.a || die
681    
682     # enable all default extensions
683     local MCONFIG
684     local i
685     for i in $(ls ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.so | sort )
686     do
687     MCONFIG="/etc/php/conf.d/$(basename ${i} .so).ini"
688     mclearconfig || die
689     maddconfig "extension=$(basename ${i})" || die
690     done
691    
692     # disable config-protect for modules conf dir
693     minstalldir /etc/env.d || die
694     MCONFIG="/etc/env.d/30php"
695     mclearconfig || die
696     maddconfig 'CONFIG_PROTECT_MASK="/etc/php/conf.d"' || die
697    
698     minstalldocs CREDITS CODING_STANDARDS EXTENSIONS LICENSE NEWS README* TODO* || die
699     }
700    
701     src_install_php-cgi()
702     {
703     cd ${BUILDDIR}/build-cgi
704     minstallexec sapi/cgi/php-cgi || die
705     }
706    
707     src_install_php-apache()
708     {
709     cd ${BUILDDIR}/build-apache
710    
711     # install apache sapi
712     local APACHE_MOD_DIR="$(apxs -q LIBEXECDIR)"
713     minstalldir ${APACHE_MOD_DIR} || die
714     minstallexec libs/libphp5.so ${APACHE_MOD_DIR} || die
715    
716     # install apache module config
717     local APACHE_SYSCONFDIR="$(apxs -q SYSCONFDIR)"
718     minstalldir ${APACHE_SYSCONFDIR}/modules.d || die
719     minstallfile -s php5_module.conf-${MOD_REV} ${APACHE_SYSCONFDIR}/modules.d/php5.conf || die
720     }
721    
722     src_install_php-embedded()
723     {
724     cd ${BUILDDIR}/build-embedded
725    
726     # install sapi library
727     minstalldir /usr/$(mlibdir) || die
728     minstallexec libs/libphp5.so /usr/$(mlibdir)/libphp5.so || die
729    
730     # install include
731     minstalldir /usr/include/${PNAME}/sapi/embed || die
732     minstallfile ${SRCDIR}/sapi/embed/php_embed.h /usr/include/${PNAME}/sapi/embed || die
733     }
734    
735     src_install_php-pear()
736     {
737     cd ${BUILDDIR}/build-pear
738     mmake INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install-pear || die
739    
740     local i
741     for i in $(find ${BINDIR}/ -name '.*')
742     do
743     if [[ -e ${i} ]]
744     then
745     rm -rf ${i} || die ${i}
746     fi
747     done
748     }
749    
750     src_install_php-fpm()
751     {
752     cd ${BUILDDIR}/build-fpm
753     mmake INSTALL_ROOT=${BINDIR} install-fpm || die
754    
755     mkeepdir /var/log/php-fpm || die
756     mkeepdir /run/php-fpm || die
757    
758     # config
759     minstalldir /etc/php || die
760     minstalldir /etc/php/fpm.conf.d || die
761     minstallfile -s php-fpm.conf /etc/php/ || die
762     minstallfile -s php-fpm-www.conf /etc/php/fpm.conf.d/www.conf || die
763    
764     # systemd
765     minstalltmp php-fpm.tmpfilesd php-fpm.conf || die
766     minstallunit php-fpm.service || die
767     minstalllog php-fpm.logrotate php-fpm || die
768     minstallconf php-fpm.confd php-fpm || die
769     }
770    
771     # being a little tricky here:
772     for subpackage in ${SPLIT_PACKAGES}
773     do
774     # exclude all other packages than php-addon-modules
775     case ${subpackage} in
776     php) continue ;;
777     php-cgi) continue ;;
778     php-apache) continue ;;
779     php-embedded) continue ;;
780     php-pear) continue ;;
781     php-fpm) continue ;;
782     esac
783    
784     eval "src_install_${subpackage}(){ install_php_extensions ${subpackage#*-} || die; }"
785     done
786    
787     # exceptions
788     src_install_php-mysql()
789     {
790     install_php_extensions mysql mysqli pdo_mysql || die
791     }
792    
793     src_install_php-odbc()
794     {
795     install_php_extensions odbc pdo_odbc || die
796     }
797    
798     src_install_php-process()
799     {
800     install_php_extensions sysvmsg sysvsem sysvshm posix || die
801     }
802    
803     src_install_php-sqlite()
804     {
805     install_php_extensions sqlite3 pdo_sqlite || die
806     }
807    
808     src_install_php-xml()
809     {
810     install_php_extensions dom wddx xmlreader xmlwriter xsl || die
811     }