Magellan Linux

Annotation of /smage/branches/alx07x-unstable/extras/php/php-7.3.22-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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