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