wok-next view php/receipt @ rev 21080

Update tiff (4.0.10): libs -> into libtiff, apps -> into tiff
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 24 02:07:02 2018 +0200 (2018-12-24)
parents d5aab818505e
children d0d2f8454109
line source
1 # SliTaz package receipt v2.
3 PACKAGE="php"
4 VERSION="5.5.13"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://www.php.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WGET_URL="http://www.php.net/distributions/$TARBALL"
14 BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
15 net-snmp-dev postgresql-dev gettext-dev openssl-dev apache-dev apr-util-dev \
16 c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \
17 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl \
18 jpeg-dev net-snmp-dev libvpx-dev apache coreutils-conditions sed re2c"
19 SPLIT="\
20 $PACKAGE-apache $PACKAGE-cherokee $PACKAGE-cli $PACKAGE-common \
21 $PACKAGE-curl $PACKAGE-dba $PACKAGE-dev $PACKAGE-gd \
22 $PACKAGE-imap $PACKAGE-ldap $PACKAGE-mcrypt $PACKAGE-mysqli \
23 $PACKAGE-mysql $PACKAGE-odbc $PACKAGE-openssl $PACKAGE-pdo-mysql \
24 $PACKAGE-pdo-pgsql $PACKAGE-pear $PACKAGE-pgsql $PACKAGE-snmp \
25 $PACKAGE-soap $PACKAGE-sqlite"
27 compile_rules() {
28 ARCH_ARGS="\
29 --enable-mbstring \
30 --enable-sockets \
31 --enable-ftp \
32 --enable-zip \
33 --enable-calendar \
34 --enable-exif \
35 --config-cache \
36 --enable-dba=shared \
37 --with-config-file-path=/etc \
38 --with-zlib \
39 --with-gettext \
40 --with-mcrypt=shared,/usr \
41 --with-mysql=shared,/usr \
42 --with-mysqli=shared \
43 --with-mysql-sock=/var/run/mysqld/mysql.sock \
44 --with-pdo-sqlite=shared,/usr \
45 --with-pgsql=shared,/usr \
46 --with-snmp=shared,/usr \
47 --enable-soap=shared,/usr \
48 --with-ldap=shared \
49 --with-imap=shared \
50 --with-imap-ssl \
51 --with-mhash \
52 --with-gd=shared \
53 --with-jpeg-dir=/usr \
54 --with-png-dir=/usr \
55 --with-vpx-dir=/usr \
56 --with-openssl=shared \
57 --with-unixODBC=shared,/usr \
58 --with-pear=/usr/share/php \
59 --with-pdo-mysql=shared \
60 --with-pdo-pgsql=shared \
61 --with-curl=shared \
62 --with-sqlite3=shared,/usr \
63 --enable-maintainer-zts"
65 sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' ext/gd/libgd/webpimg.c
66 sed -i 's/pam_start/pam_nostart/' configure
68 ./configure \
69 $ARCH_ARGS \
70 $CONFIGURE_ARGS &&
71 make $MAKEFLAGS &&
72 make -j1 INSTALL_ROOT=$install install
74 ./configure \
75 $ARCH_ARGS \
76 $CONFIGURE_ARGS \
77 --with-apxs2=/usr/bin/apxs &&
78 make $MAKEFLAGS &&
79 mkdir -p $install/etc/apache &&
80 cp /etc/apache/httpd.conf $install/etc/apache/httpd.conf &&
81 make -j1 INSTALL_ROOT=$install install || return 1
83 # Production config file.
84 mkdir -p $install/etc
85 cp $src/php.ini-production $install/etc/php.ini || return 1
86 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
87 -i $install/etc/php.ini
89 install -Dm755 $src/sapi/cgi/php-cgi $install/usr/bin/php-cgi
91 install -Dm644 $stuff/phpinfo/index.php $install/usr/share/phpinfo/index.php
92 install -Dm644 $stuff/php.desktop $install/usr/share/applications/php.desktop
93 install -Dm644 $stuff/php.png $install/usr/share/pixmaps/php.png
94 }
96 genpkg_rules() {
97 case $PACKAGE in
98 php)
99 copy usr/bin/php-cgi
100 DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
101 PROVIDE="php:lighttpd"
102 ;;
103 php-apache)
104 copy usr/share/apache/
105 CAT="development|module for apache"
106 DEPENDS="php-common apache libxml2 zlib"
107 PROVIDE="php:apache"
108 ;;
109 php-cherokee)
110 copy usr/bin/php-cgi # FIXME! the same file in "php" package
111 CAT="development|module for cherokee"
112 DEPENDS="php-common cherokee libxml2 zlib"
113 PROVIDE="php:cherokee"
114 ;;
115 php-cli)
116 copy usr/bin/php
117 CAT="development|command line interpreter"
118 DEPENDS="php-common"
119 ;;
120 php-common)
121 copy phpinfo/ php.desktop php.png php.ini
122 CAT="development|common files for PHP modules"
123 DEPENDS=" "
124 CONFIG_FILES="/etc/php.ini"
125 ;;
126 php-curl)
127 copy curl.so
128 CAT="development|curl module"
129 DEPENDS="curl php"
130 ;;
131 php-dba)
132 copy dba.so
133 CAT="development|dba module"
134 DEPENDS=" "
135 ;;
136 php-dev)
137 copy @dev
138 DEPENDS="php cyrus-sasl libldap libmysqlclient libpng \
139 libpostgresqlclient libunixODBC mhash openssl jpeg \
140 libmcrypt libtool libkrb5 libcomerr3 net-snmp"
141 ;;
142 php-gd)
143 copy gd.so
144 CAT="development|gd module"
145 DEPENDS="libpng php jpeg libvpx"
146 ;;
147 php-imap)
148 copy imap.so
149 CAT="development|imap module"
150 DEPENDS="php openssl"
151 ;;
152 php-ldap)
153 copy ldap.so
154 CAT="development|ldap module"
155 DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
156 ;;
157 php-mcrypt)
158 copy mcrypt.so
159 CAT="development|mcrypt module"
160 DEPENDS="libmcrypt php libtool"
161 ;;
162 php-mysqli)
163 copy mysqli.so
164 CAT="development|mysqli module"
165 DEPENDS="libmysqlclient php"
166 ;;
167 php-mysql)
168 copy mysql.so
169 CAT="development|mysql module"
170 DEPENDS="libmysqlclient php"
171 ;;
172 php-odbc)
173 copy odbc.so
174 CAT="development|ODBC module"
175 DEPENDS="unixODBC php"
176 ;;
177 php-openssl)
178 copy openssl.so
179 CAT="development|OpenSSL module"
180 DEPENDS="php openssl"
181 ;;
182 php-pdo-mysql)
183 copy pdo_mysql.so
184 CAT="development|PDO MySQL module"
185 DEPENDS="php php-mysql"
186 ;;
187 php-pdo-pgsql)
188 copy pdo_pgsql.so
189 CAT="development|PDO PgSQL module"
190 DEPENDS="php php-mysql libpostgresqlclient"
191 ;;
192 php-pear)
193 copy etc/pear.conf usr/bin/pe* usr/share/php/
194 CAT="development|PEAR libs"
195 DEPENDS="php-cli"
196 ;;
197 php-pgsql)
198 copy pgsql.so
199 CAT="development|postgresql module"
200 DEPENDS="postgresql php"
201 ;;
202 php-snmp)
203 copy snmp.so
204 CAT="development|snmp module"
205 DEPENDS="net-snmp php openssl"
206 ;;
207 php-soap)
208 copy soap.so
209 CAT="development|soap module"
210 DEPENDS="php libxml2"
211 ;;
212 php-sqlite)
213 copy sqlite.so sqlite3.so pdo_sqlite.so
214 CAT="development|sqlite module"
215 DEPENDS="php sqlite3"
216 ;;
217 esac
218 }
220 # -----------------------------------------------------------------------------
221 pre_install_php() {
222 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
223 /etc/init.d/lighttpd stop
224 fi
225 }
227 post_install_php() {
228 # Enable php
229 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
231 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
232 tazpkg get-install lighttpd-modules --root="$1/"
234 sed \
235 -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
236 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
237 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
238 -i "$1/etc/lighttpd/lighttpd.conf"
240 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
241 sed \
242 -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
243 -i "$1/etc/lighttpd/lighttpd.conf"
245 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" ||
246 sed \
247 -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
248 -i "$1/etc/lighttpd/lighttpd.conf"
250 fi
252 # Start Web server.
253 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]; then
254 /etc/init.d/lighttpd start
255 fi
256 }
258 # -----------------------------------------------------------------------------
259 pre_installi_php_apache() {
260 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
261 /etc/init.d/apache stop
262 fi
263 }
265 post_install_php_apache() {
266 grep -q php5_module "$1/etc/apache/httpd.conf" ||
267 {
268 sed \
269 -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
270 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
271 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
272 -i "$1/etc/apache/httpd.conf"
273 }
275 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
276 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
277 <IfModule mod_alias.c>
278 Alias /phpinfo /usr/share/phpinfo
279 </IfModule>
280 <DirectoryMatch /usr/share/phpinfo/>
281 DirectoryIndex index.php
282 Options +FollowSymLinks
283 AllowOverride None
284 Order allow,deny
285 Allow from all
286 </DirectoryMatch>
287 EOT
289 # Restart Web server.
290 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
291 /etc/init.d/apache stop
292 sleep 2
293 fi
294 if [ -z "$1" ]; then
295 /etc/init.d/apache start
296 fi
297 }
299 # -----------------------------------------------------------------------------
300 pre_install_php_cherokee() {
301 if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]; then
302 /etc/init.d/cherokee stop
303 fi
304 }
306 post_install_php_cherokee() {
307 # Enable php
308 # if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
309 # [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
310 # tazpkg get-install lighttpd-modules --root="$1/"
311 # sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
312 # -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
313 # -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
314 # -i "$1/etc/lighttpd/lighttpd.conf"
315 # grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
316 # sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
317 # -i "$1/etc/lighttpd/lighttpd.conf"
318 # grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
319 # sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
320 # -i "$1/etc/lighttpd/lighttpd.conf"
321 # fi
323 # Start Web server.
324 if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]; then
325 /etc/init.d/cherokee start
326 fi
327 }
329 # -----------------------------------------------------------------------------
330 pre_install_php_common() {
331 # Backup existing php.ini
332 if [ -f "$1/etc/php.ini" ]; then
333 cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
334 fi
335 }
337 post_install_php_common() {
338 # Restore original php.ini
339 if [ -f "$1/etc/php.ini.bak" ]; then
340 mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
341 fi
342 }
344 # -----------------------------------------------------------------------------
345 pre_install_php_curl() {
346 while read daemon file; do
347 if [ -z "$1" -a -f "/var/run/$file" ]; then
348 /etc/init.d/$daemon stop
349 fi
350 done <<EOT
351 apache apache/httpd.pid
352 lighttpd lighttpd.pid
353 EOT
354 }
356 post_install_php_curl() {
357 grep -q ^extension=curl.so "$1/etc/php.ini" ||
358 sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
360 # Start Web server.
361 while read daemon file; do
362 [ -z "$1" ] || continue
363 if [ -f "/var/run/$file" ]; then
364 /etc/init.d/$daemon stop
365 sleep 2
366 fi
367 if [ -f /etc/init.d/$daemon ]; then
368 /etc/init.d/$daemon start
369 fi
370 done <<EOT
371 apache apache/httpd.pid
372 lighttpd lighttpd.pid
373 EOT
374 }
376 pre_remove_php_curl() {
377 sed -i '/.*=curl.so.*/d' /etc/php.ini
379 # Start Web server.
380 while read daemon file; do
381 [ -z "$1" ] || continue
382 if [ -f "/var/run/$file" ]; then
383 /etc/init.d/$daemon stop
384 sleep 2
385 fi
386 if [ -f /etc/init.d/$daemon ]; then
387 /etc/init.d/$daemon start
388 fi
389 done <<EOT
390 apache apache/httpd.pid
391 lighttpd lighttpd.pid
392 EOT
393 }
395 # -----------------------------------------------------------------------------
396 pre_install_php_dba() {
397 while read daemon file; do
398 if [ -z "$1" -a -f "/var/run/$file" ]; then
399 /etc/init.d/$daemon stop
400 fi
401 done <<EOT
402 apache apache/httpd.pid
403 lighttpd lighttpd.pid
404 EOT
405 }
407 post_install_php_dba() {
408 grep -q ^extension=dba.so "$1/etc/php.ini" ||
409 sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
411 # Start Web server.
412 while read daemon file; do
413 [ -z "$1" ] || continue
414 if [ -f "/var/run/$file" ]; then
415 /etc/init.d/$daemon stop
416 sleep 2
417 fi
418 if [ -f /etc/init.d/$daemon ]; then
419 /etc/init.d/$daemon start
420 fi
421 done <<EOT
422 apache apache/httpd.pid
423 lighttpd lighttpd.pid
424 EOT
425 }
427 pre_remove_php_dba() {
428 sed -i '/.*=dba.so.*/d' /etc/php.ini
430 # Start Web server.
431 while read daemon file; do
432 [ -z "$1" ] || continue
433 if [ -f "/var/run/$file" ]; then
434 /etc/init.d/$daemon stop
435 sleep 2
436 fi
437 if [ -f /etc/init.d/$daemon ]; then
438 /etc/init.d/$daemon start
439 fi
440 done <<EOT
441 apache apache/httpd.pid
442 lighttpd lighttpd.pid
443 EOT
444 }
446 # -----------------------------------------------------------------------------
447 pre_install_php_gd() {
448 while read daemon file; do
449 if [ -z "$1" -a -f "/var/run/$file" ]; then
450 /etc/init.d/$daemon stop
451 fi
452 done <<EOT
453 apache apache/httpd.pid
454 lighttpd lighttpd.pid
455 EOT
456 }
458 post_install_php_gd() {
459 grep -q ^extension=gd.so "$1/etc/php.ini" ||
460 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
462 # Start Web server.
463 while read daemon file; do
464 [ -z "$1" ] || continue
465 if [ -z "$1" -a -f "/var/run/$file" ]; then
466 /etc/init.d/$daemon stop
467 sleep 2
468 fi
469 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
470 /etc/init.d/$daemon start
471 fi
472 done <<EOT
473 apache apache/httpd.pid
474 lighttpd lighttpd.pid
475 EOT
476 }
478 pre_remove_php_gd() {
479 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
481 # Start Web server.
482 while read daemon file; do
483 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
484 [ -z "$1" ] || continue
485 if [ -z "$1" -a -f "/var/run/$file" ]; then
486 /etc/init.d/$daemon stop
487 sleep 2
488 fi
489 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
490 /etc/init.d/$daemon start
491 fi
492 fi
493 done <<EOT
494 apache apache/httpd.pid
495 lighttpd lighttpd.pid
496 EOT
497 }
499 # -----------------------------------------------------------------------------
500 pre_install_php_imap() {
501 while read daemon file; do
502 if [ -z "$1" -a -f "/var/run/$file" ]; then
503 /etc/init.d/$daemon stop
504 fi
505 done <<EOT
506 apache apache/httpd.pid
507 lighttpd lighttpd.pid
508 EOT
509 }
511 post_install_php_imap() {
512 grep -q ^extension=imap.so "$1/etc/php.ini" ||
513 sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
515 # Start Web server.
516 while read daemon file; do
517 [ -z "$1" ] || continue
518 if [ -f "/var/run/$file" ]; then
519 /etc/init.d/$daemon stop
520 sleep 2
521 fi
522 if [ -f /etc/init.d/$daemon ]; then
523 /etc/init.d/$daemon start
524 fi
525 done <<EOT
526 apache apache/httpd.pid
527 lighttpd lighttpd.pid
528 EOT
529 }
531 pre_remove_php_imap() {
532 sed -i '/.*=imap.so.*/d' /etc/php.ini
534 # Start Web server.
535 while read daemon file; do
536 [ -z "$1" ] || continue
537 if [ -f "/var/run/$file" ]; then
538 /etc/init.d/$daemon stop
539 sleep 2
540 fi
541 if [ -f /etc/init.d/$daemon ]; then
542 /etc/init.d/$daemon start
543 fi
544 done <<EOT
545 apache apache/httpd.pid
546 lighttpd lighttpd.pid
547 EOT
548 }
550 # -----------------------------------------------------------------------------
551 pre_install_php_ldap() {
552 while read daemon file; do
553 if [ -z "$1" -a -f "/var/run/$file" ]; then
554 /etc/init.d/$daemon stop
555 fi
556 done <<EOT
557 apache apache/httpd.pid
558 lighttpd lighttpd.pid
559 EOT
560 }
562 post_install_php_ldap() {
563 grep -q ^extension=ldap.so "$1/etc/php.ini" ||
564 sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
566 # Start Web server.
567 while read daemon file; do
568 [ -z "$1" ] || continue
569 if [ -f "/var/run/$file" ]; then
570 /etc/init.d/$daemon stop
571 sleep 2
572 fi
573 if [ -f /etc/init.d/$daemon ]; then
574 /etc/init.d/$daemon start
575 fi
576 done <<EOT
577 apache apache/httpd.pid
578 lighttpd lighttpd.pid
579 EOT
580 }
582 pre_remove_php_ldap() {
583 sed -i '/.*=ldap.so.*/d' /etc/php.ini
585 # Start Web server.
586 while read daemon file; do
587 [ -z "$1" ] || continue
588 if [ -f "/var/run/$file" ]; then
589 /etc/init.d/$daemon stop
590 sleep 2
591 fi
592 if [ -f /etc/init.d/$daemon ]; then
593 /etc/init.d/$daemon start
594 fi
595 done <<EOT
596 apache apache/httpd.pid
597 lighttpd lighttpd.pid
598 EOT
599 }
601 # -----------------------------------------------------------------------------
602 pre_install_php_mcrypt() {
603 while read daemon file; do
604 if [ -z "$1" -a -f "/var/run/$file" ]; then
605 /etc/init.d/$daemon stop
606 fi
607 done <<EOT
608 apache apache/httpd.pid
609 lighttpd lighttpd.pid
610 EOT
611 }
613 post_install_php_mcrypt() {
614 grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
615 sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
617 # Start Web server.
618 while read daemon file; do
619 [ -z "$1" ] || continue
620 if [ -f "/var/run/$file" ]; then
621 /etc/init.d/$daemon stop
622 sleep 2
623 fi
624 if [ -f /etc/init.d/$daemon ]; then
625 /etc/init.d/$daemon start
626 fi
627 done <<EOT
628 apache apache/httpd.pid
629 lighttpd lighttpd.pid
630 EOT
631 }
633 pre_remove_php_mcrypt() {
634 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
636 # Start Web server.
637 while read daemon file; do
638 [ -z "$1" ] || continue
639 if [ -f "/var/run/$file" ]; then
640 /etc/init.d/$daemon stop
641 sleep 2
642 fi
643 if [ -f /etc/init.d/$daemon ]; then
644 /etc/init.d/$daemon start
645 fi
646 done <<EOT
647 apache apache/httpd.pid
648 lighttpd lighttpd.pid
649 EOT
650 }
652 # -----------------------------------------------------------------------------
653 pre_install_php_mysqli() {
654 while read daemon file; do
655 if [ -z "$1" -a -f "/var/run/$file" ]; then
656 /etc/init.d/$daemon stop
657 fi
658 done <<EOT
659 apache apache/httpd.pid
660 lighttpd lighttpd.pid
661 EOT
662 }
664 post_install_php_mysqli() {
665 grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
666 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
668 # Start Web server.
669 while read daemon file; do
670 [ -z "$1" ] || continue
671 if [ -f "/var/run/$file" ]; then
672 /etc/init.d/$daemon stop
673 sleep 2
674 fi
675 if [ -f /etc/init.d/$daemon ]; then
676 /etc/init.d/$daemon start
677 fi
678 done <<EOT
679 apache apache/httpd.pid
680 lighttpd lighttpd.pid
681 EOT
682 }
684 pre_remove_php_mysqli() {
685 sed -i '/.*=mysqli.so.*/d' /etc/php.ini
687 # Start Web server.
688 while read daemon file; do
689 [ -z "$1" ] || continue
690 if [ -f "/var/run/$file" ]; then
691 /etc/init.d/$daemon stop
692 sleep 2
693 fi
694 if [ -f /etc/init.d/$daemon ]; then
695 /etc/init.d/$daemon start
696 fi
697 done <<EOT
698 apache apache/httpd.pid
699 lighttpd lighttpd.pid
700 EOT
701 }
703 # -----------------------------------------------------------------------------
704 pre_install_php_mysql() {
705 while read daemon file; do
706 if [ -z "$1" -a -f "/var/run/$file" ]; then
707 /etc/init.d/$daemon stop
708 fi
709 done <<EOT
710 apache apache/httpd.pid
711 lighttpd lighttpd.pid
712 EOT
713 }
715 post_install_php_mysql() {
716 grep -q ^extension=mysql.so "$1/etc/php.ini" ||
717 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
719 # Start Web server.
720 while read daemon file; do
721 [ -z "$1" ] || continue
722 if [ -f "/var/run/$file" ]; then
723 /etc/init.d/$daemon stop
724 sleep 2
725 fi
726 if [ -f /etc/init.d/$daemon ]; then
727 /etc/init.d/$daemon start
728 fi
729 done <<EOT
730 apache apache/httpd.pid
731 lighttpd lighttpd.pid
732 EOT
733 }
735 pre_remove_php_mysql() {
736 sed -i '/.*=mysql.so.*/d' /etc/php.ini
738 # Start Web server.
739 while read daemon file; do
740 [ -z "$1" ] || continue
741 if [ -f "/var/run/$file" ]; then
742 /etc/init.d/$daemon stop
743 sleep 2
744 fi
745 if [ -f /etc/init.d/$daemon ]; then
746 /etc/init.d/$daemon start
747 fi
748 done <<EOT
749 apache apache/httpd.pid
750 lighttpd lighttpd.pid
751 EOT
752 }
754 # -----------------------------------------------------------------------------
755 pre_install_php_odbc() {
756 while read daemon file; do
757 if [ -z "$1" -a -f "/var/run/$file" ]; then
758 /etc/init.d/$daemon stop
759 fi
760 done <<EOT
761 apache apache/httpd.pid
762 lighttpd lighttpd.pid
763 EOT
764 }
766 post_install_php_odbc() {
767 grep -q ^extension=odbc.so "$1/etc/php.ini" ||
768 sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
770 # Start Web server.
771 while read daemon file; do
772 [ -z "$1" ] || continue
773 if [ -f "/var/run/$file" ]; then
774 /etc/init.d/$daemon stop
775 sleep 2
776 fi
777 if [ -f /etc/init.d/$daemon ]; then
778 /etc/init.d/$daemon start
779 fi
780 done <<EOT
781 apache apache/httpd.pid
782 lighttpd lighttpd.pid
783 EOT
784 }
786 pre_remove_php_odbc() {
787 sed -i '/.*=odbc.so.*/d' /etc/php.ini
789 # Start Web server.
790 while read daemon file; do
791 [ -z "$1" ] || continue
792 if [ -f "/var/run/$file" ]; then
793 /etc/init.d/$daemon stop
794 sleep 2
795 fi
796 if [ -f /etc/init.d/$daemon ]; then
797 /etc/init.d/$daemon start
798 fi
799 done <<EOT
800 apache apache/httpd.pid
801 lighttpd lighttpd.pid
802 EOT
803 }
805 # -----------------------------------------------------------------------------
806 pre_install_php_openssl() {
807 while read daemon file; do
808 if [ -z "$1" -a -f "/var/run/$file" ]; then
809 /etc/init.d/$daemon stop
810 fi
811 done <<EOT
812 apache apache/httpd.pid
813 lighttpd lighttpd.pid
814 EOT
815 }
817 post_install_php_openssl() {
818 grep -q ^extension=openssl.so "$1/etc/php.ini" ||
819 sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
821 # Start Web server.
822 while read daemon file; do
823 [ -z "$1" ] || continue
824 if [ -f "/var/run/$file" ]; then
825 /etc/init.d/$daemon stop
826 sleep 2
827 fi
828 if [ -f /etc/init.d/$daemon ]; then
829 /etc/init.d/$daemon start
830 fi
831 done <<EOT
832 apache apache/httpd.pid
833 lighttpd lighttpd.pid
834 EOT
835 }
837 pre_remove_php_openssl() {
838 sed -i '/.*=openssl.so.*/d' /etc/php.ini
840 # Start Web server.
841 while read daemon file; do
842 [ -z "$1" ] || continue
843 if [ -f "/var/run/$file" ]; then
844 /etc/init.d/$daemon stop
845 sleep 2
846 fi
847 if [ -f /etc/init.d/$daemon ]; then
848 /etc/init.d/$daemon start
849 fi
850 done <<EOT
851 apache apache/httpd.pid
852 lighttpd lighttpd.pid
853 EOT
854 }
856 # -----------------------------------------------------------------------------
857 pre_install_pdo_mysql() {
858 while read daemon file; do
859 if [ -z "$1" -a -f "/var/run/$file" ]; then
860 /etc/init.d/$daemon stop
861 fi
862 done <<EOT
863 apache apache/httpd.pid
864 lighttpd lighttpd.pid
865 EOT
866 }
868 post_install_pdo_mysql() {
869 grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
870 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
872 # Start Web server.
873 while read daemon file; do
874 [ -z "$1" ] || continue
875 if [ -z "$1" -a -f "/var/run/$file" ]; then
876 /etc/init.d/$daemon stop
877 sleep 2
878 fi
879 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
880 /etc/init.d/$daemon start
881 fi
882 done <<EOT
883 apache apache/httpd.pid
884 lighttpd lighttpd.pid
885 EOT
886 }
888 pre_remove_pdo_mysql() {
889 sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
891 # Start Web server.
892 while read daemon file; do
893 [ -z "$1" ] || continue
894 if [ -z "$1" -a -f "/var/run/$file" ]; then
895 /etc/init.d/$daemon stop
896 sleep 2
897 fi
898 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
899 /etc/init.d/$daemon start
900 fi
901 done <<EOT
902 apache apache/httpd.pid
903 lighttpd lighttpd.pid
904 EOT
905 }
907 # -----------------------------------------------------------------------------
908 pre_install_pdo_pgsql() {
909 while read daemon file; do
910 if [ -z "$1" -a -f "/var/run/$file" ]; then
911 /etc/init.d/$daemon stop
912 fi
913 done <<EOT
914 apache apache/httpd.pid
915 lighttpd lighttpd.pid
916 EOT
917 }
919 post_install_pdo_pgsql() {
920 grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
921 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
923 # Start Web server.
924 while read daemon file; do
925 [ -z "$1" ] || continue
926 if [ -z "$1" -a -f "/var/run/$file" ]; then
927 /etc/init.d/$daemon stop
928 sleep 2
929 fi
930 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
931 /etc/init.d/$daemon start
932 fi
933 done <<EOT
934 apache apache/httpd.pid
935 lighttpd lighttpd.pid
936 EOT
937 }
939 pre_remove_pdo_pgsql() {
940 sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
942 # Start Web server.
943 while read daemon file; do
944 [ -z "$1" ] || continue
945 if [ -z "$1" -a -f "/var/run/$file" ]; then
946 /etc/init.d/$daemon stop
947 sleep 2
948 fi
949 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
950 /etc/init.d/$daemon start
951 fi
952 done <<EOT
953 apache apache/httpd.pid
954 lighttpd lighttpd.pid
955 EOT
956 }
958 # -----------------------------------------------------------------------------
959 pre_install_php_pear() {
960 while read daemon file; do
961 if [ -z "$1" -a -f "/var/run/$file" ]; then
962 /etc/init.d/$daemon stop
963 fi
964 done <<EOT
965 apache apache/httpd.pid
966 lighttpd lighttpd.pid
967 EOT
968 }
970 post_install_php_pear() {
971 grep ^include_path "$1/etc/php.ini"
972 sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
973 # Restart Web server.
974 while read daemon file; do
975 [ -z "$1" ] || continue
976 if [ -f "/var/run/$file" ]; then
977 /etc/init.d/$daemon stop
978 sleep 2
979 fi
980 if [ -f /etc/init.d/$daemon ]; then
981 /etc/init.d/$daemon start
982 fi
983 done <<EOT
984 apache apache/httpd.pid
985 lighttpd lighttpd.pid
986 EOT
987 }
989 # -----------------------------------------------------------------------------
990 pre_install_php_pgsql() {
991 while read daemon file; do
992 if [ -z "$1" -a -f "/var/run/$file" ]; then
993 /etc/init.d/$daemon stop
994 fi
995 done <<EOT
996 apache apache/httpd.pid
997 lighttpd lighttpd.pid
998 EOT
999 }
1001 post_install_php_pgsql() {
1002 grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
1003 sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
1005 # Start Web server.
1006 while read daemon file; do
1007 [ -z "$1" ] || continue
1008 if [ -f "/var/run/$file" ]; then
1009 /etc/init.d/$daemon stop
1010 sleep 2
1011 fi
1012 if [ -f /etc/init.d/$daemon ]; then
1013 /etc/init.d/$daemon start
1014 fi
1015 done <<EOT
1016 apache apache/httpd.pid
1017 lighttpd lighttpd.pid
1018 EOT
1021 pre_remove_php_pgsql() {
1022 sed -i '/.*=pgsql.so.*/d' /etc/php.ini
1024 # Start Web server.
1025 while read daemon file; do
1026 [ -z "$1" ] || continue
1027 if [ -f "/var/run/$file" ]; then
1028 /etc/init.d/$daemon stop
1029 sleep 2
1030 fi
1031 if [ -f /etc/init.d/$daemon ]; then
1032 /etc/init.d/$daemon start
1033 fi
1034 done <<EOT
1035 apache apache/httpd.pid
1036 lighttpd lighttpd.pid
1037 EOT
1040 # -----------------------------------------------------------------------------
1041 pre_install_php_snmp() {
1042 while read daemon file; do
1043 if [ -z "$1" -a -f "/var/run/$file" ]; then
1044 /etc/init.d/$daemon stop
1045 fi
1046 done <<EOT
1047 apache apache/httpd.pid
1048 lighttpd lighttpd.pid
1049 EOT
1052 post_install_php_snmp() {
1053 grep -q ^extension=snmp.so "$1/etc/php.ini" ||
1054 sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
1056 # Start Web server.
1057 while read daemon file; do
1058 [ -z "$1" ] || continue
1059 if [ -f "/var/run/$file" ]; then
1060 /etc/init.d/$daemon stop
1061 sleep 2
1062 fi
1063 if [ -f /etc/init.d/$daemon ]; then
1064 /etc/init.d/$daemon start
1065 fi
1066 done <<EOT
1067 apache apache/httpd.pid
1068 lighttpd lighttpd.pid
1069 EOT
1072 pre_remove_php_snmp() {
1073 sed -i '/.*=snmp.so.*/d' /etc/php.ini
1075 # Start Web server.
1076 while read daemon file; do
1077 [ -z "$1" ] || continue
1078 if [ -f "/var/run/$file" ]; then
1079 /etc/init.d/$daemon stop
1080 sleep 2
1081 fi
1082 if [ -f /etc/init.d/$daemon ]; then
1083 /etc/init.d/$daemon start
1084 fi
1085 done <<EOT
1086 apache apache/httpd.pid
1087 lighttpd lighttpd.pid
1088 EOT
1091 # -----------------------------------------------------------------------------
1092 pre_install_php_soap() {
1093 while read daemon file; do
1094 if [ -z "$1" -a -f "/var/run/$file" ]; then
1095 /etc/init.d/$daemon stop
1096 fi
1097 done <<EOT
1098 apache apache/httpd.pid
1099 lighttpd lighttpd.pid
1100 EOT
1103 post_install_php_soap() {
1104 grep -q ^extension=soap.so "$1/etc/php.ini" ||
1105 sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
1107 # Start Web server.
1108 while read daemon file; do
1109 [ -z "$1" ] || continue
1110 if [ -f "/var/run/$file" ]; then
1111 /etc/init.d/$daemon stop
1112 sleep 2
1113 fi
1114 if [ -f /etc/init.d/$daemon ]; then
1115 /etc/init.d/$daemon start
1116 fi
1117 done <<EOT
1118 apache apache/httpd.pid
1119 lighttpd lighttpd.pid
1120 EOT
1123 pre_remove_php_soap() {
1124 sed -i '/.*=soap.so.*/d' /etc/php.ini
1126 # Start Web server.
1127 while read daemon file; do
1128 [ -z "$1" ] || continue
1129 if [ -f "/var/run/$file" ]; then
1130 /etc/init.d/$daemon stop
1131 sleep 2
1132 fi
1133 if [ -f /etc/init.d/$daemon ]; then
1134 /etc/init.d/$daemon start
1135 fi
1136 done <<EOT
1137 apache apache/httpd.pid
1138 lighttpd lighttpd.pid
1139 EOT
1142 # -----------------------------------------------------------------------------
1143 post_install_php_sqlite() {
1144 grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
1145 sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
1147 # Start Web server.
1148 while read daemon file; do
1149 [ -z "$1" ] || continue
1150 if [ -f "/var/run/$file" ]; then
1151 /etc/init.d/$daemon stop
1152 sleep 2
1153 fi
1154 if [ -f /etc/init.d/$daemon ]; then
1155 /etc/init.d/$daemon start
1156 fi
1157 done <<EOT
1158 apache apache/httpd.pid
1159 lighttpd lighttpd.pid
1160 EOT
1163 pre_remove_php_sqlite() {
1164 sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
1166 # Start Web server.
1167 while read daemon file; do
1168 [ -z "$1" ] || continue
1169 if [ -f "/var/run/$file" ]; then
1170 /etc/init.d/$daemon stop
1171 sleep 2
1172 fi
1173 if [ -f /etc/init.d/$daemon ]; then
1174 /etc/init.d/$daemon start
1175 fi
1176 done <<EOT
1177 apache apache/httpd.pid
1178 lighttpd lighttpd.pid
1179 EOT