wok-6.x view php/receipt @ rev 1149
Add postgresql
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jul 26 14:23:50 2008 +0000 (2008-07-26) |
parents | a6ba323029ac |
children | c13c815a576c |
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 mysql-dev postgresql postgresql-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 --with-mysql=shared,usr \
30 --with-pgsql=shared,usr \
31 --disable-cli \
32 $CONFIGURE_ARGS
33 make
34 make INSTALL_ROOT=$PWD/_pkg install
35 }
37 # Rules to gen a SliTaz package suitable for Tazpkg.
38 genpkg_rules()
39 {
40 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
41 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
42 # Recommended config file and phpinfo.
43 cp $src/php.ini-recommended $fs/etc/php.ini
44 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
45 -i $fs/etc/php.ini
46 cp -a stuff/phpinfo $fs/usr/share
47 for i in $(cd $WOK; ls -d php-*)
48 do
49 tazwok cook $i
50 done
51 }
53 # Post and pre install commans to stop
54 # and restart Web server if needed.
55 pre_install()
56 {
57 if [ -f "$1/var/run/lighttpd.pid" ]; then
58 /etc/init.d/lighttpd stop
59 fi
60 # Backup existing php.ini
61 if [ -f "$1/etc/php.ini" ]; then
62 echo -n "Creating php.ini backup..."
63 cp $1/etc/php.ini $1/etc/php.ini.bak
64 status
65 fi
66 }
67 post_install()
68 {
69 # Restore original php.ini
70 if [ -f "$1/etc/php.ini.bak" ]; then
71 echo -n "Restoring php.ini backup..."
72 mv -f $1/etc/php.ini.bak $1/etc/php.ini
73 status
74 fi
75 # Enable php
76 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
77 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
78 tazpkg get-install lighttpd-modules --root=$1/
79 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
80 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
81 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
82 -i $1/etc/lighttpd/lighttpd.conf
83 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
84 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
85 -i $1/etc/lighttpd/lighttpd.conf
86 fi
87 # Start Web server.
88 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
89 /etc/init.d/lighttpd start
90 fi
91 }