wok-next view php/receipt @ rev 21370
updated minidlna (1.1.4 -> 1.2.1)
author | Hans-G?nter Theisgen |
---|---|
date | Thu Apr 16 09:58:07 2020 +0100 (2020-04-16) |
parents | 5669e8b3be70 |
children | 3b01949caf36 |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="php"
4 VERSION="7.4.4"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language"
7 MAINTAINER="maintainer@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.php.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.xz"
12 WGET_URL="https://www.php.net/distributions/$TARBALL"
14 BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client
15 coreutils-conditions curl-dev cyrus-sasl-dev gettext-dev
16 jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev
17 libunixODBC libvpx-dev libxml2-dev mhash-dev mysql-dev
18 net-snmp-dev openldap-dev openssl-dev perl postgresql-dev
19 re2c sed sqlite3-dev unixODBC-dev zlib-dev"
20 SPLIT="\
21 $PACKAGE-apache $PACKAGE-cherokee $PACKAGE-cli $PACKAGE-common \
22 $PACKAGE-curl $PACKAGE-dba $PACKAGE-dev $PACKAGE-gd \
23 $PACKAGE-imap $PACKAGE-ldap $PACKAGE-mcrypt $PACKAGE-mysqli \
24 $PACKAGE-mysql $PACKAGE-odbc $PACKAGE-openssl $PACKAGE-pdo-mysql \
25 $PACKAGE-pdo-pgsql $PACKAGE-pear $PACKAGE-pgsql $PACKAGE-snmp \
26 $PACKAGE-soap $PACKAGE-sqlite"
28 compile_rules()
29 {
30 ARCH_ARGS="\
31 --enable-mbstring \
32 --enable-sockets \
33 --enable-ftp \
34 --enable-zip \
35 --enable-calendar \
36 --enable-exif \
37 --config-cache \
38 --enable-dba=shared \
39 --with-config-file-path=/etc \
40 --with-zlib \
41 --with-gettext \
42 --with-mcrypt=shared,/usr \
43 --with-mysql=shared,/usr \
44 --with-mysqli=shared \
45 --with-mysql-sock=/var/run/mysqld/mysql.sock \
46 --with-pdo-sqlite=shared,/usr \
47 --with-pgsql=shared,/usr \
48 --with-snmp=shared,/usr \
49 --enable-soap=shared,/usr \
50 --with-ldap=shared \
51 --with-imap=shared \
52 --with-imap-ssl \
53 --with-mhash \
54 --with-gd=shared \
55 --with-jpeg-dir=/usr \
56 --with-png-dir=/usr \
57 --with-vpx-dir=/usr \
58 --with-openssl=shared \
59 --with-unixODBC=shared,/usr \
60 --with-pear=/usr/share/php \
61 --with-pdo-mysql=shared \
62 --with-pdo-pgsql=shared \
63 --with-curl=shared \
64 --with-sqlite3=shared,/usr \
65 --enable-maintainer-zts"
67 sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' \
68 ext/gd/libgd/webpimg.c
69 sed -i 's/pam_start/pam_nostart/' \
70 configure
72 ./configure \
73 $ARCH_ARGS \
74 $CONFIGURE_ARGS &&
75 make $MAKEFLAGS &&
76 make -j1 INSTALL_ROOT=$install install
78 ./configure \
79 $ARCH_ARGS \
80 $CONFIGURE_ARGS \
81 --with-apxs2=/usr/bin/apxs &&
82 make $MAKEFLAGS &&
83 mkdir -p $install/etc/apache &&
84 cp /etc/apache/httpd.conf $install/etc/apache/httpd.conf &&
85 make -j1 INSTALL_ROOT=$install install || return 1
87 # Production configuration file.
88 mkdir -p $install/etc
90 cp $src/php.ini-production $install/etc/php.ini || return 1
91 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
92 -i $install/etc/php.ini
94 install -Dm755 $src/sapi/cgi/php-cgi $install/usr/bin/php-cgi
96 install -Dm644 $stuff/phpinfo/index.php $install/usr/share/phpinfo/index.php
97 install -Dm644 $stuff/php.desktop $install/usr/share/applications/php.desktop
98 install -Dm644 $stuff/php.png $install/usr/share/pixmaps/php.png
99 }
101 genpkg_rules()
102 {
103 case $PACKAGE in
104 php)
105 copy usr/bin/php-cgi
106 DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
107 PROVIDE="php:lighttpd"
108 ;;
109 php-apache)
110 copy usr/share/apache/
111 CAT="development|module for apache"
112 DEPENDS="php-common apache libxml2 zlib"
113 PROVIDE="php:apache"
114 ;;
115 php-cherokee)
116 copy usr/bin/php-cgi # FIXME! the same file in "php" package
117 CAT="development|module for cherokee"
118 DEPENDS="php-common cherokee libxml2 zlib"
119 PROVIDE="php:cherokee"
120 ;;
121 php-cli)
122 copy usr/bin/php
123 CAT="development|command line interpreter"
124 DEPENDS="php-common"
125 ;;
126 php-common)
127 copy phpinfo/ php.desktop php.png php.ini
128 CAT="development|common files for PHP modules"
129 DEPENDS=" "
130 CONFIG_FILES="/etc/php.ini"
131 ;;
132 php-curl)
133 copy curl.so
134 CAT="development|curl module"
135 DEPENDS="curl php"
136 ;;
137 php-dba)
138 copy dba.so
139 CAT="development|dba module"
140 DEPENDS=" "
141 ;;
142 php-dev)
143 copy @dev
144 DEPENDS="php cyrus-sasl libldap libmysqlclient libpng \
145 libpostgresqlclient libunixODBC mhash openssl jpeg \
146 libmcrypt libtool libkrb5 libcomerr3 net-snmp"
147 ;;
148 php-gd)
149 copy gd.so
150 CAT="development|gd module"
151 DEPENDS="libpng php jpeg libvpx"
152 ;;
153 php-imap)
154 copy imap.so
155 CAT="development|imap module"
156 DEPENDS="php openssl"
157 ;;
158 php-ldap)
159 copy ldap.so
160 CAT="development|ldap module"
161 DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
162 ;;
163 php-mcrypt)
164 copy mcrypt.so
165 CAT="development|mcrypt module"
166 DEPENDS="libmcrypt php libtool"
167 ;;
168 php-mysqli)
169 copy mysqli.so
170 CAT="development|mysqli module"
171 DEPENDS="libmysqlclient php"
172 ;;
173 php-mysql)
174 copy mysql.so
175 CAT="development|mysql module"
176 DEPENDS="libmysqlclient php"
177 ;;
178 php-odbc)
179 copy odbc.so
180 CAT="development|ODBC module"
181 DEPENDS="unixODBC php"
182 ;;
183 php-openssl)
184 copy openssl.so
185 CAT="development|OpenSSL module"
186 DEPENDS="php openssl"
187 ;;
188 php-pdo-mysql)
189 copy pdo_mysql.so
190 CAT="development|PDO MySQL module"
191 DEPENDS="php php-mysql"
192 ;;
193 php-pdo-pgsql)
194 copy pdo_pgsql.so
195 CAT="development|PDO PgSQL module"
196 DEPENDS="php php-mysql libpostgresqlclient"
197 ;;
198 php-pear)
199 copy etc/pear.conf usr/bin/pe* usr/share/php/
200 CAT="development|PEAR libs"
201 DEPENDS="php-cli"
202 ;;
203 php-pgsql)
204 copy pgsql.so
205 CAT="development|postgresql module"
206 DEPENDS="postgresql php"
207 ;;
208 php-snmp)
209 copy snmp.so
210 CAT="development|snmp module"
211 DEPENDS="net-snmp php openssl"
212 ;;
213 php-soap)
214 copy soap.so
215 CAT="development|soap module"
216 DEPENDS="php libxml2"
217 ;;
218 php-sqlite)
219 copy sqlite.so sqlite3.so pdo_sqlite.so
220 CAT="development|sqlite module"
221 DEPENDS="php sqlite3"
222 ;;
223 esac
224 }
226 # -----------------------------------------------------------------------------
227 pre_install_php()
228 {
229 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
230 then
231 /etc/init.d/lighttpd stop
232 fi
233 }
235 post_install_php()
236 {
237 # Enable php
238 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
239 then
240 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
241 tazpkg get-install lighttpd-modules --root="$1/"
243 sed \
244 -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
245 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
246 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
247 -i "$1/etc/lighttpd/lighttpd.conf"
249 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
250 sed \
251 -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
252 -i "$1/etc/lighttpd/lighttpd.conf"
254 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" ||
255 sed \
256 -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
257 -i "$1/etc/lighttpd/lighttpd.conf"
259 fi
261 # Start Web server.
262 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
263 then
264 /etc/init.d/lighttpd start
265 fi
266 }
268 # -----------------------------------------------------------------------------
269 pre_installi_php_apache()
270 {
271 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
272 then
273 /etc/init.d/apache stop
274 fi
275 }
277 post_install_php_apache()
278 {
279 grep -q php5_module "$1/etc/apache/httpd.conf" ||
280 {
281 sed \
282 -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
283 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
284 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
285 -i "$1/etc/apache/httpd.conf"
286 }
288 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
289 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
290 <IfModule mod_alias.c>
291 Alias /phpinfo /usr/share/phpinfo
292 </IfModule>
293 <DirectoryMatch /usr/share/phpinfo/>
294 DirectoryIndex index.php
295 Options +FollowSymLinks
296 AllowOverride None
297 Order allow,deny
298 Allow from all
299 </DirectoryMatch>
300 EOT
302 # Restart Web server.
303 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
304 then
305 /etc/init.d/apache stop
306 sleep 2
307 fi
308 if [ -z "$1" ]; then
309 /etc/init.d/apache start
310 fi
311 }
313 # -----------------------------------------------------------------------------
314 pre_install_php_cherokee()
315 {
316 if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]
317 then
318 /etc/init.d/cherokee stop
319 fi
320 }
322 post_install_php_cherokee()
323 {
324 # Enable php
325 # if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
326 # [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
327 # tazpkg get-install lighttpd-modules --root="$1/"
328 # sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
329 # -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
330 # -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
331 # -i "$1/etc/lighttpd/lighttpd.conf"
332 # grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
333 # sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
334 # -i "$1/etc/lighttpd/lighttpd.conf"
335 # grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
336 # sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
337 # -i "$1/etc/lighttpd/lighttpd.conf"
338 # fi
340 # Start Web server.
341 if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]
342 then
343 /etc/init.d/cherokee start
344 fi
345 }
347 # -----------------------------------------------------------------------------
348 pre_install_php_common()
349 {
350 # Backup existing php.ini
351 if [ -f "$1/etc/php.ini" ]
352 then
353 cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
354 fi
355 }
357 post_install_php_common()
358 {
359 # Restore original php.ini
360 if [ -f "$1/etc/php.ini.bak" ]
361 then
362 mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
363 fi
364 }
366 # -----------------------------------------------------------------------------
367 pre_install_php_curl()
368 {
369 while read daemon file
370 do
371 if [ -z "$1" -a -f "/var/run/$file" ]
372 then
373 /etc/init.d/$daemon stop
374 fi
375 done <<EOT
376 apache apache/httpd.pid
377 lighttpd lighttpd.pid
378 EOT
379 }
381 post_install_php_curl()
382 {
383 grep -q ^extension=curl.so "$1/etc/php.ini" ||
384 sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' \
385 -i "$1/etc/php.ini"
387 # Start Web server.
388 while read daemon file
389 do
390 [ -z "$1" ] || continue
391 if [ -f "/var/run/$file" ]
392 then
393 /etc/init.d/$daemon stop
394 sleep 2
395 fi
396 if [ -f /etc/init.d/$daemon ]
397 then
398 /etc/init.d/$daemon start
399 fi
400 done <<EOT
401 apache apache/httpd.pid
402 lighttpd lighttpd.pid
403 EOT
404 }
406 pre_remove_php_curl()
407 {
408 sed -i '/.*=curl.so.*/d' /etc/php.ini
410 # Start Web server.
411 while read daemon file
412 do
413 [ -z "$1" ] || continue
414 if [ -f "/var/run/$file" ]
415 then
416 /etc/init.d/$daemon stop
417 sleep 2
418 fi
419 if [ -f /etc/init.d/$daemon ]
420 then
421 /etc/init.d/$daemon start
422 fi
423 done <<EOT
424 apache apache/httpd.pid
425 lighttpd lighttpd.pid
426 EOT
427 }
429 # -----------------------------------------------------------------------------
430 pre_install_php_dba()
431 {
432 while read daemon file
433 do
434 if [ -z "$1" -a -f "/var/run/$file" ]
435 then
436 /etc/init.d/$daemon stop
437 fi
438 done <<EOT
439 apache apache/httpd.pid
440 lighttpd lighttpd.pid
441 EOT
442 }
444 post_install_php_dba()
445 {
446 grep -q ^extension=dba.so "$1/etc/php.ini" ||
447 sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' \
448 -i "$1/etc/php.ini"
450 # Start Web server.
451 while read daemon file
452 do
453 [ -z "$1" ] || continue
454 if [ -f "/var/run/$file" ]
455 then
456 /etc/init.d/$daemon stop
457 sleep 2
458 fi
459 if [ -f /etc/init.d/$daemon ]
460 then
461 /etc/init.d/$daemon start
462 fi
463 done <<EOT
464 apache apache/httpd.pid
465 lighttpd lighttpd.pid
466 EOT
467 }
469 pre_remove_php_dba()
470 {
471 sed -i '/.*=dba.so.*/d' /etc/php.ini
473 # Start Web server.
474 while read daemon file
475 do
476 [ -z "$1" ] || continue
477 if [ -f "/var/run/$file" ]
478 then
479 /etc/init.d/$daemon stop
480 sleep 2
481 fi
482 if [ -f /etc/init.d/$daemon ]
483 then
484 /etc/init.d/$daemon start
485 fi
486 done <<EOT
487 apache apache/httpd.pid
488 lighttpd lighttpd.pid
489 EOT
490 }
492 # -----------------------------------------------------------------------------
493 pre_install_php_gd()
494 {
495 while read daemon file
496 do
497 if [ -z "$1" -a -f "/var/run/$file" ]
498 then
499 /etc/init.d/$daemon stop
500 fi
501 done <<EOT
502 apache apache/httpd.pid
503 lighttpd lighttpd.pid
504 EOT
505 }
507 post_install_php_gd()
508 {
509 grep -q ^extension=gd.so "$1/etc/php.ini" ||
510 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' \
511 -i "$1/etc/php.ini"
513 # Start Web server.
514 while read daemon file
515 do
516 [ -z "$1" ] || continue
517 if [ -z "$1" -a -f "/var/run/$file" ]
518 then
519 /etc/init.d/$daemon stop
520 sleep 2
521 fi
522 if [ -z "$1" -a -f /etc/init.d/$daemon ]
523 then
524 /etc/init.d/$daemon start
525 fi
526 done <<EOT
527 apache apache/httpd.pid
528 lighttpd lighttpd.pid
529 EOT
530 }
532 pre_remove_php_gd()
533 {
534 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
536 # Start Web server.
537 while read daemon file
538 do
539 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]
540 then
541 [ -z "$1" ] || continue
542 if [ -z "$1" -a -f "/var/run/$file" ]
543 then
544 /etc/init.d/$daemon stop
545 sleep 2
546 fi
547 if [ -z "$1" -a -f /etc/init.d/$daemon ]
548 then
549 /etc/init.d/$daemon start
550 fi
551 fi
552 done <<EOT
553 apache apache/httpd.pid
554 lighttpd lighttpd.pid
555 EOT
556 }
558 # -----------------------------------------------------------------------------
559 pre_install_php_imap()
560 {
561 while read daemon file; do
562 if [ -z "$1" -a -f "/var/run/$file" ]; then
563 /etc/init.d/$daemon stop
564 fi
565 done <<EOT
566 apache apache/httpd.pid
567 lighttpd lighttpd.pid
568 EOT
569 }
571 post_install_php_imap()
572 {
573 grep -q ^extension=imap.so "$1/etc/php.ini" ||
574 sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
576 # Start Web server.
577 while read daemon file; do
578 [ -z "$1" ] || continue
579 if [ -f "/var/run/$file" ]; then
580 /etc/init.d/$daemon stop
581 sleep 2
582 fi
583 if [ -f /etc/init.d/$daemon ]; then
584 /etc/init.d/$daemon start
585 fi
586 done <<EOT
587 apache apache/httpd.pid
588 lighttpd lighttpd.pid
589 EOT
590 }
592 pre_remove_php_imap()
593 {
594 sed -i '/.*=imap.so.*/d' /etc/php.ini
596 # Start Web server.
597 while read daemon file; do
598 [ -z "$1" ] || continue
599 if [ -f "/var/run/$file" ]; then
600 /etc/init.d/$daemon stop
601 sleep 2
602 fi
603 if [ -f /etc/init.d/$daemon ]; then
604 /etc/init.d/$daemon start
605 fi
606 done <<EOT
607 apache apache/httpd.pid
608 lighttpd lighttpd.pid
609 EOT
610 }
612 # -----------------------------------------------------------------------------
613 pre_install_php_ldap()
614 {
615 while read daemon file; do
616 if [ -z "$1" -a -f "/var/run/$file" ]; then
617 /etc/init.d/$daemon stop
618 fi
619 done <<EOT
620 apache apache/httpd.pid
621 lighttpd lighttpd.pid
622 EOT
623 }
625 post_install_php_ldap()
626 {
627 grep -q ^extension=ldap.so "$1/etc/php.ini" ||
628 sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
630 # Start Web server.
631 while read daemon file; do
632 [ -z "$1" ] || continue
633 if [ -f "/var/run/$file" ]; then
634 /etc/init.d/$daemon stop
635 sleep 2
636 fi
637 if [ -f /etc/init.d/$daemon ]; then
638 /etc/init.d/$daemon start
639 fi
640 done <<EOT
641 apache apache/httpd.pid
642 lighttpd lighttpd.pid
643 EOT
644 }
646 pre_remove_php_ldap()
647 {
648 sed -i '/.*=ldap.so.*/d' /etc/php.ini
650 # Start Web server.
651 while read daemon file; do
652 [ -z "$1" ] || continue
653 if [ -f "/var/run/$file" ]; then
654 /etc/init.d/$daemon stop
655 sleep 2
656 fi
657 if [ -f /etc/init.d/$daemon ]; then
658 /etc/init.d/$daemon start
659 fi
660 done <<EOT
661 apache apache/httpd.pid
662 lighttpd lighttpd.pid
663 EOT
664 }
666 # -----------------------------------------------------------------------------
667 pre_install_php_mcrypt()
668 {
669 while read daemon file; do
670 if [ -z "$1" -a -f "/var/run/$file" ]; then
671 /etc/init.d/$daemon stop
672 fi
673 done <<EOT
674 apache apache/httpd.pid
675 lighttpd lighttpd.pid
676 EOT
677 }
679 post_install_php_mcrypt()
680 {
681 grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
682 sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
684 # Start Web server.
685 while read daemon file; do
686 [ -z "$1" ] || continue
687 if [ -f "/var/run/$file" ]; then
688 /etc/init.d/$daemon stop
689 sleep 2
690 fi
691 if [ -f /etc/init.d/$daemon ]; then
692 /etc/init.d/$daemon start
693 fi
694 done <<EOT
695 apache apache/httpd.pid
696 lighttpd lighttpd.pid
697 EOT
698 }
700 pre_remove_php_mcrypt()
701 {
702 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
704 # Start Web server.
705 while read daemon file; do
706 [ -z "$1" ] || continue
707 if [ -f "/var/run/$file" ]; then
708 /etc/init.d/$daemon stop
709 sleep 2
710 fi
711 if [ -f /etc/init.d/$daemon ]; then
712 /etc/init.d/$daemon start
713 fi
714 done <<EOT
715 apache apache/httpd.pid
716 lighttpd lighttpd.pid
717 EOT
718 }
720 # -----------------------------------------------------------------------------
721 pre_install_php_mysqli()
722 {
723 while read daemon file; do
724 if [ -z "$1" -a -f "/var/run/$file" ]; then
725 /etc/init.d/$daemon stop
726 fi
727 done <<EOT
728 apache apache/httpd.pid
729 lighttpd lighttpd.pid
730 EOT
731 }
733 post_install_php_mysqli()
734 {
735 grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
736 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/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 pre_remove_php_mysqli()
755 {
756 sed -i '/.*=mysqli.so.*/d' /etc/php.ini
758 # Start Web server.
759 while read daemon file; do
760 [ -z "$1" ] || continue
761 if [ -f "/var/run/$file" ]; then
762 /etc/init.d/$daemon stop
763 sleep 2
764 fi
765 if [ -f /etc/init.d/$daemon ]; then
766 /etc/init.d/$daemon start
767 fi
768 done <<EOT
769 apache apache/httpd.pid
770 lighttpd lighttpd.pid
771 EOT
772 }
774 # -----------------------------------------------------------------------------
775 pre_install_php_mysql()
776 {
777 while read daemon file; do
778 if [ -z "$1" -a -f "/var/run/$file" ]; then
779 /etc/init.d/$daemon stop
780 fi
781 done <<EOT
782 apache apache/httpd.pid
783 lighttpd lighttpd.pid
784 EOT
785 }
787 post_install_php_mysql()
788 {
789 grep -q ^extension=mysql.so "$1/etc/php.ini" ||
790 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
792 # Start Web server.
793 while read daemon file; do
794 [ -z "$1" ] || continue
795 if [ -f "/var/run/$file" ]; then
796 /etc/init.d/$daemon stop
797 sleep 2
798 fi
799 if [ -f /etc/init.d/$daemon ]; then
800 /etc/init.d/$daemon start
801 fi
802 done <<EOT
803 apache apache/httpd.pid
804 lighttpd lighttpd.pid
805 EOT
806 }
808 pre_remove_php_mysql()
809 {
810 sed -i '/.*=mysql.so.*/d' /etc/php.ini
812 # Start Web server.
813 while read daemon file; do
814 [ -z "$1" ] || continue
815 if [ -f "/var/run/$file" ]; then
816 /etc/init.d/$daemon stop
817 sleep 2
818 fi
819 if [ -f /etc/init.d/$daemon ]; then
820 /etc/init.d/$daemon start
821 fi
822 done <<EOT
823 apache apache/httpd.pid
824 lighttpd lighttpd.pid
825 EOT
826 }
828 # -----------------------------------------------------------------------------
829 pre_install_php_odbc()
830 {
831 while read daemon file; do
832 if [ -z "$1" -a -f "/var/run/$file" ]; then
833 /etc/init.d/$daemon stop
834 fi
835 done <<EOT
836 apache apache/httpd.pid
837 lighttpd lighttpd.pid
838 EOT
839 }
841 post_install_php_odbc()
842 {
843 grep -q ^extension=odbc.so "$1/etc/php.ini" ||
844 sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
846 # Start Web server.
847 while read daemon file; do
848 [ -z "$1" ] || continue
849 if [ -f "/var/run/$file" ]; then
850 /etc/init.d/$daemon stop
851 sleep 2
852 fi
853 if [ -f /etc/init.d/$daemon ]; then
854 /etc/init.d/$daemon start
855 fi
856 done <<EOT
857 apache apache/httpd.pid
858 lighttpd lighttpd.pid
859 EOT
860 }
862 pre_remove_php_odbc()
863 {
864 sed -i '/.*=odbc.so.*/d' /etc/php.ini
866 # Start Web server.
867 while read daemon file; do
868 [ -z "$1" ] || continue
869 if [ -f "/var/run/$file" ]; then
870 /etc/init.d/$daemon stop
871 sleep 2
872 fi
873 if [ -f /etc/init.d/$daemon ]; then
874 /etc/init.d/$daemon start
875 fi
876 done <<EOT
877 apache apache/httpd.pid
878 lighttpd lighttpd.pid
879 EOT
880 }
882 # -----------------------------------------------------------------------------
883 pre_install_php_openssl()
884 {
885 while read daemon file; do
886 if [ -z "$1" -a -f "/var/run/$file" ]; then
887 /etc/init.d/$daemon stop
888 fi
889 done <<EOT
890 apache apache/httpd.pid
891 lighttpd lighttpd.pid
892 EOT
893 }
895 post_install_php_openssl()
896 {
897 grep -q ^extension=openssl.so "$1/etc/php.ini" ||
898 sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
900 # Start Web server.
901 while read daemon file; do
902 [ -z "$1" ] || continue
903 if [ -f "/var/run/$file" ]; then
904 /etc/init.d/$daemon stop
905 sleep 2
906 fi
907 if [ -f /etc/init.d/$daemon ]; then
908 /etc/init.d/$daemon start
909 fi
910 done <<EOT
911 apache apache/httpd.pid
912 lighttpd lighttpd.pid
913 EOT
914 }
916 pre_remove_php_openssl()
917 {
918 sed -i '/.*=openssl.so.*/d' /etc/php.ini
920 # Start Web server.
921 while read daemon file; do
922 [ -z "$1" ] || continue
923 if [ -f "/var/run/$file" ]; then
924 /etc/init.d/$daemon stop
925 sleep 2
926 fi
927 if [ -f /etc/init.d/$daemon ]; then
928 /etc/init.d/$daemon start
929 fi
930 done <<EOT
931 apache apache/httpd.pid
932 lighttpd lighttpd.pid
933 EOT
934 }
936 # -----------------------------------------------------------------------------
937 pre_install_pdo_mysql() {
938 while read daemon file; do
939 if [ -z "$1" -a -f "/var/run/$file" ]; then
940 /etc/init.d/$daemon stop
941 fi
942 done <<EOT
943 apache apache/httpd.pid
944 lighttpd lighttpd.pid
945 EOT
946 }
948 post_install_pdo_mysql()
949 {
950 grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
951 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
953 # Start Web server.
954 while read daemon file; do
955 [ -z "$1" ] || continue
956 if [ -z "$1" -a -f "/var/run/$file" ]; then
957 /etc/init.d/$daemon stop
958 sleep 2
959 fi
960 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
961 /etc/init.d/$daemon start
962 fi
963 done <<EOT
964 apache apache/httpd.pid
965 lighttpd lighttpd.pid
966 EOT
967 }
969 pre_remove_pdo_mysql()
970 {
971 sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
973 # Start Web server.
974 while read daemon file; do
975 [ -z "$1" ] || continue
976 if [ -z "$1" -a -f "/var/run/$file" ]; then
977 /etc/init.d/$daemon stop
978 sleep 2
979 fi
980 if [ -z "$1" -a -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_pdo_pgsql()
991 {
992 while read daemon file; do
993 if [ -z "$1" -a -f "/var/run/$file" ]; then
994 /etc/init.d/$daemon stop
995 fi
996 done <<EOT
997 apache apache/httpd.pid
998 lighttpd lighttpd.pid
999 EOT
1000 }
1002 post_install_pdo_pgsql()
1003 {
1004 grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
1005 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
1007 # Start Web server.
1008 while read daemon file; do
1009 [ -z "$1" ] || continue
1010 if [ -z "$1" -a -f "/var/run/$file" ]; then
1011 /etc/init.d/$daemon stop
1012 sleep 2
1013 fi
1014 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
1015 /etc/init.d/$daemon start
1016 fi
1017 done <<EOT
1018 apache apache/httpd.pid
1019 lighttpd lighttpd.pid
1020 EOT
1021 }
1023 pre_remove_pdo_pgsql()
1024 {
1025 sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
1027 # Start Web server.
1028 while read daemon file; do
1029 [ -z "$1" ] || continue
1030 if [ -z "$1" -a -f "/var/run/$file" ]; then
1031 /etc/init.d/$daemon stop
1032 sleep 2
1033 fi
1034 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
1035 /etc/init.d/$daemon start
1036 fi
1037 done <<EOT
1038 apache apache/httpd.pid
1039 lighttpd lighttpd.pid
1040 EOT
1041 }
1043 # -----------------------------------------------------------------------------
1044 pre_install_php_pear()
1045 {
1046 while read daemon file; do
1047 if [ -z "$1" -a -f "/var/run/$file" ]; then
1048 /etc/init.d/$daemon stop
1049 fi
1050 done <<EOT
1051 apache apache/httpd.pid
1052 lighttpd lighttpd.pid
1053 EOT
1054 }
1056 post_install_php_pear()
1057 {
1058 grep ^include_path "$1/etc/php.ini"
1059 sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
1060 # Restart Web server.
1061 while read daemon file; do
1062 [ -z "$1" ] || continue
1063 if [ -f "/var/run/$file" ]; then
1064 /etc/init.d/$daemon stop
1065 sleep 2
1066 fi
1067 if [ -f /etc/init.d/$daemon ]; then
1068 /etc/init.d/$daemon start
1069 fi
1070 done <<EOT
1071 apache apache/httpd.pid
1072 lighttpd lighttpd.pid
1073 EOT
1074 }
1076 # -----------------------------------------------------------------------------
1077 pre_install_php_pgsql()
1078 {
1079 while read daemon file; do
1080 if [ -z "$1" -a -f "/var/run/$file" ]; then
1081 /etc/init.d/$daemon stop
1082 fi
1083 done <<EOT
1084 apache apache/httpd.pid
1085 lighttpd lighttpd.pid
1086 EOT
1087 }
1089 post_install_php_pgsql()
1090 {
1091 grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
1092 sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
1094 # Start Web server.
1095 while read daemon file; do
1096 [ -z "$1" ] || continue
1097 if [ -f "/var/run/$file" ]; then
1098 /etc/init.d/$daemon stop
1099 sleep 2
1100 fi
1101 if [ -f /etc/init.d/$daemon ]; then
1102 /etc/init.d/$daemon start
1103 fi
1104 done <<EOT
1105 apache apache/httpd.pid
1106 lighttpd lighttpd.pid
1107 EOT
1108 }
1110 pre_remove_php_pgsql()
1111 {
1112 sed -i '/.*=pgsql.so.*/d' /etc/php.ini
1114 # Start Web server.
1115 while read daemon file; do
1116 [ -z "$1" ] || continue
1117 if [ -f "/var/run/$file" ]; then
1118 /etc/init.d/$daemon stop
1119 sleep 2
1120 fi
1121 if [ -f /etc/init.d/$daemon ]; then
1122 /etc/init.d/$daemon start
1123 fi
1124 done <<EOT
1125 apache apache/httpd.pid
1126 lighttpd lighttpd.pid
1127 EOT
1128 }
1130 # -----------------------------------------------------------------------------
1131 pre_install_php_snmp()
1132 {
1133 while read daemon file; do
1134 if [ -z "$1" -a -f "/var/run/$file" ]; then
1135 /etc/init.d/$daemon stop
1136 fi
1137 done <<EOT
1138 apache apache/httpd.pid
1139 lighttpd lighttpd.pid
1140 EOT
1141 }
1143 post_install_php_snmp()
1144 {
1145 grep -q ^extension=snmp.so "$1/etc/php.ini" ||
1146 sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
1148 # Start Web server.
1149 while read daemon file; do
1150 [ -z "$1" ] || continue
1151 if [ -f "/var/run/$file" ]; then
1152 /etc/init.d/$daemon stop
1153 sleep 2
1154 fi
1155 if [ -f /etc/init.d/$daemon ]; then
1156 /etc/init.d/$daemon start
1157 fi
1158 done <<EOT
1159 apache apache/httpd.pid
1160 lighttpd lighttpd.pid
1161 EOT
1162 }
1164 pre_remove_php_snmp()
1165 {
1166 sed -i '/.*=snmp.so.*/d' /etc/php.ini
1168 # Start Web server.
1169 while read daemon file; do
1170 [ -z "$1" ] || continue
1171 if [ -f "/var/run/$file" ]; then
1172 /etc/init.d/$daemon stop
1173 sleep 2
1174 fi
1175 if [ -f /etc/init.d/$daemon ]; then
1176 /etc/init.d/$daemon start
1177 fi
1178 done <<EOT
1179 apache apache/httpd.pid
1180 lighttpd lighttpd.pid
1181 EOT
1182 }
1184 # -----------------------------------------------------------------------------
1185 pre_install_php_soap()
1186 {
1187 while read daemon file; do
1188 if [ -z "$1" -a -f "/var/run/$file" ]; then
1189 /etc/init.d/$daemon stop
1190 fi
1191 done <<EOT
1192 apache apache/httpd.pid
1193 lighttpd lighttpd.pid
1194 EOT
1195 }
1197 post_install_php_soap()
1198 {
1199 grep -q ^extension=soap.so "$1/etc/php.ini" ||
1200 sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
1202 # Start Web server.
1203 while read daemon file; do
1204 [ -z "$1" ] || continue
1205 if [ -f "/var/run/$file" ]; then
1206 /etc/init.d/$daemon stop
1207 sleep 2
1208 fi
1209 if [ -f /etc/init.d/$daemon ]; then
1210 /etc/init.d/$daemon start
1211 fi
1212 done <<EOT
1213 apache apache/httpd.pid
1214 lighttpd lighttpd.pid
1215 EOT
1216 }
1218 pre_remove_php_soap()
1219 {
1220 sed -i '/.*=soap.so.*/d' /etc/php.ini
1222 # Start Web server.
1223 while read daemon file; do
1224 [ -z "$1" ] || continue
1225 if [ -f "/var/run/$file" ]; then
1226 /etc/init.d/$daemon stop
1227 sleep 2
1228 fi
1229 if [ -f /etc/init.d/$daemon ]; then
1230 /etc/init.d/$daemon start
1231 fi
1232 done <<EOT
1233 apache apache/httpd.pid
1234 lighttpd lighttpd.pid
1235 EOT
1236 }
1238 # -----------------------------------------------------------------------------
1239 post_install_php_sqlite()
1240 {
1241 grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
1242 sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
1244 # Start Web server.
1245 while read daemon file; do
1246 [ -z "$1" ] || continue
1247 if [ -f "/var/run/$file" ]; then
1248 /etc/init.d/$daemon stop
1249 sleep 2
1250 fi
1251 if [ -f /etc/init.d/$daemon ]; then
1252 /etc/init.d/$daemon start
1253 fi
1254 done <<EOT
1255 apache apache/httpd.pid
1256 lighttpd lighttpd.pid
1257 EOT
1258 }
1260 pre_remove_php_sqlite()
1261 {
1262 sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
1264 # Start Web server.
1265 while read daemon file; do
1266 [ -z "$1" ] || continue
1267 if [ -f "/var/run/$file" ]; then
1268 /etc/init.d/$daemon stop
1269 sleep 2
1270 fi
1271 if [ -f /etc/init.d/$daemon ]; then
1272 /etc/init.d/$daemon start
1273 fi
1274 done <<EOT
1275 apache apache/httpd.pid
1276 lighttpd lighttpd.pid
1277 EOT
1278 }