Contents of /trunk/extras/php/php-5.4.8-r1.smage2
Parent Directory | Revision Log
Revision 13944 -
(show annotations)
(download)
Thu Nov 1 13:17:27 2012 UTC (11 years, 7 months ago) by niro
File size: 17252 byte(s)
Thu Nov 1 13:17:27 2012 UTC (11 years, 7 months ago) by niro
File size: 17252 byte(s)
-fixed curl dependencies
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_CURL}" |
192 | PCAT="dev-php" |
193 | } |
194 | |
195 | split_info_php-dba() |
196 | { |
197 | DESCRIPTION="A database abstraction layer module for PHP applications." |
198 | DEPEND="== dev-lang/php-${PVER}" |
199 | PCAT="dev-php" |
200 | } |
201 | |
202 | split_info_php-enchant() |
203 | { |
204 | DESCRIPTION="Human Language and Character Encoding Support." |
205 | DEPEND="== dev-lang/php-${PVER} |
206 | ${DEPEND_ENCHANT}" |
207 | PCAT="dev-php" |
208 | } |
209 | |
210 | split_info_php-gd() |
211 | { |
212 | DESCRIPTION="A module for PHP applications for using the gd graphics library." |
213 | DEPEND="== dev-lang/php-${PVER} |
214 | ${DEPEND_GD}" |
215 | PCAT="dev-php" |
216 | } |
217 | |
218 | split_info_php-gmp() |
219 | { |
220 | DESCRIPTION="A module for PHP applications for using the gmp library." |
221 | DEPEND="== dev-lang/php-${PVER} |
222 | ${DEPEND_GMP}" |
223 | PCAT="dev-php" |
224 | } |
225 | |
226 | split_info_php-intl() |
227 | { |
228 | DESCRIPTION="Internationalization extension for PHP applications." |
229 | DEPEND="== dev-lang/php-${PVER} |
230 | ${DEPEND_ICU}" |
231 | PCAT="dev-php" |
232 | } |
233 | |
234 | split_info_php-ldap() |
235 | { |
236 | DESCRIPTION="A module for PHP applications that use LDAP." |
237 | DEPEND="== dev-lang/php-${PVER} |
238 | ${DEPEND_SASL} |
239 | ${DEPEND_LDAP}" |
240 | PCAT="dev-php" |
241 | } |
242 | |
243 | split_info_php-mbstring() |
244 | { |
245 | DESCRIPTION="A module for PHP applications which need multi-byte string handling." |
246 | DEPEND="== dev-lang/php-${PVER}" |
247 | PCAT="dev-php" |
248 | } |
249 | |
250 | split_info_php-mysql() |
251 | { |
252 | DESCRIPTION="Modules for PHP applications that use MySQL databases." |
253 | DEPEND="== dev-lang/php-${PVER} |
254 | == dev-lang/php-pdo-${PVER} |
255 | ${DEPEND_MYSQL}" |
256 | PCAT="dev-php" |
257 | } |
258 | |
259 | split_info_php-odbc() |
260 | { |
261 | DESCRIPTION="Modules for PHP applications that use ODBC databases." |
262 | DEPEND="== dev-lang/php-${PVER} |
263 | == dev-lang/php-pdo-${PVER} |
264 | ${DEPEND_ODBC}" |
265 | PCAT="dev-php" |
266 | } |
267 | |
268 | split_info_php-pdo() |
269 | { |
270 | DESCRIPTION="A database access abstraction module for PHP applications." |
271 | DEPEND="== dev-lang/php-${PVER}" |
272 | PCAT="dev-php" |
273 | } |
274 | |
275 | split_info_php-process() |
276 | { |
277 | DESCRIPTION="Modules for PHP script using system process interfaces." |
278 | DEPEND="== dev-lang/php-${PVER}" |
279 | PCAT="dev-php" |
280 | } |
281 | |
282 | split_info_php-pspell() |
283 | { |
284 | DESCRIPTION="A module for PHP applications for using pspell interfaces." |
285 | DEPEND="== dev-lang/php-${PVER} |
286 | ${DEPEND_ASPELL}" |
287 | PCAT="dev-php" |
288 | } |
289 | |
290 | split_info_php-soap() |
291 | { |
292 | DESCRIPTION="A module for PHP applications that use the SOAP protocol." |
293 | DEPEND="== dev-lang/php-${PVER} |
294 | ${DEPEND_XML}" |
295 | PCAT="dev-php" |
296 | } |
297 | |
298 | split_info_php-sqlite() |
299 | { |
300 | DESCRIPTION="Modules for PHP applications that use SQLite databases." |
301 | DEPEND="== dev-lang/php-${PVER} |
302 | == dev-lang/php-pdo-${PVER} |
303 | ${DEPEND_SQLITE}" |
304 | PCAT="dev-php" |
305 | } |
306 | |
307 | split_info_php-tidy() |
308 | { |
309 | DESCRIPTION="Standard PHP module provides tidy library support." |
310 | DEPEND="== dev-lang/php-${PVER} |
311 | ${DEPEND_TIDY}" |
312 | PCAT="dev-php" |
313 | } |
314 | |
315 | split_info_php-xml() |
316 | { |
317 | DESCRIPTION="Modules for PHP applications which use XML." |
318 | DEPEND="== dev-lang/php-${PVER} |
319 | ${DEPEND_XML} |
320 | ${DEPEND_XSLT}" |
321 | PCAT="dev-php" |
322 | } |
323 | |
324 | split_info_php-xmlrpc() |
325 | { |
326 | DESCRIPTION="A module for PHP applications which use the XML-RPC protocol." |
327 | DEPEND="== dev-lang/php-${PVER} |
328 | ${DEPEND_XML}" |
329 | PCAT="dev-php" |
330 | } |
331 | |
332 | # install-helper function |
333 | install_php_extensions() |
334 | { |
335 | local extensions="$@" |
336 | [[ -z ${extensions} ]] && die "no extensions given" |
337 | |
338 | # set default PHP_BUILD_DIR, env can override this |
339 | : ${PHP_BUILD_DIR="${BUILDDIR}/build-php"} |
340 | |
341 | cd ${PHP_BUILD_DIR} |
342 | |
343 | # needed directories |
344 | minstalldir ${PHP_CONFIG_SCAN_DIR} || die |
345 | minstalldir ${PHP_EXTENSIONS_DIR} || die |
346 | |
347 | local MCONFIG |
348 | local ext |
349 | for ext in ${extensions} |
350 | do |
351 | # install extensions and the config ini |
352 | minstallexec modules/${ext}.so ${PHP_EXTENSIONS_DIR} || die "mod ${ext}" |
353 | MCONFIG="${PHP_CONFIG_SCAN_DIR}/${ext}.ini" |
354 | mclearconfig || die "ini ${ext}" |
355 | maddconfig "extension=${ext}.so" || die "ini ${ext}" |
356 | done |
357 | } |
358 | |
359 | src_prepare() |
360 | { |
361 | munpack ${SRCFILE} || die |
362 | cd ${SRCDIR} |
363 | |
364 | # version branding |
365 | sed -i "s:^\(EXTRA_VERSION=\).*:\1-magellan-${PBUILD}:" configure.in || die |
366 | |
367 | # fixes multilib search pathes |
368 | mpatch ${PNAME}-5.2.4-multilib.patch || die |
369 | |
370 | # do not touch the system httpd.conf |
371 | mpatch ${PNAME}-5.2.3-httpd-config.patch || die |
372 | |
373 | # fully regenerate aclocal too |
374 | if [ -f aclocal.m4 ] |
375 | then |
376 | rm aclocal.m4 || die |
377 | fi |
378 | |
379 | # rebuild configure |
380 | mautoreconf || die |
381 | |
382 | # force use of system libtool |
383 | mlibtoolize || die |
384 | } |
385 | |
386 | src_compile() |
387 | { |
388 | local php_base_config |
389 | local php_extensions |
390 | local php_disable_shared_extensions |
391 | local current_run |
392 | |
393 | # --with-libdir needed, doesn't honor --libdir |
394 | php_base_config="--libdir=/usr/lib \ |
395 | --with-libdir=$(mlibdir) \ |
396 | --with-config-file-path=${PHP_CONFIG_DIR} \ |
397 | --with-config-file-scan-dir=${PHP_CONFIG_SCAN_DIR} \ |
398 | --enable-inline-optimization \ |
399 | --disable-rpath \ |
400 | --disable-debug \ |
401 | --disable-static \ |
402 | --enable-shared \ |
403 | --without-pear" |
404 | |
405 | php_extensions="--with-zlib \ |
406 | --with-bz2=shared \ |
407 | --enable-bcmath=shared \ |
408 | --enable-calendar=shared \ |
409 | --enable-exif=shared \ |
410 | --enable-ftp=shared \ |
411 | --with-gettext=shared \ |
412 | --enable-mbstring=shared \ |
413 | --enable-mbregex \ |
414 | --with-ncurses=shared \ |
415 | --with-openssl=shared \ |
416 | --with-jpeg-dir=/usr \ |
417 | --with-png-dir=/usr \ |
418 | --with-xpm-dir=/usr \ |
419 | --with-gd=shared \ |
420 | --enable-gd-native-ttf \ |
421 | --with-freetype-dir=shared,/usr \ |
422 | --with-ttf \ |
423 | --with-t1lib=/usr \ |
424 | --with-pcre-regex \ |
425 | --with-gmp=shared \ |
426 | --with-curl=shared \ |
427 | --with-curlwrappers \ |
428 | --enable-dba=shared \ |
429 | --with-db4=shared \ |
430 | --with-mysql=shared \ |
431 | --with-mysqli=shared \ |
432 | --with-unixODBC=shared,/usr \ |
433 | --with-sqlite=shared \ |
434 | --with-sqlite3=shared \ |
435 | --enable-pdo=shared \ |
436 | --with-pdo-odbc=shared,unixODBC,/usr \ |
437 | --with-pdo-mysql=shared,/usr \ |
438 | --with-pdo-sqlite=shared,/usr \ |
439 | --enable-dbase=shared \ |
440 | --enable-dom=shared \ |
441 | --with-xmlrpc=shared \ |
442 | --enable-xmlreader=shared \ |
443 | --enable-xmlwriter=shared \ |
444 | --with-xsl=shared,/usr \ |
445 | --enable-wddx=shared \ |
446 | --enable-soap=shared \ |
447 | --enable-json=shared \ |
448 | --enable-zip=shared \ |
449 | --enable-phar=shared \ |
450 | --enable-posix=shared \ |
451 | --enable-fileinfo=shared \ |
452 | --enable-intl=shared \ |
453 | --enable-sockets=shared \ |
454 | --enable-sysvsem=shared \ |
455 | --enable-sysvshm=shared \ |
456 | --enable-sysvmsg=shared \ |
457 | --with-tidy=shared \ |
458 | --with-ldap=shared \ |
459 | --with-ldap-sasl \ |
460 | --with-enchant=shared \ |
461 | --with-pspell=shared" |
462 | # ToDo: |
463 | # --with-mcrypt=shared \ |
464 | # --with-mhash=shared \ |
465 | # --with-imap=shared \ |
466 | # --with-imap-ssl \ |
467 | # --enable-maintainer-zts <- threaded apache2 support |
468 | |
469 | # required for fpm |
470 | php_disable_shared_extensions="--without-gd \ |
471 | --disable-dom \ |
472 | --disable-dba \ |
473 | --without-unixODBC \ |
474 | --disable-xmlreader \ |
475 | --disable-xmlwriter \ |
476 | --without-sqlite3 \ |
477 | --disable-phar \ |
478 | --disable-fileinfo \ |
479 | --disable-json \ |
480 | --without-pspell \ |
481 | --disable-wddx \ |
482 | --without-curl \ |
483 | --disable-posix \ |
484 | --disable-sysvmsg \ |
485 | --disable-sysvshm \ |
486 | --disable-sysvsem" |
487 | |
488 | # |
489 | # build php: |
490 | # |
491 | |
492 | # prepare build outside of the SRCDIR |
493 | install -d ${BUILDDIR}/build-php |
494 | cd ${BUILDDIR}/build-php |
495 | ln -snf ${SRCDIR}/configure |
496 | |
497 | mconfigure \ |
498 | --srcdir=${SRCDIR} \ |
499 | ${php_base_config} \ |
500 | --disable-cgi \ |
501 | --with-readline \ |
502 | ${php_extensions} \ |
503 | || die |
504 | |
505 | mmake || die |
506 | |
507 | |
508 | # |
509 | # build cgi/fastcgi |
510 | # |
511 | |
512 | # prepare build with the previous run, to save a lot of time |
513 | current_run=cgi |
514 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
515 | cd ${BUILDDIR}/build-${current_run} |
516 | |
517 | mconfigure \ |
518 | --srcdir=${SRCDIR} \ |
519 | ${php_base_config} \ |
520 | --enable-cgi \ |
521 | --enable-force-cgi-redirect \ |
522 | --enable-fastcgi \ |
523 | --disable-cli \ |
524 | ${php_extensions} \ |
525 | || die |
526 | |
527 | mmake || die |
528 | |
529 | |
530 | # |
531 | # build apache mod |
532 | # |
533 | |
534 | # prepare build with the previous run, to save a lot of time |
535 | current_run=apache |
536 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
537 | cd ${BUILDDIR}/build-${current_run} |
538 | |
539 | mconfigure \ |
540 | --srcdir=${SRCDIR} \ |
541 | ${php_base_config} \ |
542 | --with-apxs2 \ |
543 | --disable-cli \ |
544 | ${php_extensions} \ |
545 | || die |
546 | |
547 | mmake || die |
548 | |
549 | |
550 | # |
551 | # build embedded |
552 | # |
553 | |
554 | # prepare build with the previous run, to save a lot of time |
555 | current_run=embedded |
556 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
557 | cd ${BUILDDIR}/build-${current_run} |
558 | |
559 | mconfigure \ |
560 | --srcdir=${SRCDIR} \ |
561 | ${php_base_config} \ |
562 | --enable-embed=shared \ |
563 | --disable-cli \ |
564 | ${php_extensions} \ |
565 | || die |
566 | |
567 | mmake || die |
568 | |
569 | |
570 | # |
571 | # build pear |
572 | # |
573 | |
574 | # prepare build with the previous run, to save a lot of time |
575 | current_run=pear |
576 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
577 | cd ${BUILDDIR}/build-${current_run} |
578 | |
579 | mconfigure \ |
580 | --srcdir=${SRCDIR} \ |
581 | ${php_base_config} \ |
582 | --disable-cgi \ |
583 | --with-readline \ |
584 | --enable-pcntl \ |
585 | --with-pear \ |
586 | ${php_extensions} \ |
587 | || die |
588 | |
589 | mmake || die |
590 | |
591 | # |
592 | # build fpm |
593 | # |
594 | |
595 | # prepare build with the previous run, to save a lot of time |
596 | current_run=fpm |
597 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
598 | cd ${BUILDDIR}/build-${current_run} |
599 | |
600 | mconfigure \ |
601 | --srcdir=${SRCDIR} \ |
602 | ${php_base_config} \ |
603 | --enable-fpm \ |
604 | --without-mysql \ |
605 | --disable-pdo \ |
606 | ${php_disable_shared_extensions} \ |
607 | || die |
608 | |
609 | } |
610 | |
611 | src_install_php() |
612 | { |
613 | cd ${BUILDDIR}/build-php |
614 | mmake -j1 INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install || die |
615 | |
616 | # fix a broken symlink |
617 | mlink phar.phar /usr/bin/phar || die |
618 | |
619 | local php_ini=${SRCDIR}/php.ini-production |
620 | |
621 | # php config |
622 | minstalldir /etc/php/conf.d || die |
623 | # remove windows remark |
624 | sed -i -e '/^; extension_dir = "ext"/d' -e '/^; On windows:$/d' ${php_ini} || die |
625 | # fix extensions dir location |
626 | sed -i "s:^; \(extension_dir =\).*:\1 ${PHP5_EXTENSIONS_DIR}:" ${php_ini} || die |
627 | # allow short php open-tags |
628 | sed -i "s:^\(short_open_tag =\).*:\1 On:" ${php_ini} || die |
629 | minstallfile ${php_ini} /etc/php/php.ini || die |
630 | |
631 | # fix extension_dir also in phmp-config |
632 | sed -i "s:^\(extension_dir=\).*:\1${PHP_EXTENSIONS_DIR}:" ${BINDIR}/usr/bin/php-config || die |
633 | |
634 | # remove all extensions provided by other split-packages |
635 | local ext |
636 | for ext in curl bcmath dba enchant gd gmp intl ldap mbstring mysql mysqli \ |
637 | pdo_mysql odbc pdo_odbc pdo pspell sqlite3 pdo_sqlite \ |
638 | soap sysvmsg sysvsem sysvshm posix tidy xsl wddx dom xmlreader \ |
639 | xmlwriter xmlrpc |
640 | do |
641 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/${ext}.so || die ${ext} |
642 | done |
643 | |
644 | # remove all static extensions too |
645 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.a || die |
646 | |
647 | # enable all default extensions |
648 | local MCONFIG |
649 | local i |
650 | for i in $(ls ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.so | sort ) |
651 | do |
652 | MCONFIG="/etc/php/conf.d/$(basename ${i} .so).ini" |
653 | mclearconfig || die |
654 | maddconfig "extension=$(basename ${i})" || die |
655 | done |
656 | |
657 | # disable config-protect for modules conf dir |
658 | minstalldir /etc/env.d || die |
659 | MCONFIG="/etc/env.d/30php" |
660 | mclearconfig || die |
661 | maddconfig 'CONFIG_PROTECT_MASK="/etc/php/conf.d"' || die |
662 | |
663 | minstalldocs CREDITS CODING_STANDARDS EXTENSIONS LICENSE NEWS README* TODO* || die |
664 | } |
665 | |
666 | src_install_php-cgi() |
667 | { |
668 | cd ${BUILDDIR}/build-cgi |
669 | minstallexec sapi/cgi/php-cgi || die |
670 | } |
671 | |
672 | src_install_php-apache() |
673 | { |
674 | cd ${BUILDDIR}/build-apache |
675 | |
676 | # install apache sapi |
677 | local APACHE_MOD_DIR="$(apxs -q LIBEXECDIR)" |
678 | minstalldir ${APACHE_MOD_DIR} || die |
679 | minstallexec libs/libphp5.so ${APACHE_MOD_DIR} || die |
680 | |
681 | # install apache module config |
682 | local APACHE_SYSCONFDIR="$(apxs -q SYSCONFDIR)" |
683 | minstalldir ${APACHE_SYSCONFDIR}/modules.d || die |
684 | minstallfile -s php5_module.conf ${APACHE_SYSCONFDIR}/modules.d/php5.conf || die |
685 | } |
686 | |
687 | src_install_php-embedded() |
688 | { |
689 | cd ${BUILDDIR}/build-embedded |
690 | |
691 | # install sapi library |
692 | minstalldir /usr/$(mlibdir) || die |
693 | minstallexec libs/libphp5.so /usr/$(mlibdir)/libphp5.so || die |
694 | |
695 | # install include |
696 | minstalldir /usr/include/${PNAME}/sapi/embed || die |
697 | minstallfile ${SRCDIR}/sapi/embed/php_embed.h /usr/include/${PNAME}/sapi/embed || die |
698 | } |
699 | |
700 | src_install_php-pear() |
701 | { |
702 | cd ${BUILDDIR}/build-pear |
703 | mmake INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install-pear || die |
704 | |
705 | local i |
706 | for i in $(find ${BINDIR}/ -name '.*') |
707 | do |
708 | if [[ -e ${i} ]] |
709 | then |
710 | rm -rf ${i} || die ${i} |
711 | fi |
712 | done |
713 | } |
714 | |
715 | src_install_php-fpm() |
716 | { |
717 | cd ${BUILDDIR}/build-fpm |
718 | mmake INSTALL_ROOT=${BINDIR} install-fpm || die |
719 | |
720 | mkeepdir /var/log/php-fpm || die |
721 | mkeepdir /run/php-fpm || die |
722 | |
723 | # config |
724 | minstalldir /etc/php || die |
725 | minstalldir /etc/php/fpm.conf.d || die |
726 | minstallfile -s php-fpm.conf /etc/php/ || die |
727 | minstallfile -s php-fpm-www.conf /etc/php/fpm.conf.d/www.conf || die |
728 | |
729 | # systemd |
730 | minstalltmp php-fpm.tmpfilesd php-fpm.conf || die |
731 | minstallunit php-fpm.service || die |
732 | minstalllog php-fpm.logrotate php-fpm || die |
733 | minstallconf php-fpm.confd php-fpm || die |
734 | } |
735 | |
736 | # being a little tricky here: |
737 | for subpackage in ${SPLIT_PACKAGES} |
738 | do |
739 | # exclude all other packages than php-addon-modules |
740 | case ${subpackage} in |
741 | php) continue ;; |
742 | php-cgi) continue ;; |
743 | php-apache) continue ;; |
744 | php-embedded) continue ;; |
745 | php-pear) continue ;; |
746 | php-fpm) continue ;; |
747 | esac |
748 | |
749 | eval "src_install_${subpackage}(){ install_php_extensions ${subpackage#*-} || die; }" |
750 | done |
751 | |
752 | # exceptions |
753 | src_install_php-mysql() |
754 | { |
755 | install_php_extensions mysql mysqli pdo_mysql || die |
756 | } |
757 | |
758 | src_install_php-odbc() |
759 | { |
760 | install_php_extensions odbc pdo_odbc || die |
761 | } |
762 | |
763 | src_install_php-process() |
764 | { |
765 | install_php_extensions sysvmsg sysvsem sysvshm posix || die |
766 | } |
767 | |
768 | src_install_php-sqlite() |
769 | { |
770 | install_php_extensions sqlite3 pdo_sqlite || die |
771 | } |
772 | |
773 | src_install_php-xml() |
774 | { |
775 | install_php_extensions dom wddx xmlreader xmlwriter xsl || die |
776 | } |