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