Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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