wok-next view php/receipt @ rev 20786
gnupg: remove spaces (aka: should build now, since newest libgpg-error available now, which has the GPGRT_LOGLVL_INFO
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Sat Jun 09 07:09:31 2018 +0000 (2018-06-09) |
parents | d43bf7aae921 |
children | d5aab818505e |
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="pankso@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_arm="sqlite3-dev libxml2-dev zlib-dev curl-dev"
15 BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
16 net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
17 c-client mhash-dev libpng16-dev libunixODBC unixODBC-dev openldap-dev \
18 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl \
19 jpeg-dev net-snmp-dev libvpx-dev apache coreutils-conditions sed re2c"
20 SPLIT="php-apache php-cherokee php-cli php-common php-curl php-dba php-dev \
21 php-gd php-imap php-ldap php-mcrypt php-mysqli php-mysql php-odbc php-openssl \
22 php-pdo-mysql php-pdo-pgsql php-pear php-pgsql php-snmp php-soap php-sqlite"
25 compile_rules() {
26 case "$ARCH" in
27 arm*)
28 ARCH_ARGS="\
29 --prefix=/usr \
30 --sysconfdir=/etc \
31 --infodir=/usr/share/info \
32 --mandir=/usr/share/man \
33 --config-cache \
34 --enable-mbstring \
35 --enable-sockets \
36 --enable-ftp \
37 --enable-zip \
38 --enable-calendar \
39 --enable-exif \
40 --enable-dba=shared \
41 --enable-sqlite-utf8 \
42 --with-mhash \
43 --with-sqlite=shared \
44 --with-config-file-path=/etc \
45 --with-zlib \
46 --with-gettext \
47 --with-curl=shared \
48 --with-openssl=shared \
49 --with-jpeg-dir=/usr \
50 --with-png-dir=/usr \
51 --with-apxs2=/usr/bin/apxs"
52 ;;
53 *)
54 ARCH_ARGS="\
55 --enable-mbstring \
56 --enable-sockets \
57 --enable-ftp \
58 --enable-zip \
59 --enable-calendar \
60 --enable-exif \
61 --config-cache \
62 --enable-dba=shared \
63 --with-config-file-path=/etc \
64 --with-zlib \
65 --with-gettext \
66 --with-mcrypt=shared,/usr \
67 --with-mysql=shared,/usr \
68 --with-mysqli=shared \
69 --with-mysql-sock=/var/run/mysqld/mysql.sock \
70 --with-pdo-sqlite=shared,/usr \
71 --with-pgsql=shared,/usr \
72 --with-snmp=shared,/usr \
73 --enable-soap=shared,/usr \
74 --with-ldap=shared \
75 --with-imap=shared \
76 --with-imap-ssl \
77 --with-mhash \
78 --with-gd=shared \
79 --with-jpeg-dir=/usr \
80 --with-png-dir=/usr \
81 --with-vpx-dir=/usr \
82 --with-openssl=shared \
83 --with-unixODBC=shared,/usr \
84 --with-pear=/usr/share/php \
85 --with-pdo-mysql=shared \
86 --with-pdo-pgsql=shared \
87 --with-curl=shared \
88 --with-sqlite3=shared,/usr \
89 --enable-maintainer-zts"
90 ;;
91 esac
93 sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' ext/gd/libgd/webpimg.c
94 sed -i 's/pam_start/pam_nostart/' configure
96 ./configure \
97 $ARCH_ARGS \
98 $CONFIGURE_ARGS &&
99 make $MAKEFLAGS &&
100 make -j1 INSTALL_ROOT=$DESTDIR install
102 ./configure \
103 $ARCH_ARGS \
104 $CONFIGURE_ARGS \
105 --with-apxs2=/usr/bin/apxs &&
106 make $MAKEFLAGS &&
107 mkdir -p $DESTDIR/etc/apache &&
108 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf &&
109 make -j1 INSTALL_ROOT=$DESTDIR install || return 1
111 # Production config file.
112 mkdir -p $DESTDIR/etc
113 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
114 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
115 -i $DESTDIR/etc/php.ini
117 install -Dm755 $src/sapi/cgi/php-cgi $install/usr/bin/php-cgi
119 install -Dm644 $stuff/phpinfo/index.php $install/usr/share/phpinfo/index.php
120 install -Dm644 $stuff/php.desktop $install/usr/share/applications/php.desktop
121 install -Dm644 $stuff/php.png $install/usr/share/pixmaps/php.png
122 }
124 genpkg_rules() {
125 case $PACKAGE in
126 php)
127 copy usr/bin/php-cgi
128 DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
129 PROVIDE="php:lighttpd"
130 ;;
131 php-apache)
132 copy usr/share/apache/
133 CAT="development|module for apache"
134 DEPENDS="php-common apache libxml2 zlib"
135 PROVIDE="php:apache"
136 ;;
137 php-cherokee)
138 copy usr/bin/php-cgi # FIXME! the same file in "php" package
139 CAT="development|module for cherokee"
140 DEPENDS="php-common cherokee libxml2 zlib"
141 PROVIDE="php:cherokee"
142 ;;
143 php-cli)
144 copy usr/bin/php
145 CAT="development|command line interpreter"
146 DEPENDS="php-common"
147 ;;
148 php-common)
149 copy phpinfo/ php.desktop php.png php.ini
150 CAT="development|common files for PHP modules"
151 DEPENDS=" "
152 CONFIG_FILES="/etc/php.ini"
153 ;;
154 php-curl)
155 copy curl.so
156 CAT="development|curl module"
157 DEPENDS="curl php"
158 ;;
159 php-dba)
160 copy dba.so
161 CAT="development|dba module"
162 DEPENDS=" "
163 ;;
164 php-dev)
165 copy @dev
166 DEPENDS="php cyrus-sasl libldap libmysqlclient libpng16 \
167 libpostgresqlclient libunixODBC mhash openssl jpeg \
168 libmcrypt libtool libkrb5 libcomerr3 net-snmp"
169 ;;
170 php-gd)
171 copy gd.so
172 CAT="development|gd module"
173 DEPENDS="libpng16 php jpeg libvpx"
174 ;;
175 php-imap)
176 copy imap.so
177 CAT="development|imap module"
178 DEPENDS="php openssl"
179 ;;
180 php-ldap)
181 copy ldap.so
182 CAT="development|ldap module"
183 DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
184 ;;
185 php-mcrypt)
186 copy mcrypt.so
187 CAT="development|mcrypt module"
188 DEPENDS="libmcrypt php libtool"
189 ;;
190 php-mysqli)
191 copy mysqli.so
192 CAT="development|mysqli module"
193 DEPENDS="libmysqlclient php"
194 ;;
195 php-mysql)
196 copy mysql.so
197 CAT="development|mysql module"
198 DEPENDS="libmysqlclient php"
199 ;;
200 php-odbc)
201 copy odbc.so
202 CAT="development|ODBC module"
203 DEPENDS="unixODBC php"
204 ;;
205 php-openssl)
206 copy openssl.so
207 CAT="development|OpenSSL module"
208 DEPENDS="php openssl"
209 ;;
210 php-pdo-mysql)
211 copy pdo_mysql.so
212 CAT="development|PDO MySQL module"
213 DEPENDS="php php-mysql"
214 ;;
215 php-pdo-pgsql)
216 copy pdo_pgsql.so
217 CAT="development|PDO PgSQL module"
218 DEPENDS="php php-mysql libpostgresqlclient"
219 ;;
220 php-pear)
221 copy etc/pear.conf usr/bin/pe* usr/share/php/
222 CAT="development|PEAR libs"
223 DEPENDS="php-cli"
224 ;;
225 php-pgsql)
226 copy pgsql.so
227 CAT="development|postgresql module"
228 DEPENDS="postgresql php"
229 ;;
230 php-snmp)
231 copy snmp.so
232 CAT="development|snmp module"
233 DEPENDS="net-snmp php openssl"
234 ;;
235 php-soap)
236 copy soap.so
237 CAT="development|soap module"
238 DEPENDS="php libxml2"
239 ;;
240 php-sqlite)
241 copy sqlite.so sqlite3.so pdo_sqlite.so
242 CAT="development|sqlite module"
243 DEPENDS="php sqlite3"
244 ;;
245 esac
246 }
248 # -----------------------------------------------------------------------------
249 pre_install_php() {
250 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
251 /etc/init.d/lighttpd stop
252 fi
253 }
255 post_install_php() {
256 # Enable php
257 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
259 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
260 tazpkg get-install lighttpd-modules --root="$1/"
262 sed \
263 -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
264 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
265 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
266 -i "$1/etc/lighttpd/lighttpd.conf"
268 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
269 sed \
270 -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
271 -i "$1/etc/lighttpd/lighttpd.conf"
273 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" ||
274 sed \
275 -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
276 -i "$1/etc/lighttpd/lighttpd.conf"
278 fi
280 # Start Web server.
281 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]; then
282 /etc/init.d/lighttpd start
283 fi
284 }
286 # -----------------------------------------------------------------------------
287 pre_installi_php_apache() {
288 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
289 /etc/init.d/apache stop
290 fi
291 }
293 post_install_php_apache() {
294 grep -q php5_module "$1/etc/apache/httpd.conf" ||
295 {
296 sed \
297 -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
298 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
299 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
300 -i "$1/etc/apache/httpd.conf"
301 }
303 [ -f "$1/etc/apache/conf.d/phpinfo" ] ||
304 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
305 <IfModule mod_alias.c>
306 Alias /phpinfo /usr/share/phpinfo
307 </IfModule>
308 <DirectoryMatch /usr/share/phpinfo/>
309 DirectoryIndex index.php
310 Options +FollowSymLinks
311 AllowOverride None
312 Order allow,deny
313 Allow from all
314 </DirectoryMatch>
315 EOT
317 # Restart Web server.
318 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
319 /etc/init.d/apache stop
320 sleep 2
321 fi
322 if [ -z "$1" ]; then
323 /etc/init.d/apache start
324 fi
325 }
327 # -----------------------------------------------------------------------------
328 pre_install_php_cherokee() {
329 if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]; then
330 /etc/init.d/cherokee stop
331 fi
332 }
334 post_install_php_cherokee() {
335 # Enable php
336 # if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
337 # [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
338 # tazpkg get-install lighttpd-modules --root="$1/"
339 # sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
340 # -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
341 # -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
342 # -i "$1/etc/lighttpd/lighttpd.conf"
343 # grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
344 # sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
345 # -i "$1/etc/lighttpd/lighttpd.conf"
346 # grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
347 # sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
348 # -i "$1/etc/lighttpd/lighttpd.conf"
349 # fi
351 # Start Web server.
352 if [ -z "$1" -a ! -f /var/run/cherokee.pid -a -f /etc/init.d/cherokee ]; then
353 /etc/init.d/cherokee start
354 fi
355 }
357 # -----------------------------------------------------------------------------
358 pre_install_php_common() {
359 # Backup existing php.ini
360 if [ -f "$1/etc/php.ini" ]; then
361 cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
362 fi
363 }
365 post_install_php_common() {
366 # Restore original php.ini
367 if [ -f "$1/etc/php.ini.bak" ]; then
368 mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
369 fi
370 }
372 # -----------------------------------------------------------------------------
373 pre_install_php_curl() {
374 while read daemon file; do
375 if [ -z "$1" -a -f "/var/run/$file" ]; then
376 /etc/init.d/$daemon stop
377 fi
378 done <<EOT
379 apache apache/httpd.pid
380 lighttpd lighttpd.pid
381 EOT
382 }
384 post_install_php_curl() {
385 grep -q ^extension=curl.so "$1/etc/php.ini" ||
386 sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
388 # Start Web server.
389 while read daemon file; do
390 [ -z "$1" ] || continue
391 if [ -f "/var/run/$file" ]; then
392 /etc/init.d/$daemon stop
393 sleep 2
394 fi
395 if [ -f /etc/init.d/$daemon ]; then
396 /etc/init.d/$daemon start
397 fi
398 done <<EOT
399 apache apache/httpd.pid
400 lighttpd lighttpd.pid
401 EOT
402 }
404 pre_remove_php_curl() {
405 sed -i '/.*=curl.so.*/d' /etc/php.ini
407 # Start Web server.
408 while read daemon file; do
409 [ -z "$1" ] || continue
410 if [ -f "/var/run/$file" ]; then
411 /etc/init.d/$daemon stop
412 sleep 2
413 fi
414 if [ -f /etc/init.d/$daemon ]; then
415 /etc/init.d/$daemon start
416 fi
417 done <<EOT
418 apache apache/httpd.pid
419 lighttpd lighttpd.pid
420 EOT
421 }
423 # -----------------------------------------------------------------------------
424 pre_install_php_dba() {
425 while read daemon file; do
426 if [ -z "$1" -a -f "/var/run/$file" ]; then
427 /etc/init.d/$daemon stop
428 fi
429 done <<EOT
430 apache apache/httpd.pid
431 lighttpd lighttpd.pid
432 EOT
433 }
435 post_install_php_dba() {
436 grep -q ^extension=dba.so "$1/etc/php.ini" ||
437 sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
439 # Start Web server.
440 while read daemon file; do
441 [ -z "$1" ] || continue
442 if [ -f "/var/run/$file" ]; then
443 /etc/init.d/$daemon stop
444 sleep 2
445 fi
446 if [ -f /etc/init.d/$daemon ]; then
447 /etc/init.d/$daemon start
448 fi
449 done <<EOT
450 apache apache/httpd.pid
451 lighttpd lighttpd.pid
452 EOT
453 }
455 pre_remove_php_dba() {
456 sed -i '/.*=dba.so.*/d' /etc/php.ini
458 # Start Web server.
459 while read daemon file; do
460 [ -z "$1" ] || continue
461 if [ -f "/var/run/$file" ]; then
462 /etc/init.d/$daemon stop
463 sleep 2
464 fi
465 if [ -f /etc/init.d/$daemon ]; then
466 /etc/init.d/$daemon start
467 fi
468 done <<EOT
469 apache apache/httpd.pid
470 lighttpd lighttpd.pid
471 EOT
472 }
474 # -----------------------------------------------------------------------------
475 pre_install_php_gd() {
476 while read daemon file; do
477 if [ -z "$1" -a -f "/var/run/$file" ]; then
478 /etc/init.d/$daemon stop
479 fi
480 done <<EOT
481 apache apache/httpd.pid
482 lighttpd lighttpd.pid
483 EOT
484 }
486 post_install_php_gd() {
487 grep -q ^extension=gd.so "$1/etc/php.ini" ||
488 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
490 # Start Web server.
491 while read daemon file; do
492 [ -z "$1" ] || continue
493 if [ -z "$1" -a -f "/var/run/$file" ]; then
494 /etc/init.d/$daemon stop
495 sleep 2
496 fi
497 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
498 /etc/init.d/$daemon start
499 fi
500 done <<EOT
501 apache apache/httpd.pid
502 lighttpd lighttpd.pid
503 EOT
504 }
506 pre_remove_php_gd() {
507 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
509 # Start Web server.
510 while read daemon file; do
511 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
512 [ -z "$1" ] || continue
513 if [ -z "$1" -a -f "/var/run/$file" ]; then
514 /etc/init.d/$daemon stop
515 sleep 2
516 fi
517 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
518 /etc/init.d/$daemon start
519 fi
520 fi
521 done <<EOT
522 apache apache/httpd.pid
523 lighttpd lighttpd.pid
524 EOT
525 }
527 # -----------------------------------------------------------------------------
528 pre_install_php_imap() {
529 while read daemon file; do
530 if [ -z "$1" -a -f "/var/run/$file" ]; then
531 /etc/init.d/$daemon stop
532 fi
533 done <<EOT
534 apache apache/httpd.pid
535 lighttpd lighttpd.pid
536 EOT
537 }
539 post_install_php_imap() {
540 grep -q ^extension=imap.so "$1/etc/php.ini" ||
541 sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
543 # Start Web server.
544 while read daemon file; do
545 [ -z "$1" ] || continue
546 if [ -f "/var/run/$file" ]; then
547 /etc/init.d/$daemon stop
548 sleep 2
549 fi
550 if [ -f /etc/init.d/$daemon ]; then
551 /etc/init.d/$daemon start
552 fi
553 done <<EOT
554 apache apache/httpd.pid
555 lighttpd lighttpd.pid
556 EOT
557 }
559 pre_remove_php_imap() {
560 sed -i '/.*=imap.so.*/d' /etc/php.ini
562 # Start Web server.
563 while read daemon file; do
564 [ -z "$1" ] || continue
565 if [ -f "/var/run/$file" ]; then
566 /etc/init.d/$daemon stop
567 sleep 2
568 fi
569 if [ -f /etc/init.d/$daemon ]; then
570 /etc/init.d/$daemon start
571 fi
572 done <<EOT
573 apache apache/httpd.pid
574 lighttpd lighttpd.pid
575 EOT
576 }
578 # -----------------------------------------------------------------------------
579 pre_install_php_ldap() {
580 while read daemon file; do
581 if [ -z "$1" -a -f "/var/run/$file" ]; then
582 /etc/init.d/$daemon stop
583 fi
584 done <<EOT
585 apache apache/httpd.pid
586 lighttpd lighttpd.pid
587 EOT
588 }
590 post_install_php_ldap() {
591 grep -q ^extension=ldap.so "$1/etc/php.ini" ||
592 sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
594 # Start Web server.
595 while read daemon file; do
596 [ -z "$1" ] || continue
597 if [ -f "/var/run/$file" ]; then
598 /etc/init.d/$daemon stop
599 sleep 2
600 fi
601 if [ -f /etc/init.d/$daemon ]; then
602 /etc/init.d/$daemon start
603 fi
604 done <<EOT
605 apache apache/httpd.pid
606 lighttpd lighttpd.pid
607 EOT
608 }
610 pre_remove_php_ldap() {
611 sed -i '/.*=ldap.so.*/d' /etc/php.ini
613 # Start Web server.
614 while read daemon file; do
615 [ -z "$1" ] || continue
616 if [ -f "/var/run/$file" ]; then
617 /etc/init.d/$daemon stop
618 sleep 2
619 fi
620 if [ -f /etc/init.d/$daemon ]; then
621 /etc/init.d/$daemon start
622 fi
623 done <<EOT
624 apache apache/httpd.pid
625 lighttpd lighttpd.pid
626 EOT
627 }
629 # -----------------------------------------------------------------------------
630 pre_install_php_mcrypt() {
631 while read daemon file; do
632 if [ -z "$1" -a -f "/var/run/$file" ]; then
633 /etc/init.d/$daemon stop
634 fi
635 done <<EOT
636 apache apache/httpd.pid
637 lighttpd lighttpd.pid
638 EOT
639 }
641 post_install_php_mcrypt() {
642 grep -q ^extension=mcrypt.so "$1/etc/php.ini" ||
643 sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.so|' -i "$1/etc/php.ini"
645 # Start Web server.
646 while read daemon file; do
647 [ -z "$1" ] || continue
648 if [ -f "/var/run/$file" ]; then
649 /etc/init.d/$daemon stop
650 sleep 2
651 fi
652 if [ -f /etc/init.d/$daemon ]; then
653 /etc/init.d/$daemon start
654 fi
655 done <<EOT
656 apache apache/httpd.pid
657 lighttpd lighttpd.pid
658 EOT
659 }
661 pre_remove_php_mcrypt() {
662 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
664 # Start Web server.
665 while read daemon file; do
666 [ -z "$1" ] || continue
667 if [ -f "/var/run/$file" ]; then
668 /etc/init.d/$daemon stop
669 sleep 2
670 fi
671 if [ -f /etc/init.d/$daemon ]; then
672 /etc/init.d/$daemon start
673 fi
674 done <<EOT
675 apache apache/httpd.pid
676 lighttpd lighttpd.pid
677 EOT
678 }
680 # -----------------------------------------------------------------------------
681 pre_install_php_mysqli() {
682 while read daemon file; do
683 if [ -z "$1" -a -f "/var/run/$file" ]; then
684 /etc/init.d/$daemon stop
685 fi
686 done <<EOT
687 apache apache/httpd.pid
688 lighttpd lighttpd.pid
689 EOT
690 }
692 post_install_php_mysqli() {
693 grep -q ^extension=mysqli.so "$1/etc/php.ini" ||
694 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
696 # Start Web server.
697 while read daemon file; do
698 [ -z "$1" ] || continue
699 if [ -f "/var/run/$file" ]; then
700 /etc/init.d/$daemon stop
701 sleep 2
702 fi
703 if [ -f /etc/init.d/$daemon ]; then
704 /etc/init.d/$daemon start
705 fi
706 done <<EOT
707 apache apache/httpd.pid
708 lighttpd lighttpd.pid
709 EOT
710 }
712 pre_remove_php_mysqli() {
713 sed -i '/.*=mysqli.so.*/d' /etc/php.ini
715 # Start Web server.
716 while read daemon file; do
717 [ -z "$1" ] || continue
718 if [ -f "/var/run/$file" ]; then
719 /etc/init.d/$daemon stop
720 sleep 2
721 fi
722 if [ -f /etc/init.d/$daemon ]; then
723 /etc/init.d/$daemon start
724 fi
725 done <<EOT
726 apache apache/httpd.pid
727 lighttpd lighttpd.pid
728 EOT
729 }
731 # -----------------------------------------------------------------------------
732 pre_install_php_mysql() {
733 while read daemon file; do
734 if [ -z "$1" -a -f "/var/run/$file" ]; then
735 /etc/init.d/$daemon stop
736 fi
737 done <<EOT
738 apache apache/httpd.pid
739 lighttpd lighttpd.pid
740 EOT
741 }
743 post_install_php_mysql() {
744 grep -q ^extension=mysql.so "$1/etc/php.ini" ||
745 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
747 # Start Web server.
748 while read daemon file; do
749 [ -z "$1" ] || continue
750 if [ -f "/var/run/$file" ]; then
751 /etc/init.d/$daemon stop
752 sleep 2
753 fi
754 if [ -f /etc/init.d/$daemon ]; then
755 /etc/init.d/$daemon start
756 fi
757 done <<EOT
758 apache apache/httpd.pid
759 lighttpd lighttpd.pid
760 EOT
761 }
763 pre_remove_php_mysql() {
764 sed -i '/.*=mysql.so.*/d' /etc/php.ini
766 # Start Web server.
767 while read daemon file; do
768 [ -z "$1" ] || continue
769 if [ -f "/var/run/$file" ]; then
770 /etc/init.d/$daemon stop
771 sleep 2
772 fi
773 if [ -f /etc/init.d/$daemon ]; then
774 /etc/init.d/$daemon start
775 fi
776 done <<EOT
777 apache apache/httpd.pid
778 lighttpd lighttpd.pid
779 EOT
780 }
782 # -----------------------------------------------------------------------------
783 pre_install_php_odbc() {
784 while read daemon file; do
785 if [ -z "$1" -a -f "/var/run/$file" ]; then
786 /etc/init.d/$daemon stop
787 fi
788 done <<EOT
789 apache apache/httpd.pid
790 lighttpd lighttpd.pid
791 EOT
792 }
794 post_install_php_odbc() {
795 grep -q ^extension=odbc.so "$1/etc/php.ini" ||
796 sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
798 # Start Web server.
799 while read daemon file; do
800 [ -z "$1" ] || continue
801 if [ -f "/var/run/$file" ]; then
802 /etc/init.d/$daemon stop
803 sleep 2
804 fi
805 if [ -f /etc/init.d/$daemon ]; then
806 /etc/init.d/$daemon start
807 fi
808 done <<EOT
809 apache apache/httpd.pid
810 lighttpd lighttpd.pid
811 EOT
812 }
814 pre_remove_php_odbc() {
815 sed -i '/.*=odbc.so.*/d' /etc/php.ini
817 # Start Web server.
818 while read daemon file; do
819 [ -z "$1" ] || continue
820 if [ -f "/var/run/$file" ]; then
821 /etc/init.d/$daemon stop
822 sleep 2
823 fi
824 if [ -f /etc/init.d/$daemon ]; then
825 /etc/init.d/$daemon start
826 fi
827 done <<EOT
828 apache apache/httpd.pid
829 lighttpd lighttpd.pid
830 EOT
831 }
833 # -----------------------------------------------------------------------------
834 pre_install_php_openssl() {
835 while read daemon file; do
836 if [ -z "$1" -a -f "/var/run/$file" ]; then
837 /etc/init.d/$daemon stop
838 fi
839 done <<EOT
840 apache apache/httpd.pid
841 lighttpd lighttpd.pid
842 EOT
843 }
845 post_install_php_openssl() {
846 grep -q ^extension=openssl.so "$1/etc/php.ini" ||
847 sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
849 # Start Web server.
850 while read daemon file; do
851 [ -z "$1" ] || continue
852 if [ -f "/var/run/$file" ]; then
853 /etc/init.d/$daemon stop
854 sleep 2
855 fi
856 if [ -f /etc/init.d/$daemon ]; then
857 /etc/init.d/$daemon start
858 fi
859 done <<EOT
860 apache apache/httpd.pid
861 lighttpd lighttpd.pid
862 EOT
863 }
865 pre_remove_php_openssl() {
866 sed -i '/.*=openssl.so.*/d' /etc/php.ini
868 # Start Web server.
869 while read daemon file; do
870 [ -z "$1" ] || continue
871 if [ -f "/var/run/$file" ]; then
872 /etc/init.d/$daemon stop
873 sleep 2
874 fi
875 if [ -f /etc/init.d/$daemon ]; then
876 /etc/init.d/$daemon start
877 fi
878 done <<EOT
879 apache apache/httpd.pid
880 lighttpd lighttpd.pid
881 EOT
882 }
884 # -----------------------------------------------------------------------------
885 pre_install_pdo_mysql() {
886 while read daemon file; do
887 if [ -z "$1" -a -f "/var/run/$file" ]; then
888 /etc/init.d/$daemon stop
889 fi
890 done <<EOT
891 apache apache/httpd.pid
892 lighttpd lighttpd.pid
893 EOT
894 }
896 post_install_pdo_mysql() {
897 grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" ||
898 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
900 # Start Web server.
901 while read daemon file; do
902 [ -z "$1" ] || continue
903 if [ -z "$1" -a -f "/var/run/$file" ]; then
904 /etc/init.d/$daemon stop
905 sleep 2
906 fi
907 if [ -z "$1" -a -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_pdo_mysql() {
917 sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
919 # Start Web server.
920 while read daemon file; do
921 [ -z "$1" ] || continue
922 if [ -z "$1" -a -f "/var/run/$file" ]; then
923 /etc/init.d/$daemon stop
924 sleep 2
925 fi
926 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
927 /etc/init.d/$daemon start
928 fi
929 done <<EOT
930 apache apache/httpd.pid
931 lighttpd lighttpd.pid
932 EOT
933 }
935 # -----------------------------------------------------------------------------
936 pre_install_pdo_pgsql() {
937 while read daemon file; do
938 if [ -z "$1" -a -f "/var/run/$file" ]; then
939 /etc/init.d/$daemon stop
940 fi
941 done <<EOT
942 apache apache/httpd.pid
943 lighttpd lighttpd.pid
944 EOT
945 }
947 post_install_pdo_pgsql() {
948 grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" ||
949 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
951 # Start Web server.
952 while read daemon file; do
953 [ -z "$1" ] || continue
954 if [ -z "$1" -a -f "/var/run/$file" ]; then
955 /etc/init.d/$daemon stop
956 sleep 2
957 fi
958 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
959 /etc/init.d/$daemon start
960 fi
961 done <<EOT
962 apache apache/httpd.pid
963 lighttpd lighttpd.pid
964 EOT
965 }
967 pre_remove_pdo_pgsql() {
968 sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
970 # Start Web server.
971 while read daemon file; do
972 [ -z "$1" ] || continue
973 if [ -z "$1" -a -f "/var/run/$file" ]; then
974 /etc/init.d/$daemon stop
975 sleep 2
976 fi
977 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
978 /etc/init.d/$daemon start
979 fi
980 done <<EOT
981 apache apache/httpd.pid
982 lighttpd lighttpd.pid
983 EOT
984 }
986 # -----------------------------------------------------------------------------
987 pre_install_php_pear() {
988 while read daemon file; do
989 if [ -z "$1" -a -f "/var/run/$file" ]; then
990 /etc/init.d/$daemon stop
991 fi
992 done <<EOT
993 apache apache/httpd.pid
994 lighttpd lighttpd.pid
995 EOT
996 }
998 post_install_php_pear() {
999 grep ^include_path "$1/etc/php.ini"
1000 sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
1001 # Restart Web server.
1002 while read daemon file; do
1003 [ -z "$1" ] || continue
1004 if [ -f "/var/run/$file" ]; then
1005 /etc/init.d/$daemon stop
1006 sleep 2
1007 fi
1008 if [ -f /etc/init.d/$daemon ]; then
1009 /etc/init.d/$daemon start
1010 fi
1011 done <<EOT
1012 apache apache/httpd.pid
1013 lighttpd lighttpd.pid
1014 EOT
1015 }
1017 # -----------------------------------------------------------------------------
1018 pre_install_php_pgsql() {
1019 while read daemon file; do
1020 if [ -z "$1" -a -f "/var/run/$file" ]; then
1021 /etc/init.d/$daemon stop
1022 fi
1023 done <<EOT
1024 apache apache/httpd.pid
1025 lighttpd lighttpd.pid
1026 EOT
1027 }
1029 post_install_php_pgsql() {
1030 grep -q ^extension=pgsql.so "$1/etc/php.ini" ||
1031 sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/etc/php.ini"
1033 # Start Web server.
1034 while read daemon file; do
1035 [ -z "$1" ] || continue
1036 if [ -f "/var/run/$file" ]; then
1037 /etc/init.d/$daemon stop
1038 sleep 2
1039 fi
1040 if [ -f /etc/init.d/$daemon ]; then
1041 /etc/init.d/$daemon start
1042 fi
1043 done <<EOT
1044 apache apache/httpd.pid
1045 lighttpd lighttpd.pid
1046 EOT
1047 }
1049 pre_remove_php_pgsql() {
1050 sed -i '/.*=pgsql.so.*/d' /etc/php.ini
1052 # Start Web server.
1053 while read daemon file; do
1054 [ -z "$1" ] || continue
1055 if [ -f "/var/run/$file" ]; then
1056 /etc/init.d/$daemon stop
1057 sleep 2
1058 fi
1059 if [ -f /etc/init.d/$daemon ]; then
1060 /etc/init.d/$daemon start
1061 fi
1062 done <<EOT
1063 apache apache/httpd.pid
1064 lighttpd lighttpd.pid
1065 EOT
1066 }
1068 # -----------------------------------------------------------------------------
1069 pre_install_php_snmp() {
1070 while read daemon file; do
1071 if [ -z "$1" -a -f "/var/run/$file" ]; then
1072 /etc/init.d/$daemon stop
1073 fi
1074 done <<EOT
1075 apache apache/httpd.pid
1076 lighttpd lighttpd.pid
1077 EOT
1078 }
1080 post_install_php_snmp() {
1081 grep -q ^extension=snmp.so "$1/etc/php.ini" ||
1082 sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
1084 # Start Web server.
1085 while read daemon file; do
1086 [ -z "$1" ] || continue
1087 if [ -f "/var/run/$file" ]; then
1088 /etc/init.d/$daemon stop
1089 sleep 2
1090 fi
1091 if [ -f /etc/init.d/$daemon ]; then
1092 /etc/init.d/$daemon start
1093 fi
1094 done <<EOT
1095 apache apache/httpd.pid
1096 lighttpd lighttpd.pid
1097 EOT
1098 }
1100 pre_remove_php_snmp() {
1101 sed -i '/.*=snmp.so.*/d' /etc/php.ini
1103 # Start Web server.
1104 while read daemon file; do
1105 [ -z "$1" ] || continue
1106 if [ -f "/var/run/$file" ]; then
1107 /etc/init.d/$daemon stop
1108 sleep 2
1109 fi
1110 if [ -f /etc/init.d/$daemon ]; then
1111 /etc/init.d/$daemon start
1112 fi
1113 done <<EOT
1114 apache apache/httpd.pid
1115 lighttpd lighttpd.pid
1116 EOT
1117 }
1119 # -----------------------------------------------------------------------------
1120 pre_install_php_soap() {
1121 while read daemon file; do
1122 if [ -z "$1" -a -f "/var/run/$file" ]; then
1123 /etc/init.d/$daemon stop
1124 fi
1125 done <<EOT
1126 apache apache/httpd.pid
1127 lighttpd lighttpd.pid
1128 EOT
1129 }
1131 post_install_php_soap() {
1132 grep -q ^extension=soap.so "$1/etc/php.ini" ||
1133 sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
1135 # Start Web server.
1136 while read daemon file; do
1137 [ -z "$1" ] || continue
1138 if [ -f "/var/run/$file" ]; then
1139 /etc/init.d/$daemon stop
1140 sleep 2
1141 fi
1142 if [ -f /etc/init.d/$daemon ]; then
1143 /etc/init.d/$daemon start
1144 fi
1145 done <<EOT
1146 apache apache/httpd.pid
1147 lighttpd lighttpd.pid
1148 EOT
1149 }
1151 pre_remove_php_soap() {
1152 sed -i '/.*=soap.so.*/d' /etc/php.ini
1154 # Start Web server.
1155 while read daemon file; do
1156 [ -z "$1" ] || continue
1157 if [ -f "/var/run/$file" ]; then
1158 /etc/init.d/$daemon stop
1159 sleep 2
1160 fi
1161 if [ -f /etc/init.d/$daemon ]; then
1162 /etc/init.d/$daemon start
1163 fi
1164 done <<EOT
1165 apache apache/httpd.pid
1166 lighttpd lighttpd.pid
1167 EOT
1168 }
1170 # -----------------------------------------------------------------------------
1171 post_install_php_sqlite() {
1172 grep -q ^extension=sqlite3.so "$1/etc/php.ini" ||
1173 sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
1175 # Start Web server.
1176 while read daemon file; do
1177 [ -z "$1" ] || continue
1178 if [ -f "/var/run/$file" ]; then
1179 /etc/init.d/$daemon stop
1180 sleep 2
1181 fi
1182 if [ -f /etc/init.d/$daemon ]; then
1183 /etc/init.d/$daemon start
1184 fi
1185 done <<EOT
1186 apache apache/httpd.pid
1187 lighttpd lighttpd.pid
1188 EOT
1189 }
1191 pre_remove_php_sqlite() {
1192 sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
1194 # Start Web server.
1195 while read daemon file; do
1196 [ -z "$1" ] || continue
1197 if [ -f "/var/run/$file" ]; then
1198 /etc/init.d/$daemon stop
1199 sleep 2
1200 fi
1201 if [ -f /etc/init.d/$daemon ]; then
1202 /etc/init.d/$daemon start
1203 fi
1204 done <<EOT
1205 apache apache/httpd.pid
1206 lighttpd lighttpd.pid
1207 EOT
1208 }