Magellan Linux

Contents of /trunk/extras/php5/php5-5.3.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5100 - (show annotations) (download)
Sun Mar 7 14:50:50 2010 UTC (14 years, 1 month ago) by niro
File size: 15118 byte(s)
-add libidn dep to php5-curl
1 # $Id$
2
3 PNAME="php5"
4 PVER="5.3.2"
5 PBUILD="r1"
6
7 PCATEGORIE="dev-lang"
8 STATE="unstable"
9
10 #DESCRIPTION="PHP Hypertext Preprocessor, a scripting language especially suited for web development."
11 HOMEPAGE="http://php.net/"
12
13 # ToDO: mcrypt, imap, mhash, maintainer-zts, intl
14 SDEPEND=">= net-www/apache2-2.2.14
15 >= sys-libs/ncurses-5.7
16 >= sys-libs/readline-6.0
17 >= sys-libs/zlib-1.2
18 >= app-arch/bzip2-1
19 >= dev-libs/libxml2-2.7
20 >= dev-libs/libxslt-1.1.26
21 >= dev-libs/openssl-0.9.8
22 >= dev-libs/libpcre-8.0
23 >= dev-libs/gmp-4.3
24 >= media-libs/libjpeg-7
25 >= media-libs/libpng-1.2.40
26 >= x11-libs/libXpm-3.5
27 >= media-libs/gd-2.0.35
28 >= media-libs/freetype-2.3
29 >= media-libs/t1lib-5.1
30 >= net-misc/curl-7.19
31 >= app-text/aspell-0.60
32 >= app-text/enchant-1.5
33 >= app-text/htmltidy-1.46
34 >= dev-db/db-4.8
35 >= dev-db/sqlite-3.6
36 >= dev-db/mysql5-5.1
37 >= dev-db/unixodbc-2.2
38 >= net-dns/libidn-1.15
39 >= dev-libs/cyrus-sasl-2.1.23
40 >= net-nds/openldap-2.4
41 >= sys-dev/m4-1.4
42 >= sys-dev/libtool-1.5
43 >= sys-dev/gettext-0.17
44 >= sys-apps/sed-4"
45
46 SRCFILE="${PNAME/5/}-${PVER}.tar.bz2"
47 SRCDIR="${BUILDDIR}/${PNAME/5/}-${PVER}"
48
49 SUHOSIN_PVER="0.9.9.1"
50 PHP5_EXTENSIONS_DIR="/usr/$(mlibdir)/${PNAME}/extensions"
51 PHP5_PEAR_INSTALLDIR="/usr/share/${PNAME}/pear"
52
53 SPLIT_PACKAGES="${PNAME}
54 ${PNAME}-cgi
55 ${PNAME}-apache
56 ${PNAME}-embedded
57 ${PNAME}-pear
58 ${PNAME}-bcmath
59 ${PNAME}-curl
60 ${PNAME}-dba
61 ${PNAME}-enchant
62 ${PNAME}-gd
63 ${PNAME}-gmp
64 ${PNAME}-ldap
65 ${PNAME}-mbstring
66 ${PNAME}-pdo
67 ${PNAME}-mysql
68 ${PNAME}-odbc
69 ${PNAME}-process
70 ${PNAME}-pspell
71 ${PNAME}-soap
72 ${PNAME}-sqlite
73 ${PNAME}-tidy
74 ${PNAME}-xml
75 ${PNAME}-xmlrpc"
76
77 # splits with more then one module:
78 # ${PNAME}-odbc = odbc, pdo_odbc
79 # ${PNAME}-mysql = mysql, mysqli, pdo_mysql
80 # ${PNAME}-xml = xsl, wddx, dom, xmlreader, xmlwriter
81 # ${PNAME}-process = sysvmsg, sysvsem, sysvshm, posix
82 # ${PNAME}-sqlite = sqlite, sqlite3, pdo_sqlite
83
84 sminclude mtools
85
86 SRC_URI=(
87 http://de2.php.net/distributions/${SRCFILE}
88 http://us2.php.net/distributions/${SRCFILE}
89 mirror://${PNAME}/${SRCFILE}
90 mirror://${PNAME}/${PNAME}-5.2.4-multilib.patch
91 mirror://${PNAME}/${PNAME}-5.2.3-httpd-config.patch
92 mirror://${PNAME}/${PNAME}-5.2.4-build-dir.patch
93 mirror://${PNAME}/${PNAME}-${PVER}-suhosin-${SUHOSIN_PVER}.patch
94 mirror://${PNAME}/${PNAME}-${PVER}-phar.patch
95 mirror://${PNAME}/php5_module.conf
96 )
97
98 # 5.3 stable series
99 UP2TAG="5.3"
100 UP2DATE="updatecmd ${HOMEPAGE} | grep 'Current.*${UP2TAG}.*Stable' | sed 's/.*\:\ \(.*\)/\1/'"
101
102 # install-helper function
103 install_php5_extensions()
104 {
105 local extensions="$@"
106 [[ -z ${extensions} ]] && die "no extensions given"
107
108 # set default PHP5_BUILD_DIR, env can override this
109 : ${PHP5_BUILD_DIR="${BUILDDIR}/build-php"}
110
111 cd ${PHP5_BUILD_DIR}
112
113 # needed directories
114 minstalldir /etc/${PNAME}/conf.d || die
115 minstalldir ${PHP5_EXTENSIONS_DIR} || die
116
117 local ext
118 for ext in ${extensions}
119 do
120 # install extensions and the config ini
121 minstallexec modules/${ext}.so ${PHP5_EXTENSIONS_DIR} || die "mod ${ext}"
122 echo "extension=${ext}.so" > ${BINDIR}/etc/${PNAME}/conf.d/${ext}.ini || die "ini ${ext}"
123 done
124 }
125
126
127 split_info_php5()
128 {
129 DESCRIPTION="PHP Hypertext Preprocessor, a scripting language especially suited for web development."
130 DEPEND=">= sys-libs/ncurses-5.7
131 >= sys-libs/readline-6.0
132 >= sys-libs/zlib-1.2
133 >= app-arch/bzip2-1
134 >= dev-libs/libxml2-2.7
135 >= dev-libs/openssl-0.9.8
136 >= dev-libs/libpcre-8.0"
137 }
138
139 split_info_php5-cgi()
140 {
141 DESCRIPTION="GI and FCGI SAPI for PHP."
142 DEPEND="== dev-lang/php5-${PVER}
143 >= dev-libs/libxml2-2.7
144 >= dev-libs/libpcre-8"
145 }
146
147 split_info_php5-apache()
148 {
149 DESCRIPTION="Apache SAPI for PHP."
150 DEPEND="== dev-lang/php5-${PVER}
151 >= dev-libs/libxml2-2.7
152 >= dev-libs/libpcre-8
153 >= net-www/apache2-2.2"
154 }
155
156 split_info_php5-embedded()
157 {
158 DESCRIPTION="PHP library for embedding in applications."
159 DEPEND="== dev-lang/php5-${PVER}
160 >= dev-libs/libxml2-2.7
161 >= dev-libs/libpcre-8"
162 }
163
164 split_info_php5-pear()
165 {
166 DESCRIPTION="PHP Extension and Application Repository."
167 DEPEND="== dev-lang/php5-${PVER}"
168 }
169
170 split_info_php5-bcmath()
171 {
172 DESCRIPTION="A module for PHP applications for using the bcmath library."
173 DEPEND="== dev-lang/php5-${PVER}"
174 }
175
176 split_info_php5-curl()
177 {
178 DESCRIPTION="A module for PHP applications that use curl."
179 DEPEND="== dev-lang/php5-${PVER}
180 >= net-dns/libidn-1.15
181 >= net-misc/curl-7
182 >= net-nds/openldap-2.4"
183 }
184
185 split_info_php5-dba()
186 {
187 DESCRIPTION="A database abstraction layer module for PHP applications."
188 DEPEND="== dev-lang/php5-${PVER}"
189 }
190
191 split_info_php5-enchant()
192 {
193 DESCRIPTION="Human Language and Character Encoding Support."
194 DEPEND="== dev-lang/php5-${PVER}
195 >= app-text/enchant-1.5"
196 }
197
198 split_info_php5-gd()
199 {
200 DESCRIPTION="A module for PHP applications for using the gd graphics library."
201 DEPEND="== dev-lang/php5-${PVER}
202 >= media-libs/libjpeg-7
203 >= media-libs/libpng-1.2.40
204 >= x11-libs/libXpm-3.5
205 >= media-libs/freetype-2.3
206 >= media-libs/t1lib-5.1
207 >= media-libs/gd-2.0.35"
208 }
209
210 split_info_php5-gmp()
211 {
212 DESCRIPTION="A module for PHP applications for using the gmp library."
213 DEPEND="== dev-lang/php5-${PVER}
214 >= dev-libs/gmp-4.3"
215 }
216
217 split_info_php5-ldap()
218 {
219 DESCRIPTION="A module for PHP applications that use LDAP."
220 DEPEND="== dev-lang/php5-${PVER}
221 >= dev-libs/cyrus-sasl-2.1.23
222 >= net-nds/openldap-2.4"
223 }
224
225 split_info_php5-mbstring()
226 {
227 DESCRIPTION="A module for PHP applications which need multi-byte string handling."
228 DEPEND="== dev-lang/php5-${PVER}"
229 }
230
231 split_info_php5-mysql()
232 {
233 DESCRIPTION="Modules for PHP applications that use MySQL databases."
234 DEPEND="== dev-lang/php5-${PVER}
235 == dev-lang/php5-pdo-${PVER}
236 >= dev-db/mysql5-5.1"
237 }
238
239 split_info_php5-odbc()
240 {
241 DESCRIPTION="Modules for PHP applications that use ODBC databases."
242 DEPEND="== dev-lang/php5-${PVER}
243 == dev-lang/php5-pdo-${PVER}
244 >= dev-db/unixodbc-2.2"
245 }
246
247 split_info_php5-pdo()
248 {
249 DESCRIPTION="A database access abstraction module for PHP applications."
250 DEPEND="== dev-lang/php5-${PVER}"
251 }
252
253 split_info_php5-process()
254 {
255 DESCRIPTION="Modules for PHP script using system process interfaces."
256 DEPEND="== dev-lang/php5-${PVER}"
257 }
258
259 split_info_php5-pspell()
260 {
261 DESCRIPTION="A module for PHP applications for using pspell interfaces."
262 DEPEND="== dev-lang/php5-${PVER}
263 >= app-text/aspell-0.60"
264 }
265
266 split_info_php5-soap()
267 {
268 DESCRIPTION="A module for PHP applications that use the SOAP protocol."
269 DEPEND="== dev-lang/php5-${PVER}
270 >= dev-libs/libxml2-2.7"
271 }
272
273 split_info_php5-sqlite()
274 {
275 DESCRIPTION="Modules for PHP applications that use SQLite databases."
276 DEPEND="== dev-lang/php5-${PVER}
277 == dev-lang/php5-pdo-${PVER}
278 >= dev-db/sqlite-3.6"
279 }
280
281 split_info_php5-tidy()
282 {
283 DESCRIPTION="Standard PHP module provides tidy library support."
284 DEPEND="== dev-lang/php5-${PVER}
285 >= app-text/htmltidy-1.46"
286 }
287
288 split_info_php5-xml()
289 {
290 DESCRIPTION="Modules for PHP applications which use XML."
291 DEPEND="== dev-lang/php5-${PVER}
292 >= dev-libs/libxml2-2.7
293 >= dev-libs/libxslt-1.1.26"
294 }
295
296 split_info_php5-xmlrpc()
297 {
298 DESCRIPTION="A module for PHP applications which use the XML-RPC protocol."
299 DEPEND="== dev-lang/php5-${PVER}
300 >= dev-libs/libxml2-2.7"
301 }
302
303 src_prepare()
304 {
305 munpack ${SRCFILE} || die
306 cd ${SRCDIR}
307
308 # version branding
309 sed -i "s:^\(EXTRA_VERSION=\).*:\1-magellan-${PBUILD}:" configure.in || die
310
311 # fixes multilib search pathes
312 mpatch ${PNAME}-5.2.4-multilib.patch || die
313
314 # do not touch the system httpd.conf
315 mpatch ${PNAME}-5.2.3-httpd-config.patch || die
316
317 # fixes build dir -> /usr/lib/php5/build
318 mpatch ${PNAME}-5.2.4-build-dir.patch || die
319
320 # hardend php core patch
321 # see: http://www.hardened-php.net/suhosin/index.html
322 mpatch ${PNAME}-${PVER}-suhosin-${SUHOSIN_PVER}.patch || die
323
324 # fix phar install issues, see http://bugs.php.net/50578
325 mpatch ${PNAME}-${PVER}-phar.patch || die
326
327 # fully regenerate aclocal too
328 rm aclocal.m4 || die
329
330 # rebuild configure
331 autoreconf --force --install --verbose || die
332
333 # force use of system libtool
334 mlibtoolize || die
335 }
336
337 src_compile()
338 {
339 local php_base_config
340 local php_extensions
341 local current_run
342
343 # --with-libdir needed, doesn't honor --libdir
344 php_base_config="--with-libdir=$(mlibdir) \
345 --with-config-file-path=/etc/${PNAME} \
346 --with-config-file-scan-dir=/etc/${PNAME}/conf.d \
347 --enable-inline-optimization \
348 --enable-discard-path \
349 --disable-debug \
350 --disable-static \
351 --enable-shared \
352 --without-pear"
353
354 php_extensions="--with-zlib \
355 --with-bz2=shared \
356 --enable-bcmath=shared \
357 --enable-calendar=shared \
358 --enable-exif=shared \
359 --enable-ftp=shared \
360 --with-gettext=shared \
361 --enable-mbstring=shared \
362 --enable-mbregex \
363 --with-ncurses=shared \
364 --with-openssl=shared \
365 --with-gd=shared,/usr \
366 --enable-gd-native-ttf \
367 --with-freetype-dir=shared,/usr \
368 --with-ttf \
369 --with-t1lib=/usr \
370 --with-pcre-regex \
371 --with-gmp=shared \
372 --with-curl=shared \
373 --with-curlwrappers \
374 --enable-dba=shared \
375 --with-db4=shared \
376 --with-mysql=shared \
377 --with-mysqli=shared \
378 --with-unixODBC=shared,/usr \
379 --with-sqlite=shared \
380 --with-sqlite3=shared \
381 --enable-pdo=shared \
382 --with-pdo-odbc=shared,unixODBC,/usr \
383 --with-pdo-mysql=shared,/usr \
384 --with-pdo-sqlite=shared,/usr \
385 --enable-dbase=shared \
386 --enable-dom=shared \
387 --with-xmlrpc=shared \
388 --enable-xmlreader=shared \
389 --enable-xmlwriter=shared \
390 --with-xsl=shared,/usr \
391 --enable-wddx=shared \
392 --enable-soap=shared \
393 --enable-json=shared \
394 --enable-zip=shared \
395 --enable-phar=shared \
396 --enable-posix=shared \
397 --enable-fileinfo=shared \
398 --enable-sockets=shared \
399 --enable-sysvsem=shared \
400 --enable-sysvshm=shared \
401 --enable-sysvmsg=shared \
402 --with-tidy=shared \
403 --with-ldap=shared \
404 --with-ldap-sasl \
405 --with-enchant=shared \
406 --with-pspell=shared"
407 # ToDo:
408 # --with-mcrypt=shared \
409 # --with-mhash=shared \
410 # --with-imap=shared \
411 # --with-imap-ssl \
412 # --enable-maintainer-zts <- threaded apache2 support
413
414
415 #
416 # build php:
417 #
418
419 # prepare build outside of the SRCDIR
420 install -d ${BUILDDIR}/build-php
421 cd ${BUILDDIR}/build-php
422 ln -snf ${SRCDIR}/configure
423
424 mconfigure \
425 --srcdir=${SRCDIR} \
426 ${php_base_config} \
427 --disable-cgi \
428 --with-readline \
429 ${php_extensions} \
430 || die
431
432 mmake || die
433
434
435 #
436 # build cgi/fastcgi
437 #
438
439 # prepare build with the previous run, to save a lot of time
440 current_run=cgi
441 cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run}
442 cd ${BUILDDIR}/build-${current_run}
443
444 mconfigure \
445 --srcdir=${SRCDIR} \
446 ${php_base_config} \
447 --enable-cgi \
448 --enable-force-cgi-redirect \
449 --enable-fastcgi \
450 --disable-cli \
451 ${php_extensions} \
452 || die
453
454 mmake || die
455
456
457 #
458 # build apache mod
459 #
460
461 # prepare build with the previous run, to save a lot of time
462 current_run=apache
463 cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run}
464 cd ${BUILDDIR}/build-${current_run}
465
466 mconfigure \
467 --srcdir=${SRCDIR} \
468 ${php_base_config} \
469 --with-apxs2 \
470 --disable-cli \
471 ${php_extensions} \
472 || die
473
474 mmake || die
475
476
477 #
478 # build embedded
479 #
480
481 # prepare build with the previous run, to save a lot of time
482 current_run=embedded
483 cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run}
484 cd ${BUILDDIR}/build-${current_run}
485
486 mconfigure \
487 --srcdir=${SRCDIR} \
488 ${php_base_config} \
489 --enable-embed=shared \
490 --disable-cli \
491 ${php_extensions} \
492 || die
493
494 mmake || die
495
496
497 #
498 # build pear
499 #
500
501 # prepare build with the previous run, to save a lot of time
502 current_run=pear
503 cp -a ${BUILDDIR}/build-php ${BUILDDIR}/build-${current_run}
504 cd ${BUILDDIR}/build-${current_run}
505
506 mconfigure \
507 --srcdir=${SRCDIR} \
508 ${php_base_config} \
509 --disable-cgi \
510 --with-readline \
511 --enable-pcntl \
512 --with-pear \
513 ${php_extensions} \
514 || die
515
516 mmake || die
517 }
518
519 src_install_php5()
520 {
521 cd ${BUILDDIR}/build-php
522 mmake -j1 INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP5_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP5_PEAR_INSTALLDIR} install || die
523
524 # fix a broken symlink
525 mlink phar.phar /usr/bin/phar || die
526
527 local php_ini=${SRCDIR}/php.ini-production
528
529 # php config
530 minstalldir /etc/${PNAME}/conf.d || die
531 # fix extensions dir location
532 sed -i "s:^\(extension_dir =\).*:\1 ${PHP5_EXTENSIONS_DIR}:" ${php_ini} || die
533 # allow short php open-tags
534 sed -i "s:^\(short_open_tag =\).*:\1 On:" ${php_ini} || die
535 minstallfile ${php_ini} /etc/${PNAME}/php.ini || die
536
537 # fix extension_dir also in phmp-config
538 sed -i "s:^\(extension_dir=\).*:\1${PHP5_EXTENSIONS_DIR}:" ${BINDIR}/usr/bin/php-config || die
539
540 # remove all extensions provided by other split-packages
541 local ext
542 for ext in curl bcmath dba enchant gd gmp ldap mbstring mysql mysqli \
543 pdo_mysql odbc pdo_odbc pdo pspell sqlite sqlite3 pdo_sqlite \
544 soap sysvmsg sysvsem sysvshm posix tidy xsl wddx dom xmlreader \
545 xmlwriter xmlrpc
546 do
547 rm ${BINDIR}/${PHP5_EXTENSIONS_DIR}/${ext}.so || die ${ext}
548 done
549
550 # enable all default extensions
551 local i
552 for i in $(ls ${BINDIR}/${PHP5_EXTENSIONS_DIR}/*.so | sort )
553 do
554 echo "extension=$(basename ${i})" \
555 > ${BINDIR}/etc/${PNAME}/conf.d/$(basename ${i} .so).ini || die
556 done
557
558 minstalldocs CREDITS CODING_STANDARDS EXTENSIONS LICENSE NEWS README* TODO* || die
559 }
560
561 src_install_php5-cgi()
562 {
563 cd ${BUILDDIR}/build-cgi
564 minstallexec sapi/cgi/php-cgi || die
565 }
566
567 src_install_php5-apache()
568 {
569 cd ${BUILDDIR}/build-apache
570
571 # install apache sapi
572 local APACHE_MOD_DIR="$(apxs -q LIBEXECDIR)"
573 minstalldir ${APACHE_MOD_DIR} || die
574 minstallexec libs/libphp5.so ${APACHE_MOD_DIR} || die
575
576 # install apache module config
577 local APACHE_SYSCONFDIR="$(apxs -q SYSCONFDIR)"
578 minstalldir ${APACHE_SYSCONFDIR}/modules.d || die
579 minstallfile -s php5_module.conf ${APACHE_SYSCONFDIR}/modules.d/php5.conf || die
580 }
581
582 src_install_php5-embedded()
583 {
584 cd ${BUILDDIR}/build-embedded
585
586 # install sapi library
587 minstalldir /usr/$(mlibdir) || die
588 minstallexec libs/libphp5.so /usr/$(mlibdir)/libphp5.so || die
589
590 # install include
591 minstalldir /usr/include/${PNAME}/sapi/embed || die
592 minstallfile ${SRCDIR}/sapi/embed/php_embed.h /usr/include/${PNAME}/sapi/embed || die
593 }
594
595 src_install_php5-pear()
596 {
597 cd ${BUILDDIR}/build-pear
598 mmake INSTALL_ROOT=${BINDIR} EXTENSION_DIR=${PHP5_EXTENSIONS_DIR} PEAR_INSTALLDIR=${PHP5_PEAR_INSTALLDIR} install-pear || die
599
600 local i
601 for i in $(find ${BINDIR}/ -name '.*')
602 do
603 if [[ -e ${i} ]]
604 then
605 rm -rf ${i} || die ${i}
606 fi
607 done
608 }
609
610 # being a little tricky here:
611 for subpackage in ${SPLIT_PACKAGES}
612 do
613 # exclude all other packages than php5-addon-modules
614 case ${subpackage} in
615 php5) continue ;;
616 php5-cgi) continue ;;
617 php5-apache) continue ;;
618 php5-embedded) continue ;;
619 php5-pear) continue ;;
620 esac
621
622 eval "src_install_${subpackage}(){ install_php5_extensions ${subpackage#*-} || die; }"
623 done
624
625 # exceptions
626 src_install_php5-mysql()
627 {
628 install_php5_extensions mysql mysqli pdo_mysql || die
629 }
630
631 src_install_php5-odbc()
632 {
633 install_php5_extensions odbc pdo_odbc || die
634 }
635
636 src_install_php5-process()
637 {
638 install_php5_extensions sysvmsg sysvsem sysvshm posix || die
639 }
640
641 src_install_php5-sqlite()
642 {
643 install_php5_extensions sqlite sqlite3 pdo_sqlite || die
644 }
645
646 src_install_php5-xml()
647 {
648 install_php5_extensions dom wddx xmlreader xmlwriter xsl || die
649 }

Properties

Name Value
svn:keywords Id