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