Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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