wok-next view php/receipt @ rev 20458

Unlock x86_64 architecture
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 02 12:12:14 2018 +0200 (2018-03-02)
parents dd145c435e4b
children d43bf7aae921
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 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.php.net/"
11 WGET_URL="http://www.php.net/distributions/$TARBALL"
13 BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
14 net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
15 c-client mhash-dev libpng16-dev libunixODBC unixODBC-dev openldap-dev \
16 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl pkg-config \
17 jpeg-dev net-snmp-dev libvpx-dev apache coreutils-conditions sed re2c"
18 SPLIT="php-apache php-cherokee php-cli php-common php-curl php-dba php-dev \
19 php-gd php-imap php-ldap php-mcrypt php-mysqli php-mysql php-odbc php-openssl \
20 php-pdo-mysql php-pdo-pgsql php-pear php-pgsql php-snmp php-soap php-sqlite"
22 case "$ARCH" in
23 i?86)
24 ARCH_ARGS="\
25 --prefix=/usr \
26 --sysconfdir=/etc \
27 --infodir=/usr/share/info \
28 --mandir=/usr/share/man \
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" ;;
64 arm*)
65 BUILD_DEPENDS="sqlite3-dev libxml2-dev zlib-dev curl-dev"
66 ARCH_ARGS="\
67 --prefix=/usr \
68 --sysconfdir=/etc \
69 --infodir=/usr/share/info \
70 --mandir=/usr/share/man \
71 --config-cache \
72 --enable-mbstring \
73 --enable-sockets \
74 --enable-ftp \
75 --enable-zip \
76 --enable-calendar \
77 --enable-exif \
78 --enable-dba=shared \
79 --enable-sqlite-utf8 \
80 --with-mhash \
81 --with-sqlite=shared \
82 --with-config-file-path=/etc \
83 --with-zlib \
84 --with-gettext \
85 --with-curl=shared \
86 --with-openssl=shared \
87 --with-jpeg-dir=/usr \
88 --with-png-dir=/usr \
89 --with-apxs2=/usr/bin/apxs" ;;
90 esac
92 # Rules to configure and make the package.
93 compile_rules()
94 {
95 sed -i 's|PLANE_[UVY]\]|VPX_&|;s|IMG_FMT_I420|VPX_&|' ext/gd/libgd/webpimg.c
96 sed -i 's/pam_start/pam_nostart/' configure
97 ./configure $ARCH_ARGS $CONFIGURE_ARGS && \
98 make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
99 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
100 make $MAKEFLAGS && {
101 mkdir -p $DESTDIR/etc/apache
102 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
103 make -j1 INSTALL_ROOT=$DESTDIR install
104 }
105 # Production config file.
106 mkdir -p $DESTDIR/etc
107 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
108 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
109 -i $DESTDIR/etc/php.ini
110 }
112 # Rules to gen a SliTaz package suitable for Tazpkg.
113 genpkg_rules()
114 {
115 case $PACKAGE in
116 php)
117 PROVIDE="php:lighttpd"
118 DEPENDS="php-common lighttpd zlib libxml2 sqlite3 openssl"
119 mkdir -p $fs/usr/bin $fs/usr/share/php
120 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
121 ;;
122 php-apache)
123 CAT="development|PHP module for apache."
124 PROVIDE="php:apache"
125 DEPENDS="php-common apache libxml2 zlib"
126 mkdir -p $fs/usr/share
127 cp -a $install/usr/share/apache $fs/usr/share
128 ;;
129 php-cherokee)
130 CAT="development|PHP module for cherokee."
131 PROVIDE="php:cherokee"
132 DEPENDS="php-common cherokee libxml2 zlib"
133 mkdir -p $fs/usr/bin $fs/usr/share/php
134 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
135 ;;
136 php-cli)
137 CAT="development|PHP web programming language command line interpreter."
138 DEPENDS="php-common"
139 mkdir -p $fs/usr/bin
140 cp -a $install/usr/bin/php $fs/usr/bin
141 ;;
142 php-common)
143 CAT="development|Common files for PHP modules."
144 CONFIG_FILES="/etc/php.ini"
145 mkdir -p $fs/etc \
146 $fs/usr/share/applications \
147 $fs/usr/share/pixmaps
148 cp -a $stuff/phpinfo $fs/usr/share
149 cp $stuff/php.desktop $fs/usr/share/applications
150 cp $stuff/php.png $fs/usr/share/pixmaps
151 cp $install/etc/php.ini $fs/etc
152 ;;
153 php-curl)
154 CAT="development|curl module for PHP web programming language."
155 DEPENDS="curl php"
156 mkdir -p $fs/usr/share/php
157 cp $(find $install | grep curl.so) $fs/usr/share/php/
158 ;;
159 php-dba)
160 CAT="development|dba module for PHP web programming language."
161 mkdir -p $fs/usr/share/php
162 cp $(find $install | grep dba.so) $fs/usr/share/php/
163 ;;
164 php-dev)
165 CAT="development|PHP web programming language development files."
166 DEPENDS="php cyrus-sasl libldap libmysqlclient libpng16 \
167 libpostgresqlclient libunixODBC mhash openssl jpeg \
168 libmcrypt libtool libkrb5 libcomerr3 net-snmp"
169 mkdir -p $fs/usr/lib/php $fs/usr/bin
170 cp -a $install/usr/lib/php/extensions $fs/usr/lib/php
171 rm -f $fs/usr/lib/php/*so
172 cp -a $install/usr/lib/php/build $fs/usr/lib/php
173 cp -a $install/usr/include $fs/usr
174 cp -a $install/usr/bin/php-config $install/usr/bin/phpize $fs/usr/bin
175 ;;
176 php-gd)
177 CAT="development|gd module for PHP web programming language."
178 DEPENDS="libpng16 php jpeg libvpx"
179 mkdir -p $fs/usr/share/php
180 cp $(find $install | grep gd.so) $fs/usr/share/php/
181 ;;
182 php-imap)
183 CAT="development|imap module for PHP web programming language."
184 DEPENDS="php openssl"
185 mkdir -p $fs/usr/share/php
186 cp $(find $install | grep imap.so) $fs/usr/share/php/
187 ;;
188 php-ldap)
189 CAT="development|ldap module for PHP web programming language."
190 DEPENDS="libldap php openssl cyrus-sasl libkrb5 libcomerr3"
191 mkdir -p $fs/usr/share/php
192 cp $(find $install | grep ldap.so) $fs/usr/share/php/
193 ;;
194 php-mcrypt)
195 CAT="development|mcrypt module for PHP web programming language."
196 DEPENDS="libmcrypt php libtool"
197 mkdir -p $fs/usr/share/php
198 cp $(find $install | grep mcrypt.so) $fs/usr/share/php/
199 ;;
200 php-mysqli)
201 CAT="development|mysqli module for PHP web programming language."
202 DEPENDS="libmysqlclient php"
203 mkdir -p $fs/usr/share/php
204 cp $(find $install | grep mysqli.so) $fs/usr/share/php/
205 ;;
206 php-mysql)
207 CAT="development|mysql module for PHP web programming language."
208 DEPENDS="libmysqlclient php"
209 mkdir -p $fs/usr/share/php
210 cp $(find $install | grep mysql.so) $fs/usr/share/php/
211 ;;
212 php-odbc)
213 CAT="development|ODBC module for PHP web programming language."
214 DEPENDS="unixODBC php"
215 mkdir -p $fs/usr/share/php
216 cp $(find $install | grep odbc.so) $fs/usr/share/php/
217 ;;
218 php-openssl)
219 CAT="development|Openssl module for PHP web programming language."
220 DEPENDS="php openssl"
221 mkdir -p $fs/usr/share/php
222 cp $(find $install | grep openssl.so) $fs/usr/share/php/
223 ;;
224 php-pdo-mysql)
225 CAT="development|PDO MySQL module for PHP web programming language."
226 DEPENDS="php php-mysql"
227 mkdir -p $fs/usr/share/php
228 cp $(find $install | grep pdo_mysql.so) $fs/usr/share/php/
229 ;;
230 php-pdo-pgsql)
231 CAT="development|PDO PgSQL module for PHP web programming language."
232 DEPENDS="php php-mysql libpostgresqlclient"
233 mkdir -p $fs/usr/share/php
234 cp $(find $install | grep pdo_pgsql.so) $fs/usr/share/php/
235 ;;
236 php-pear)
237 CAT="development|PHP web programming language pear libs."
238 DEPENDS="php-cli"
239 mkdir -p $fs/usr/share $fs/usr/bin $fs/etc
240 cp -a $install/usr/share/php $fs/usr/share
241 cp -a $install/etc/pear.conf $fs/etc
242 cp -a $install/usr/bin/pe* $fs/usr/bin
243 ;;
244 php-pgsql)
245 CAT="development|postgresql module for PHP web programming language."
246 DEPENDS="postgresql php"
247 mkdir -p $fs/usr/share/php
248 cp $(find $install | grep pgsql.so) $fs/usr/share/php/
249 ;;
250 php-snmp)
251 CAT="development|snmp module for PHP web programming language."
252 DEPENDS="net-snmp php openssl"
253 mkdir -p $fs/usr/share/php
254 cp $(find $install | grep snmp.so) $fs/usr/share/php/
255 ;;
256 php-soap)
257 CAT="development|soap module for PHP web programming language."
258 DEPENDS="php libxml2"
259 mkdir -p $fs/usr/share/php
260 cp $(find $install | grep soap.so) $fs/usr/share/php/
261 ;;
262 php-sqlite)
263 CAT="development|sqlite module for PHP web programming language."
264 DEPENDS="php sqlite3"
265 mkdir -p $fs/usr/share/php
266 cp $(find $install | grep sqlite.so) $fs/usr/share/php/
267 cp $(find $install | grep sqlite3.so) $fs/usr/share/php/
268 cp $(find $install | grep pdo_sqlite.so) $fs/usr/share/php/
269 ;;
270 esac
271 }
273 # Post and pre install commands to stop
274 # and restart Web server if needed.
275 pre_install_php()
276 {
277 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
278 /etc/init.d/lighttpd stop
279 fi
280 }
282 post_install_php()
283 {
284 # Enable php
285 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
286 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
287 tazpkg get-install lighttpd-modules --root="$1/"
288 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
289 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
290 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
291 -i "$1/etc/lighttpd/lighttpd.conf"
292 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
293 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
294 -i "$1/etc/lighttpd/lighttpd.conf"
295 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
296 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
297 -i "$1/etc/lighttpd/lighttpd.conf"
298 fi
299 # Start Web server.
300 if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
301 -a -f /etc/init.d/lighttpd ]; then
302 /etc/init.d/lighttpd start
303 fi
304 }
306 # Post and pre install commans to stop
307 # and restart Web server if needed.
308 pre_installi_php_apache()
309 {
310 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
311 /etc/init.d/apache stop
312 fi
313 }
315 post_install_php_apache()
316 {
317 grep -q php5_module "$1/etc/apache/httpd.conf" || {
318 sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php5_module share/apache/modules/libphp5.so|' \
319 -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
320 -e 's|mime.types|mime.types\n AddType application/x-httpd-php .php .php3 .php4 .php5\n AddType application/x-httpd-php-source .phps|' \
321 -i "$1/etc/apache/httpd.conf"
322 }
323 [ -f "$1/etc/apache/conf.d/phpinfo" ] || \
324 cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
325 <IfModule mod_alias.c>
326 Alias /phpinfo /usr/share/phpinfo
327 </IfModule>
328 <DirectoryMatch /usr/share/phpinfo/>
329 DirectoryIndex index.php
330 Options +FollowSymLinks
331 AllowOverride None
332 Order allow,deny
333 Allow from all
334 </DirectoryMatch>
335 EOT
336 # Restart Web server.
337 if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]; then
338 /etc/init.d/apache stop
339 sleep 2
340 fi
341 if [ -z "$1" ]; then
342 /etc/init.d/apache start
343 fi
344 }
346 # Post and pre install commands to stop
347 # and restart Web server if needed.
348 pre_install_php_cherokee()
349 {
350 if [ -z "$1" -a ! -f "/var/run/cherokee.pid" ]; then
351 /etc/init.d/cherokee stop
352 fi
353 }
355 post_install_php_cherokee()
356 {
357 # Enable php
358 # if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
359 # [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
360 # tazpkg get-install lighttpd-modules --root="$1/"
361 # sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
362 # -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
363 # -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
364 # -i "$1/etc/lighttpd/lighttpd.conf"
365 # grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
366 # sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
367 # -i "$1/etc/lighttpd/lighttpd.conf"
368 # grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
369 # sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
370 # -i "$1/etc/lighttpd/lighttpd.conf"
371 # fi
374 # Start Web server.
375 if [ -z "$1" -a ! -f /var/run/cherokee.pid \
376 -a -f /etc/init.d/cherokee ]; then
377 /etc/init.d/cherokee start
378 fi
379 }
381 # Post and pre install commands
382 pre_install_php_common()
383 {
384 # Backup existing php.ini
385 if [ -f "$1/etc/php.ini" ]; then
386 echo -n "Creating php.ini backup..."
387 cp "$1/etc/php.ini" "$1/etc/php.ini.bak"
388 status
389 fi
390 }
391 post_install_php_common()
392 {
393 # Restore original php.ini
394 if [ -f "$1/etc/php.ini.bak" ]; then
395 echo -n "Restoring php.ini backup..."
396 mv -f "$1/etc/php.ini.bak" "$1/etc/php.ini"
397 status
398 fi
399 }
401 # Post and pre install commans to stop
402 # and restart Web server if needed.
403 pre_install_php_curl()
404 {
405 while read daemon file; do
406 if [ -z "$1" -a -f "/var/run/$file" ]; then
407 /etc/init.d/$daemon stop
408 fi
409 done <<EOT
410 apache apache/httpd.pid
411 lighttpd lighttpd.pid
412 EOT
413 }
415 post_install_php_curl()
416 {
417 grep -q ^extension=curl.so "$1/etc/php.ini" || \
418 sed -e 's|extension=msql.so|extension=msql.so\nextension=curl.so|' -i "$1/etc/php.ini"
419 # Start Web server.
420 while read daemon file; do
421 [ -z "$1" ] || continue
422 if [ -f "/var/run/$file" ]; then
423 /etc/init.d/$daemon stop
424 sleep 2
425 fi
426 if [ -f /etc/init.d/$daemon ]; then
427 /etc/init.d/$daemon start
428 fi
429 done <<EOT
430 apache apache/httpd.pid
431 lighttpd lighttpd.pid
432 EOT
433 }
435 # Pre and post remove commands for Tazpkg.
436 pre_remove_php_curl()
437 {
438 sed -i '/.*=curl.so.*/d' /etc/php.ini
440 # Start Web server.
441 while read daemon file; do
442 [ -z "$1" ] || continue
443 if [ -f "/var/run/$file" ]; then
444 /etc/init.d/$daemon stop
445 sleep 2
446 fi
447 if [ -f /etc/init.d/$daemon ]; then
448 /etc/init.d/$daemon start
449 fi
450 done <<EOT
451 apache apache/httpd.pid
452 lighttpd lighttpd.pid
453 EOT
454 }
456 # Post and pre install commans to stop
457 # and restart Web server if needed.
458 pre_install_php_dba()
459 {
460 while read daemon file; do
461 if [ -z "$1" -a -f "/var/run/$file" ]; then
462 /etc/init.d/$daemon stop
463 fi
464 done <<EOT
465 apache apache/httpd.pid
466 lighttpd lighttpd.pid
467 EOT
468 }
470 post_install_php_dba()
471 {
472 grep -q ^extension=dba.so "$1/etc/php.ini" || \
473 sed -e 's|extension=msql.so|extension=msql.so\nextension=dba.so|' -i "$1/etc/php.ini"
474 # Start Web server.
475 while read daemon file; do
476 [ -z "$1" ] || continue
477 if [ -f "/var/run/$file" ]; then
478 /etc/init.d/$daemon stop
479 sleep 2
480 fi
481 if [ -f /etc/init.d/$daemon ]; then
482 /etc/init.d/$daemon start
483 fi
484 done <<EOT
485 apache apache/httpd.pid
486 lighttpd lighttpd.pid
487 EOT
488 }
490 # Pre and post remove commands for Tazpkg.
491 pre_remove_php_dba()
492 {
493 sed -i '/.*=dba.so.*/d' /etc/php.ini
495 # Start Web server.
496 while read daemon file; do
497 [ -z "$1" ] || continue
498 if [ -f "/var/run/$file" ]; then
499 /etc/init.d/$daemon stop
500 sleep 2
501 fi
502 if [ -f /etc/init.d/$daemon ]; then
503 /etc/init.d/$daemon start
504 fi
505 done <<EOT
506 apache apache/httpd.pid
507 lighttpd lighttpd.pid
508 EOT
509 }
511 # Post and pre install commans to stop
512 # and restart Web server if needed.
513 pre_install_php_gd()
514 {
515 while read daemon file; do
516 if [ -z "$1" -a -f "/var/run/$file" ]; then
517 /etc/init.d/$daemon stop
518 fi
519 done <<EOT
520 apache apache/httpd.pid
521 lighttpd lighttpd.pid
522 EOT
523 }
525 post_install_php_gd()
526 {
527 grep -q ^extension=gd.so "$1/etc/php.ini" || \
528 sed -e 's|extension=msql.so|extension=msql.so\nextension=gd.so|' -i "$1/etc/php.ini"
529 # Start Web server.
530 while read daemon file; do
531 [ -z "$1" ] || continue
532 if [ -z "$1" -a -f "/var/run/$file" ]; then
533 /etc/init.d/$daemon stop
534 sleep 2
535 fi
536 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
537 /etc/init.d/$daemon start
538 fi
539 done <<EOT
540 apache apache/httpd.pid
541 lighttpd lighttpd.pid
542 EOT
543 }
545 # Pre and post remove commands for Tazpkg.
546 pre_remove_php_gd()
547 {
548 sed -i '/.*=gd.so.*/d' "$1/etc/php.ini"
550 # Start Web server.
551 while read daemon file; do
552 if [ -f /etc/init.d/$daemon -a -f "/var/run/$file" ]; then
553 [ -z "$1" ] || continue
554 if [ -z "$1" -a -f "/var/run/$file" ]; then
555 /etc/init.d/$daemon stop
556 sleep 2
557 fi
558 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
559 /etc/init.d/$daemon start
560 fi
561 fi
562 done <<EOT
563 apache apache/httpd.pid
564 lighttpd lighttpd.pid
565 EOT
566 }
568 # Post and pre install commans to stop
569 # and restart Web server if needed.
570 pre_install_php_imap()
571 {
572 while read daemon file; do
573 if [ -z "$1" -a -f "/var/run/$file" ]; then
574 /etc/init.d/$daemon stop
575 fi
576 done <<EOT
577 apache apache/httpd.pid
578 lighttpd lighttpd.pid
579 EOT
580 }
582 post_install_php_imap()
583 {
584 grep -q ^extension=imap.so "$1/etc/php.ini" || \
585 sed -e 's|extension=msql.so|extension=msql.so\nextension=imap.so|' -i "$1/etc/php.ini"
586 # Start Web server.
587 while read daemon file; do
588 [ -z "$1" ] || continue
589 if [ -f "/var/run/$file" ]; then
590 /etc/init.d/$daemon stop
591 sleep 2
592 fi
593 if [ -f /etc/init.d/$daemon ]; then
594 /etc/init.d/$daemon start
595 fi
596 done <<EOT
597 apache apache/httpd.pid
598 lighttpd lighttpd.pid
599 EOT
600 }
602 # Pre and post remove commands for Tazpkg.
603 pre_remove_php_imap()
604 {
605 sed -i '/.*=imap.so.*/d' /etc/php.ini
607 # Start Web server.
608 while read daemon file; do
609 [ -z "$1" ] || continue
610 if [ -f "/var/run/$file" ]; then
611 /etc/init.d/$daemon stop
612 sleep 2
613 fi
614 if [ -f /etc/init.d/$daemon ]; then
615 /etc/init.d/$daemon start
616 fi
617 done <<EOT
618 apache apache/httpd.pid
619 lighttpd lighttpd.pid
620 EOT
621 }
623 # Post and pre install commans to stop
624 # and restart Web server if needed.
625 pre_install_php_ldap()
626 {
627 while read daemon file; do
628 if [ -z "$1" -a -f "/var/run/$file" ]; then
629 /etc/init.d/$daemon stop
630 fi
631 done <<EOT
632 apache apache/httpd.pid
633 lighttpd lighttpd.pid
634 EOT
635 }
637 post_install_php_ldap()
638 {
639 grep -q ^extension=ldap.so "$1/etc/php.ini" || \
640 sed -e 's|extension=msql.so|extension=msql.so\nextension=ldap.so|' -i "$1/etc/php.ini"
641 # Start Web server.
642 while read daemon file; do
643 [ -z "$1" ] || continue
644 if [ -f "/var/run/$file" ]; then
645 /etc/init.d/$daemon stop
646 sleep 2
647 fi
648 if [ -f /etc/init.d/$daemon ]; then
649 /etc/init.d/$daemon start
650 fi
651 done <<EOT
652 apache apache/httpd.pid
653 lighttpd lighttpd.pid
654 EOT
655 }
657 # Pre and post remove commands for Tazpkg.
658 pre_remove_php_ldap()
659 {
660 sed -i '/.*=ldap.so.*/d' /etc/php.ini
662 # Start Web server.
663 while read daemon file; do
664 [ -z "$1" ] || continue
665 if [ -f "/var/run/$file" ]; then
666 /etc/init.d/$daemon stop
667 sleep 2
668 fi
669 if [ -f /etc/init.d/$daemon ]; then
670 /etc/init.d/$daemon start
671 fi
672 done <<EOT
673 apache apache/httpd.pid
674 lighttpd lighttpd.pid
675 EOT
676 }
678 # Post and pre install commans to stop
679 # and restart Web server if needed.
680 pre_install_php_mcrypt()
681 {
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_mcrypt()
693 {
694 grep -q ^extension=mcrypt.so "$1/etc/php.ini" || \
695 sed -e 's|extension=msql.so|extension=msql.so\nextension=mcrypt.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 and post remove commands for Tazpkg.
713 pre_remove_php_mcrypt()
714 {
715 sed -i '/.*=mcrypt.so.*/d' /etc/php.ini
717 # Start Web server.
718 while read daemon file; do
719 [ -z "$1" ] || continue
720 if [ -f "/var/run/$file" ]; then
721 /etc/init.d/$daemon stop
722 sleep 2
723 fi
724 if [ -f /etc/init.d/$daemon ]; then
725 /etc/init.d/$daemon start
726 fi
727 done <<EOT
728 apache apache/httpd.pid
729 lighttpd lighttpd.pid
730 EOT
731 }
733 # Post and pre install commans to stop
734 # and restart Web server if needed.
735 pre_install_php_mysqli()
736 {
737 while read daemon file; do
738 if [ -z "$1" -a -f "/var/run/$file" ]; then
739 /etc/init.d/$daemon stop
740 fi
741 done <<EOT
742 apache apache/httpd.pid
743 lighttpd lighttpd.pid
744 EOT
745 }
747 post_install_php_mysqli()
748 {
749 grep -q ^extension=mysqli.so "$1/etc/php.ini" || \
750 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysqli.so|' -i "$1/etc/php.ini"
751 # Start Web server.
752 while read daemon file; do
753 [ -z "$1" ] || continue
754 if [ -f "/var/run/$file" ]; then
755 /etc/init.d/$daemon stop
756 sleep 2
757 fi
758 if [ -f /etc/init.d/$daemon ]; then
759 /etc/init.d/$daemon start
760 fi
761 done <<EOT
762 apache apache/httpd.pid
763 lighttpd lighttpd.pid
764 EOT
765 }
767 # Pre and post remove commands for Tazpkg.
768 pre_remove_php_mysqli()
769 {
770 sed -i '/.*=mysqli.so.*/d' /etc/php.ini
772 # Start Web server.
773 while read daemon file; do
774 [ -z "$1" ] || continue
775 if [ -f "/var/run/$file" ]; then
776 /etc/init.d/$daemon stop
777 sleep 2
778 fi
779 if [ -f /etc/init.d/$daemon ]; then
780 /etc/init.d/$daemon start
781 fi
782 done <<EOT
783 apache apache/httpd.pid
784 lighttpd lighttpd.pid
785 EOT
786 }
788 # Post and pre install commans to stop
789 # and restart Web server if needed.
790 pre_install_php_mysql()
791 {
792 while read daemon file; do
793 if [ -z "$1" -a -f "/var/run/$file" ]; then
794 /etc/init.d/$daemon stop
795 fi
796 done <<EOT
797 apache apache/httpd.pid
798 lighttpd lighttpd.pid
799 EOT
800 }
802 post_install_php_mysql()
803 {
804 grep -q ^extension=mysql.so "$1/etc/php.ini" || \
805 sed -e 's|extension=msql.so|extension=msql.so\nextension=mysql.so|' -i "$1/etc/php.ini"
806 # Start Web server.
807 while read daemon file; do
808 [ -z "$1" ] || continue
809 if [ -f "/var/run/$file" ]; then
810 /etc/init.d/$daemon stop
811 sleep 2
812 fi
813 if [ -f /etc/init.d/$daemon ]; then
814 /etc/init.d/$daemon start
815 fi
816 done <<EOT
817 apache apache/httpd.pid
818 lighttpd lighttpd.pid
819 EOT
820 }
822 # Pre and post remove commands for Tazpkg.
823 pre_remove_php_mysql()
824 {
825 sed -i '/.*=mysql.so.*/d' /etc/php.ini
827 # Start Web server.
828 while read daemon file; do
829 [ -z "$1" ] || continue
830 if [ -f "/var/run/$file" ]; then
831 /etc/init.d/$daemon stop
832 sleep 2
833 fi
834 if [ -f /etc/init.d/$daemon ]; then
835 /etc/init.d/$daemon start
836 fi
837 done <<EOT
838 apache apache/httpd.pid
839 lighttpd lighttpd.pid
840 EOT
841 }
843 # Post and pre install commans to stop
844 # and restart Web server if needed.
845 pre_install_php_odbc()
846 {
847 while read daemon file; do
848 if [ -z "$1" -a -f "/var/run/$file" ]; then
849 /etc/init.d/$daemon stop
850 fi
851 done <<EOT
852 apache apache/httpd.pid
853 lighttpd lighttpd.pid
854 EOT
855 }
857 post_install_php_odbc()
858 {
859 grep -q ^extension=odbc.so "$1/etc/php.ini" || \
860 sed -e 's|extension=msql.so|extension=msql.so\nextension=odbc.so|' -i "$1/etc/php.ini"
861 # Start Web server.
862 while read daemon file; do
863 [ -z "$1" ] || continue
864 if [ -f "/var/run/$file" ]; then
865 /etc/init.d/$daemon stop
866 sleep 2
867 fi
868 if [ -f /etc/init.d/$daemon ]; then
869 /etc/init.d/$daemon start
870 fi
871 done <<EOT
872 apache apache/httpd.pid
873 lighttpd lighttpd.pid
874 EOT
875 }
877 # Pre and post remove commands for Tazpkg.
878 pre_remove_php_odbc()
879 {
880 sed -i '/.*=odbc.so.*/d' /etc/php.ini
882 # Start Web server.
883 while read daemon file; do
884 [ -z "$1" ] || continue
885 if [ -f "/var/run/$file" ]; then
886 /etc/init.d/$daemon stop
887 sleep 2
888 fi
889 if [ -f /etc/init.d/$daemon ]; then
890 /etc/init.d/$daemon start
891 fi
892 done <<EOT
893 apache apache/httpd.pid
894 lighttpd lighttpd.pid
895 EOT
896 }
898 # Post and pre install commans to stop
899 # and restart Web server if needed.
900 pre_install_php_openssl()
901 {
902 while read daemon file; do
903 if [ -z "$1" -a -f "/var/run/$file" ]; then
904 /etc/init.d/$daemon stop
905 fi
906 done <<EOT
907 apache apache/httpd.pid
908 lighttpd lighttpd.pid
909 EOT
910 }
912 post_install_php_openssl()
913 {
914 grep -q ^extension=openssl.so "$1/etc/php.ini" || \
915 sed -e 's|extension=msql.so|extension=msql.so\nextension=openssl.so|' -i "$1/etc/php.ini"
916 # Start Web server.
917 while read daemon file; do
918 [ -z "$1" ] || continue
919 if [ -f "/var/run/$file" ]; then
920 /etc/init.d/$daemon stop
921 sleep 2
922 fi
923 if [ -f /etc/init.d/$daemon ]; then
924 /etc/init.d/$daemon start
925 fi
926 done <<EOT
927 apache apache/httpd.pid
928 lighttpd lighttpd.pid
929 EOT
930 }
932 # Pre and post remove commands for Tazpkg.
933 pre_remove_php_openssl()
934 {
935 sed -i '/.*=openssl.so.*/d' /etc/php.ini
937 # Start Web server.
938 while read daemon file; do
939 [ -z "$1" ] || continue
940 if [ -f "/var/run/$file" ]; then
941 /etc/init.d/$daemon stop
942 sleep 2
943 fi
944 if [ -f /etc/init.d/$daemon ]; then
945 /etc/init.d/$daemon start
946 fi
947 done <<EOT
948 apache apache/httpd.pid
949 lighttpd lighttpd.pid
950 EOT
951 }
953 # Post and pre install commans to stop
954 # and restart Web server if needed.
955 pre_install_pdo_mysql()
956 {
957 while read daemon file; do
958 if [ -z "$1" -a -f "/var/run/$file" ]; then
959 /etc/init.d/$daemon stop
960 fi
961 done <<EOT
962 apache apache/httpd.pid
963 lighttpd lighttpd.pid
964 EOT
965 }
967 post_install_pdo_mysql()
968 {
969 grep -q ^extension=pdo_mysql.so "$1/etc/php.ini" || \
970 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_mysql.so|' -i "$1/etc/php.ini"
971 # Start Web server.
972 while read daemon file; do
973 [ -z "$1" ] || continue
974 if [ -z "$1" -a -f "/var/run/$file" ]; then
975 /etc/init.d/$daemon stop
976 sleep 2
977 fi
978 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
979 /etc/init.d/$daemon start
980 fi
981 done <<EOT
982 apache apache/httpd.pid
983 lighttpd lighttpd.pid
984 EOT
985 }
987 # Pre and post remove commands for Tazpkg.
988 pre_remove_pdo_mysql()
989 {
990 sed -i '/.*=pdo_mysql.so.*/d' /etc/php.ini
992 # Start Web server.
993 while read daemon file; do
994 [ -z "$1" ] || continue
995 if [ -z "$1" -a -f "/var/run/$file" ]; then
996 /etc/init.d/$daemon stop
997 sleep 2
998 fi
999 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
1000 /etc/init.d/$daemon start
1001 fi
1002 done <<EOT
1003 apache apache/httpd.pid
1004 lighttpd lighttpd.pid
1005 EOT
1008 # Post and pre install commans to stop
1009 # and restart Web server if needed.
1010 pre_install_pdo_pgsql()
1012 while read daemon file; do
1013 if [ -z "$1" -a -f "/var/run/$file" ]; then
1014 /etc/init.d/$daemon stop
1015 fi
1016 done <<EOT
1017 apache apache/httpd.pid
1018 lighttpd lighttpd.pid
1019 EOT
1022 post_install_pdo_pgsql()
1024 grep -q ^extension=pdo_pgsql.so "$1/etc/php.ini" || \
1025 sed -e 's|extension=msql.so|extension=msql.so\nextension=pdo_pgsql.so|' -i "$1/etc/php.ini"
1026 # Start Web server.
1027 while read daemon file; do
1028 [ -z "$1" ] || continue
1029 if [ -z "$1" -a -f "/var/run/$file" ]; then
1030 /etc/init.d/$daemon stop
1031 sleep 2
1032 fi
1033 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
1034 /etc/init.d/$daemon start
1035 fi
1036 done <<EOT
1037 apache apache/httpd.pid
1038 lighttpd lighttpd.pid
1039 EOT
1042 # Pre and post remove commands for Tazpkg.
1043 pre_remove_pdo_pgsql()
1045 sed -i '/.*=pdo_pgsql.so.*/d' /etc/php.ini
1047 # Start Web server.
1048 while read daemon file; do
1049 [ -z "$1" ] || continue
1050 if [ -z "$1" -a -f "/var/run/$file" ]; then
1051 /etc/init.d/$daemon stop
1052 sleep 2
1053 fi
1054 if [ -z "$1" -a -f /etc/init.d/$daemon ]; then
1055 /etc/init.d/$daemon start
1056 fi
1057 done <<EOT
1058 apache apache/httpd.pid
1059 lighttpd lighttpd.pid
1060 EOT
1063 # Pre and post install commands for Tazpkg.
1064 pre_install_php_pear()
1066 while read daemon file; do
1067 if [ -z "$1" -a -f "/var/run/$file" ]; then
1068 /etc/init.d/$daemon stop
1069 fi
1070 done <<EOT
1071 apache apache/httpd.pid
1072 lighttpd lighttpd.pid
1073 EOT
1076 post_install_php_pear()
1078 grep ^include_path "$1/etc/php.ini"
1079 sed -i 's|/php/includes"|/php/includes"\ninclude_path = ".:/usr/share/php"|' "$1/etc/php.ini"
1080 # Restart Web server.
1081 while read daemon file; do
1082 [ -z "$1" ] || continue
1083 if [ -f "/var/run/$file" ]; then
1084 /etc/init.d/$daemon stop
1085 sleep 2
1086 fi
1087 if [ -f /etc/init.d/$daemon ]; then
1088 /etc/init.d/$daemon start
1089 fi
1090 done <<EOT
1091 apache apache/httpd.pid
1092 lighttpd lighttpd.pid
1093 EOT
1096 # Post and pre install commans to stop
1097 # and restart Web server if needed.
1098 pre_install_php_pgsql()
1100 while read daemon file; do
1101 if [ -z "$1" -a -f "/var/run/$file" ]; then
1102 /etc/init.d/$daemon stop
1103 fi
1104 done <<EOT
1105 apache apache/httpd.pid
1106 lighttpd lighttpd.pid
1107 EOT
1110 post_install_php_pgsql()
1112 grep -q ^extension=pgsql.so "$1/etc/php.ini" || \
1113 sed -e 's|extension=msql.so|extension=msql.so\nextension=pgsql.so|' -i "$1/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
1130 # Pre and post remove commands for Tazpkg.
1131 pre_remove_php_pgsql()
1133 sed -i '/.*=pgsql.so.*/d' /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
1151 # Post and pre install commans to stop
1152 # and restart Web server if needed.
1153 pre_install_php_snmp()
1155 while read daemon file; do
1156 if [ -z "$1" -a -f "/var/run/$file" ]; then
1157 /etc/init.d/$daemon stop
1158 fi
1159 done <<EOT
1160 apache apache/httpd.pid
1161 lighttpd lighttpd.pid
1162 EOT
1165 post_install_php_snmp()
1167 grep -q ^extension=snmp.so "$1/etc/php.ini" || \
1168 sed -e 's|extension=msql.so|extension=msql.so\nextension=snmp.so|' -i "$1/etc/php.ini"
1169 # Start Web server.
1170 while read daemon file; do
1171 [ -z "$1" ] || continue
1172 if [ -f "/var/run/$file" ]; then
1173 /etc/init.d/$daemon stop
1174 sleep 2
1175 fi
1176 if [ -f /etc/init.d/$daemon ]; then
1177 /etc/init.d/$daemon start
1178 fi
1179 done <<EOT
1180 apache apache/httpd.pid
1181 lighttpd lighttpd.pid
1182 EOT
1185 # Pre and post remove commands for Tazpkg.
1186 pre_remove_php_snmp()
1188 sed -i '/.*=snmp.so.*/d' /etc/php.ini
1190 # Start Web server.
1191 while read daemon file; do
1192 [ -z "$1" ] || continue
1193 if [ -f "/var/run/$file" ]; then
1194 /etc/init.d/$daemon stop
1195 sleep 2
1196 fi
1197 if [ -f /etc/init.d/$daemon ]; then
1198 /etc/init.d/$daemon start
1199 fi
1200 done <<EOT
1201 apache apache/httpd.pid
1202 lighttpd lighttpd.pid
1203 EOT
1206 # Post and pre install commans to stop
1207 # and restart Web server if needed.
1208 pre_install_php_soap()
1210 while read daemon file; do
1211 if [ -z "$1" -a -f "/var/run/$file" ]; then
1212 /etc/init.d/$daemon stop
1213 fi
1214 done <<EOT
1215 apache apache/httpd.pid
1216 lighttpd lighttpd.pid
1217 EOT
1220 post_install_php_soap()
1222 grep -q ^extension=soap.so "$1/etc/php.ini" || \
1223 sed -e 's|extension=msql.so|extension=msql.so\nextension=soap.so|' -i "$1/etc/php.ini"
1224 # Start Web server.
1225 while read daemon file; do
1226 [ -z "$1" ] || continue
1227 if [ -f "/var/run/$file" ]; then
1228 /etc/init.d/$daemon stop
1229 sleep 2
1230 fi
1231 if [ -f /etc/init.d/$daemon ]; then
1232 /etc/init.d/$daemon start
1233 fi
1234 done <<EOT
1235 apache apache/httpd.pid
1236 lighttpd lighttpd.pid
1237 EOT
1240 # Pre and post remove commands for Tazpkg.
1241 pre_remove_php_soap()
1243 sed -i '/.*=soap.so.*/d' /etc/php.ini
1245 # Start Web server.
1246 while read daemon file; do
1247 [ -z "$1" ] || continue
1248 if [ -f "/var/run/$file" ]; then
1249 /etc/init.d/$daemon stop
1250 sleep 2
1251 fi
1252 if [ -f /etc/init.d/$daemon ]; then
1253 /etc/init.d/$daemon start
1254 fi
1255 done <<EOT
1256 apache apache/httpd.pid
1257 lighttpd lighttpd.pid
1258 EOT
1261 post_install_php_sqlite()
1263 grep -q ^extension=sqlite3.so "$1/etc/php.ini" || \
1264 sed -e 's|extension=msql.so|extension=msql.so\nextension=sqlite3.so|' -i "$1/etc/php.ini"
1265 # Start Web server.
1266 while read daemon file; do
1267 [ -z "$1" ] || continue
1268 if [ -f "/var/run/$file" ]; then
1269 /etc/init.d/$daemon stop
1270 sleep 2
1271 fi
1272 if [ -f /etc/init.d/$daemon ]; then
1273 /etc/init.d/$daemon start
1274 fi
1275 done <<EOT
1276 apache apache/httpd.pid
1277 lighttpd lighttpd.pid
1278 EOT
1281 # Pre and post remove commands for Tazpkg.
1282 pre_remove_php_sqlite()
1284 sed -i '/.*=sqlite3.so.*/d' /etc/php.ini
1286 # Start Web server.
1287 while read daemon file; do
1288 [ -z "$1" ] || continue
1289 if [ -f "/var/run/$file" ]; then
1290 /etc/init.d/$daemon stop
1291 sleep 2
1292 fi
1293 if [ -f /etc/init.d/$daemon ]; then
1294 /etc/init.d/$daemon start
1295 fi
1296 done <<EOT
1297 apache apache/httpd.pid
1298 lighttpd lighttpd.pid
1299 EOT