wok-current view php/receipt @ rev 1137

Fix post_install for subdir install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 24 12:27:06 2008 +0000 (2008-07-24)
parents eb4e6a1af180
children a6ba323029ac
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.5"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="lighttpd zlib libxml2 sqlite"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.php.net/"
12 WGET_URL="http://us2.php.net/distributions/$TARBALL"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 cd $src
18 ./configure \
19 --prefix=/usr \
20 --sysconfdir=/etc \
21 --infodir=/usr/share/info \
22 --mandir=/usr/share/man \
23 --enable-fastcgi \
24 --enable-discard-path \
25 --enable-force-cgi-redirect \
26 --enable-mbstring \
27 --with-config-file-path=/etc \
28 --with-zlib \
29 --disable-cli \
30 $CONFIGURE_ARGS
31 make
32 }
34 # Rules to gen a SliTaz package suitable for Tazpkg.
35 genpkg_rules()
36 {
37 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
38 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
39 # Recommended config file and phpinfo.
40 cp $src/php.ini-recommended $fs/etc/php.ini
41 cp -a stuff/phpinfo $fs/usr/share
42 }
44 # Post and pre install commans to stop
45 # and restart Web server if needed.
46 pre_install()
47 {
48 local root
49 root=$1
50 if [ -f "$1/var/run/lighttpd.pid" ]; then
51 /etc/init.d/lighttpd stop
52 fi
53 # Backup existing php.ini
54 if [ -f "$1/etc/php.ini" ]; then
55 echo -n "Creating php.ini backup..."
56 cp $1/etc/php.ini $1/etc/php.ini.bak
57 status
58 fi
59 }
60 post_install()
61 {
62 # Restore original php.ini
63 if [ -f "$1/etc/php.ini.bak" ]; then
64 echo -n "Restoring php.ini backup..."
65 mv -f $1/etc/php.ini.bak $1/etc/php.ini
66 status
67 fi
68 # Start Web server.
69 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
70 /etc/init.d/lighttpd start
71 fi
72 }