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