Magellan Linux

Contents of /smage/trunk/extras/php/php-5.4.42-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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