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