wok-6.x view php/receipt @ rev 1235

Add egenix-mx-base
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 11 11:01:15 2008 +0000 (2008-08-11)
parents e679fb64c9d0
children 41897da4a1db
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 gettext openssl-dev"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.php.net/"
12 WGET_URL="http://us2.php.net/distributions/$TARBALL"
13 CONFIG_FILES="/etc/php.ini"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 ./configure \
20 --prefix=/usr \
21 --sysconfdir=/etc \
22 --infodir=/usr/share/info \
23 --mandir=/usr/share/man \
24 --enable-fastcgi \
25 --enable-discard-path \
26 --enable-force-cgi-redirect \
27 --enable-mbstring \
28 --with-config-file-path=/etc \
29 --with-zlib \
30 --with-gettext \
31 --with-mysql=shared,usr \
32 --with-pgsql=shared,usr \
33 --with-ldap=shared \
34 --disable-cli \
35 $CONFIGURE_ARGS
36 make
37 make INSTALL_ROOT=$PWD/_pkg install
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
44 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
45 # Recommended config file and phpinfo.
46 cp $src/php.ini-recommended $fs/etc/php.ini
47 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
48 -i $fs/etc/php.ini
49 cp -a stuff/phpinfo $fs/usr/share
50 for i in $(cd $WOK; ls -d php-*)
51 do
52 tazwok cook $i
53 done
54 }
56 # Post and pre install commans to stop
57 # and restart Web server if needed.
58 pre_install()
59 {
60 if [ -f "$1/var/run/lighttpd.pid" ]; then
61 /etc/init.d/lighttpd stop
62 fi
63 # Backup existing php.ini
64 if [ -f "$1/etc/php.ini" ]; then
65 echo -n "Creating php.ini backup..."
66 cp $1/etc/php.ini $1/etc/php.ini.bak
67 status
68 fi
69 }
70 post_install()
71 {
72 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
73 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
74 etc/php.ini
75 EOT
76 # Restore original php.ini
77 if [ -f "$1/etc/php.ini.bak" ]; then
78 echo -n "Restoring php.ini backup..."
79 mv -f $1/etc/php.ini.bak $1/etc/php.ini
80 status
81 fi
82 # Enable php
83 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
84 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
85 tazpkg get-install lighttpd-modules --root=$1/
86 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
87 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
88 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
89 -i $1/etc/lighttpd/lighttpd.conf
90 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
91 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
92 -i $1/etc/lighttpd/lighttpd.conf
93 fi
94 # Start Web server.
95 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
96 /etc/init.d/lighttpd start
97 fi
98 }
100 repack_cleanup()
101 {
102 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
103 }