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