Magellan Linux

Contents of /trunk/extras/php/php-7.1.7-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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