Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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