wok-next view php/receipt @ rev 20453

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