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