Contents of /trunk/extras/php/php-5.4.8-r1.smage2
Parent Directory | Revision Log
Revision 13938 -
(show annotations)
(download)
Thu Nov 1 01:21:30 2012 UTC (11 years, 10 months ago) by niro
File size: 17143 byte(s)
Thu Nov 1 01:21:30 2012 UTC (11 years, 10 months ago) by niro
File size: 17143 byte(s)
-fixed wrong directory
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 | DEPEND_LDAP=">= net-nds/openldap-2.4" |
66 | DEPEND_MYSQL=">= dev-db/mysql5-5.5" |
67 | DEPEND_ODBC=">= dev-db/unixodbc-2.3" |
68 | DEPEND_PCRE=">= dev-libs/libpcre-8.30" |
69 | DEPEMD_SASL=">= dev-libs/cyrus-sasl-2.1.23" |
70 | DEPEND_SQLITE=">= dev-db/sqlite-3.7" |
71 | DEPEND_TIDY=">= app-text/htmltidy-1.46" |
72 | DEPEND_XML=">= dev-libs/libxml2-2.7" |
73 | DEPEND_XSLT=">= dev-libs/libxslt-1.1.26" |
74 | DEPEND_SYSTEMD=">= sys-apps/systemd-195" |
75 | |
76 | # ToDO: mcrypt, imap, mhash, maintainer-zts, intl |
77 | SDEPEND="${DEPEND_COMMON} |
78 | ${DEPEND_APACHE} |
79 | ${DEPEND_ASPELL} |
80 | ${DEPEND_BDB} |
81 | ${DEPEND_CURL} |
82 | ${DEPEND_ENCHANT} |
83 | ${DEPEND_GD} |
84 | ${DEPEND_GMP} |
85 | ${DEPEND_ICU} |
86 | ${DEPEND_INTL} |
87 | ${DEPEND_LDAP} |
88 | ${DEPEND_MYSQL} |
89 | ${DEPEND_ODBC} |
90 | ${DEPEND_PCRE} |
91 | ${DEPEND_SASL} |
92 | ${DEPEND_SQLITE} |
93 | ${DEPEND_TIDY} |
94 | ${DEPEND_XML} |
95 | ${DEPEND_XSLT} |
96 | ${DEPEND_SYSTEMD} |
97 | >= sys-dev/m4-1.4 |
98 | >= sys-dev/libtool-1.5 |
99 | >= sys-dev/gettext-0.17 |
100 | >= sys-apps/sed-4" |
101 | |
102 | SRCFILE="${PNAME/5/}-${PVER}.tar.bz2" |
103 | SRCDIR="${BUILDDIR}/${PNAME/5/}-${PVER}" |
104 | |
105 | sminclude mtools php |
106 | |
107 | SRC_URI=( |
108 | http://de2.php.net/distributions/${SRCFILE} |
109 | http://us2.php.net/distributions/${SRCFILE} |
110 | mirror://${PNAME}/${SRCFILE} |
111 | mirror://${PNAME}/${PNAME}-5.2.4-multilib.patch |
112 | mirror://${PNAME}/${PNAME}-5.2.3-httpd-config.patch |
113 | mirror://${PNAME}/${PNAME}-5.2.4-build-dir.patch |
114 | mirror://${PNAME}/php5_module.conf |
115 | mirror://${PNAME}/php-fpm.conf |
116 | mirror://${PNAME}/php-fpm-www.conf |
117 | mirror://${PNAME}/php-fpm.service |
118 | mirror://${PNAME}/php-fpm.logrotate |
119 | mirror://${PNAME}/php-fpm.confd |
120 | mirror://${PNAME}/php-fpm.tmpfilesd |
121 | ) |
122 | |
123 | # 5.4 stable series |
124 | UP2TAG="5.4" |
125 | UP2DATE="updatecmd ${HOMEPAGE} | grep 'Current.*${UP2TAG}.*Stable' | sed 's/.*\:\ \(.*\)/\1/'" |
126 | |
127 | split_info_php() |
128 | { |
129 | DESCRIPTION="PHP Hypertext Preprocessor, a scripting language especially suited for web development." |
130 | DEPEND="${DEPEND_COMMON} |
131 | ${DEPEND_XML} |
132 | ${DEPEND_PCRE}" |
133 | } |
134 | |
135 | split_info_php-cgi() |
136 | { |
137 | DESCRIPTION="GI and FCGI SAPI for PHP." |
138 | DEPEND="== dev-lang/php-${PVER} |
139 | ${DEPEND_XML} |
140 | ${DEPEND_PCRE}" |
141 | PCAT="dev-php" |
142 | } |
143 | |
144 | split_info_php-apache() |
145 | { |
146 | DESCRIPTION="Apache SAPI for PHP." |
147 | DEPEND="== dev-lang/php-${PVER} |
148 | ${DEPEND_XML} |
149 | ${DEPEND_PCRE} |
150 | ${DEPEND_APACHE}" |
151 | PCAT="dev-php" |
152 | } |
153 | |
154 | split_info_php-embedded() |
155 | { |
156 | DESCRIPTION="PHP library for embedding in applications." |
157 | DEPEND="== dev-lang/php-${PVER} |
158 | ${DEPEND_XML} |
159 | ${DEPEND_PCRE}" |
160 | PCAT="dev-php" |
161 | } |
162 | |
163 | split_info_php-pear() |
164 | { |
165 | DESCRIPTION="PHP Extension and Application Repository." |
166 | DEPEND="== dev-lang/php-${PVER}" |
167 | PCAT="dev-php" |
168 | } |
169 | |
170 | split_info_php-fpm() |
171 | { |
172 | DESCRIPTION="PHP FastCGI Process Manager." |
173 | DEPEND="== dev-lang/php-${PVER} |
174 | ${DEPEND_SYSTEMD}" |
175 | PCAT="dev-php" |
176 | } |
177 | |
178 | split_info_php-bcmath() |
179 | { |
180 | DESCRIPTION="A module for PHP applications for using the bcmath library." |
181 | DEPEND="== dev-lang/php-${PVER}" |
182 | PCAT="dev-php" |
183 | } |
184 | |
185 | split_info_php-curl() |
186 | { |
187 | DESCRIPTION="A module for PHP applications that use curl." |
188 | DEPEND="== dev-lang/php-${PVER} |
189 | ${DEPEND_IDN} |
190 | ${DEPEND_CURL} |
191 | ${DEPEND_LDAP}" |
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="--with-libdir=$(mlibdir) \ |
395 | --with-config-file-path=${PHP_CONFIG_DIR} \ |
396 | --with-config-file-scan-dir=${PHP_CONFIG_SCAN_DIR} \ |
397 | --enable-inline-optimization \ |
398 | --disable-rpath \ |
399 | --disable-debug \ |
400 | --disable-static \ |
401 | --enable-shared \ |
402 | --without-pear" |
403 | |
404 | php_extensions="--with-zlib \ |
405 | --with-bz2=shared \ |
406 | --enable-bcmath=shared \ |
407 | --enable-calendar=shared \ |
408 | --enable-exif=shared \ |
409 | --enable-ftp=shared \ |
410 | --with-gettext=shared \ |
411 | --enable-mbstring=shared \ |
412 | --enable-mbregex \ |
413 | --with-ncurses=shared \ |
414 | --with-openssl=shared \ |
415 | --with-gd=shared \ |
416 | --enable-gd-native-ttf \ |
417 | --with-freetype-dir=shared,/usr \ |
418 | --with-ttf \ |
419 | --with-t1lib=/usr \ |
420 | --with-pcre-regex \ |
421 | --with-gmp=shared \ |
422 | --with-curl=shared \ |
423 | --with-curlwrappers \ |
424 | --enable-dba=shared \ |
425 | --with-db4=shared \ |
426 | --with-mysql=shared \ |
427 | --with-mysqli=shared \ |
428 | --with-unixODBC=shared,/usr \ |
429 | --with-sqlite=shared \ |
430 | --with-sqlite3=shared \ |
431 | --enable-pdo=shared \ |
432 | --with-pdo-odbc=shared,unixODBC,/usr \ |
433 | --with-pdo-mysql=shared,/usr \ |
434 | --with-pdo-sqlite=shared,/usr \ |
435 | --enable-dbase=shared \ |
436 | --enable-dom=shared \ |
437 | --with-xmlrpc=shared \ |
438 | --enable-xmlreader=shared \ |
439 | --enable-xmlwriter=shared \ |
440 | --with-xsl=shared,/usr \ |
441 | --enable-wddx=shared \ |
442 | --enable-soap=shared \ |
443 | --enable-json=shared \ |
444 | --enable-zip=shared \ |
445 | --enable-phar=shared \ |
446 | --enable-posix=shared \ |
447 | --enable-fileinfo=shared \ |
448 | --enable-intl=shared \ |
449 | --enable-sockets=shared \ |
450 | --enable-sysvsem=shared \ |
451 | --enable-sysvshm=shared \ |
452 | --enable-sysvmsg=shared \ |
453 | --with-tidy=shared \ |
454 | --with-ldap=shared \ |
455 | --with-ldap-sasl \ |
456 | --with-enchant=shared \ |
457 | --with-pspell=shared" |
458 | # ToDo: |
459 | # --with-mcrypt=shared \ |
460 | # --with-mhash=shared \ |
461 | # --with-imap=shared \ |
462 | # --with-imap-ssl \ |
463 | # --enable-maintainer-zts <- threaded apache2 support |
464 | |
465 | # required for fpm |
466 | php_disable_shared_extensions="--without-gd \ |
467 | --disable-dom \ |
468 | --disable-dba \ |
469 | --without-unixODBC \ |
470 | --disable-xmlreader \ |
471 | --disable-xmlwriter \ |
472 | --without-sqlite3 \ |
473 | --disable-phar \ |
474 | --disable-fileinfo \ |
475 | --disable-json \ |
476 | --without-pspell \ |
477 | --disable-wddx \ |
478 | --without-curl \ |
479 | --disable-posix \ |
480 | --disable-sysvmsg \ |
481 | --disable-sysvshm \ |
482 | --disable-sysvsem" |
483 | |
484 | # |
485 | # build php: |
486 | # |
487 | |
488 | # prepare build outside of the SRCDIR |
489 | install -d ${BUILDDIR}/build-php |
490 | cd ${BUILDDIR}/build-php |
491 | ln -snf ${SRCDIR}/configure |
492 | |
493 | mconfigure \ |
494 | --srcdir=${SRCDIR} \ |
495 | ${php_base_config} \ |
496 | --disable-cgi \ |
497 | --with-readline \ |
498 | ${php_extensions} \ |
499 | || die |
500 | |
501 | mmake || die |
502 | |
503 | |
504 | # |
505 | # build cgi/fastcgi |
506 | # |
507 | |
508 | # prepare build with the previous run, to save a lot of time |
509 | current_run=cgi |
510 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
511 | cd ${BUILDDIR}/build-${current_run} |
512 | |
513 | mconfigure \ |
514 | --srcdir=${SRCDIR} \ |
515 | ${php_base_config} \ |
516 | --enable-cgi \ |
517 | --enable-force-cgi-redirect \ |
518 | --enable-fastcgi \ |
519 | --disable-cli \ |
520 | ${php_extensions} \ |
521 | || die |
522 | |
523 | mmake || die |
524 | |
525 | |
526 | # |
527 | # build apache mod |
528 | # |
529 | |
530 | # prepare build with the previous run, to save a lot of time |
531 | current_run=apache |
532 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
533 | cd ${BUILDDIR}/build-${current_run} |
534 | |
535 | mconfigure \ |
536 | --srcdir=${SRCDIR} \ |
537 | ${php_base_config} \ |
538 | --with-apxs2 \ |
539 | --disable-cli \ |
540 | ${php_extensions} \ |
541 | || die |
542 | |
543 | mmake || die |
544 | |
545 | |
546 | # |
547 | # build embedded |
548 | # |
549 | |
550 | # prepare build with the previous run, to save a lot of time |
551 | current_run=embedded |
552 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
553 | cd ${BUILDDIR}/build-${current_run} |
554 | |
555 | mconfigure \ |
556 | --srcdir=${SRCDIR} \ |
557 | ${php_base_config} \ |
558 | --enable-embed=shared \ |
559 | --disable-cli \ |
560 | ${php_extensions} \ |
561 | || die |
562 | |
563 | mmake || die |
564 | |
565 | |
566 | # |
567 | # build pear |
568 | # |
569 | |
570 | # prepare build with the previous run, to save a lot of time |
571 | current_run=pear |
572 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
573 | cd ${BUILDDIR}/build-${current_run} |
574 | |
575 | mconfigure \ |
576 | --srcdir=${SRCDIR} \ |
577 | ${php_base_config} \ |
578 | --disable-cgi \ |
579 | --with-readline \ |
580 | --enable-pcntl \ |
581 | --with-pear \ |
582 | ${php_extensions} \ |
583 | || die |
584 | |
585 | mmake || die |
586 | |
587 | # |
588 | # build fpm |
589 | # |
590 | |
591 | # prepare build with the previous run, to save a lot of time |
592 | current_run=fpm |
593 | cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run} |
594 | cd ${BUILDDIR}/build-${current_run} |
595 | |
596 | mconfigure \ |
597 | --srcdir=${SRCDIR} \ |
598 | ${php_base_config} \ |
599 | --enable-fpm \ |
600 | --without-mysql \ |
601 | --disable-pdo \ |
602 | ${php_disable_shared_extensions} \ |
603 | || die |
604 | |
605 | } |
606 | |
607 | src_install_php() |
608 | { |
609 | cd ${BUILDDIR}/build-php |
610 | mmake -j1 INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install || die |
611 | |
612 | # fix a broken symlink |
613 | mlink phar.phar /usr/bin/phar || die |
614 | |
615 | local php_ini=${SRCDIR}/php.ini-production |
616 | |
617 | # php config |
618 | minstalldir /etc/php/conf.d || die |
619 | # remove windows remark |
620 | sed -i -e '/^; extension_dir = "ext"/d' -e '/^; On windows:$/d' ${php_ini} || die |
621 | # fix extensions dir location |
622 | sed -i "s:^; \(extension_dir =\).*:\1 ${PHP5_EXTENSIONS_DIR}:" ${php_ini} || die |
623 | # allow short php open-tags |
624 | sed -i "s:^\(short_open_tag =\).*:\1 On:" ${php_ini} || die |
625 | minstallfile ${php_ini} /etc/php/php.ini || die |
626 | |
627 | # fix extension_dir also in phmp-config |
628 | sed -i "s:^\(extension_dir=\).*:\1${PHP_EXTENSIONS_DIR}:" ${BINDIR}/usr/bin/php-config || die |
629 | |
630 | # remove all extensions provided by other split-packages |
631 | local ext |
632 | for ext in curl bcmath dba enchant gd gmp ldap mbstring mysql mysqli \ |
633 | pdo_mysql odbc pdo_odbc pdo pspell sqlite3 pdo_sqlite \ |
634 | soap sysvmsg sysvsem sysvshm posix tidy xsl wddx dom xmlreader \ |
635 | xmlwriter xmlrpc |
636 | do |
637 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/${ext}.so || die ${ext} |
638 | done |
639 | |
640 | # remove all static extensions too |
641 | rm ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.a || die |
642 | |
643 | # enable all default extensions |
644 | local MCONFIG |
645 | local i |
646 | for i in $(ls ${BINDIR}/${PHP_EXTENSIONS_DIR}/*.so | sort ) |
647 | do |
648 | MCONFIG="/etc/php/conf.d/$(basename ${i} .so).ini" |
649 | mclearconfig || die |
650 | maddconfig "extension=$(basename ${i})" || die |
651 | done |
652 | |
653 | # disable config-protect for modules conf dir |
654 | minstalldir /etc/env.d || die |
655 | MCONFIG="/etc/env.d/30php" |
656 | mclearconfig || die |
657 | maddconfig 'CONFIG_PROTECT_MASK="/etc/php/conf.d"' || die |
658 | |
659 | minstalldocs CREDITS CODING_STANDARDS EXTENSIONS LICENSE NEWS README* TODO* || die |
660 | } |
661 | |
662 | src_install_php-cgi() |
663 | { |
664 | cd ${BUILDDIR}/build-cgi |
665 | minstallexec sapi/cgi/php-cgi || die |
666 | } |
667 | |
668 | src_install_php-apache() |
669 | { |
670 | cd ${BUILDDIR}/build-apache |
671 | |
672 | # install apache sapi |
673 | local APACHE_MOD_DIR="$(apxs -q LIBEXECDIR)" |
674 | minstalldir ${APACHE_MOD_DIR} || die |
675 | minstallexec libs/libphp5.so ${APACHE_MOD_DIR} || die |
676 | |
677 | # install apache module config |
678 | local APACHE_SYSCONFDIR="$(apxs -q SYSCONFDIR)" |
679 | minstalldir ${APACHE_SYSCONFDIR}/modules.d || die |
680 | minstallfile -s php5_module.conf ${APACHE_SYSCONFDIR}/modules.d/php5.conf || die |
681 | } |
682 | |
683 | src_install_php-embedded() |
684 | { |
685 | cd ${BUILDDIR}/build-embedded |
686 | |
687 | # install sapi library |
688 | minstalldir /usr/$(mlibdir) || die |
689 | minstallexec libs/libphp5.so /usr/$(mlibdir)/libphp5.so || die |
690 | |
691 | # install include |
692 | minstalldir /usr/include/${PNAME}/sapi/embed || die |
693 | minstallfile ${SRCDIR}/sapi/embed/php_embed.h /usr/include/${PNAME}/sapi/embed || die |
694 | } |
695 | |
696 | src_install_php-pear() |
697 | { |
698 | cd ${BUILDDIR}/build-pear |
699 | mmake INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP_PEAR_DIR} install-pear || die |
700 | |
701 | local i |
702 | for i in $(find ${BINDIR}/ -name '.*') |
703 | do |
704 | if [[ -e ${i} ]] |
705 | then |
706 | rm -rf ${i} || die ${i} |
707 | fi |
708 | done |
709 | } |
710 | |
711 | src_install_php-fpm() |
712 | { |
713 | cd ${BUILDDIR}/build-fpm |
714 | mmake INSTALL_ROOT=${BINDIR} install-fpm || die |
715 | |
716 | mkeepdir /var/log/php-fpm || die |
717 | mkeepdir /run/php-fpm || die |
718 | |
719 | # config |
720 | minstalldir /etc/php || die |
721 | minstalldir /etc/php/fpm.conf.d || die |
722 | minstallfile -s php-fpm.conf /etc/php/ || die |
723 | minstallfile -s php-fpm-www.conf /etc/php/fpm.conf.d/www.conf || die |
724 | |
725 | # systemd |
726 | minstalltmp php-fpm.tmpfilesd php-fpm.conf || die |
727 | minstallunit php-fpm.service || die |
728 | minstalllog php-fpm.logrotate php-fpm || die |
729 | minstallconf php-fpm.confd php-fpm || die |
730 | } |
731 | |
732 | # being a little tricky here: |
733 | for subpackage in ${SPLIT_PACKAGES} |
734 | do |
735 | # exclude all other packages than php-addon-modules |
736 | case ${subpackage} in |
737 | php) continue ;; |
738 | php-cgi) continue ;; |
739 | php-apache) continue ;; |
740 | php-embedded) continue ;; |
741 | php-pear) continue ;; |
742 | php-fpm) continue ;; |
743 | esac |
744 | |
745 | eval "src_install_${subpackage}(){ install_php_extensions ${subpackage#*-} || die; }" |
746 | done |
747 | |
748 | # exceptions |
749 | src_install_php-mysql() |
750 | { |
751 | install_php_extensions mysql mysqli pdo_mysql || die |
752 | } |
753 | |
754 | src_install_php-odbc() |
755 | { |
756 | install_php_extensions odbc pdo_odbc || die |
757 | } |
758 | |
759 | src_install_php-process() |
760 | { |
761 | install_php_extensions sysvmsg sysvsem sysvshm posix || die |
762 | } |
763 | |
764 | src_install_php-sqlite() |
765 | { |
766 | install_php_extensions sqlite3 pdo_sqlite || die |
767 | } |
768 | |
769 | src_install_php-xml() |
770 | { |
771 | install_php_extensions dom wddx xmlreader xmlwriter xsl || die |
772 | } |