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