wok view php/receipt @ rev 2861
libQt* gst-plugin* gtkpod: update depends
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat May 02 10:05:32 2009 +0200 (2009-05-02) |
parents | 67aee837278b |
children | e5347dcfd3a5 |
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.9"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="php-common lighttpd zlib libxml2 sqlite"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev \
10 postgresql postgresql-dev gettext openssl-dev apache-dev apache apr-util-dev \
11 c-client mhash mhash-dev libpng libpng-dev unixODBC-dev openldap-dev libldap apr-dev"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.php.net/"
14 WGET_URL="http://us2.php.net/distributions/$TARBALL"
15 PROVIDE="php:lighttpd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 COMMON_ARGS="\
22 --prefix=/usr \
23 --sysconfdir=/etc \
24 --infodir=/usr/share/info \
25 --mandir=/usr/share/man \
26 --enable-fastcgi \
27 --enable-discard-path \
28 --enable-force-cgi-redirect \
29 --enable-mbstring \
30 --with-config-file-path=/etc \
31 --with-zlib \
32 --with-gettext \
33 --with-mysql=shared,/usr \
34 --with-pgsql=shared,/usr \
35 --with-ldap=shared \
36 --with-imap=shared --with-imap-ssl \
37 --with-mhash=shared \
38 --with-gd=shared \
39 --with-openssl=shared \
40 --with-unixODBC=shared,/usr \
41 --with-pear=/usr/share/php \
42 "
43 sed -i 's/pam_start/pam_nostart/' configure
44 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
45 make && make INSTALL_ROOT=$PWD/_pkg install
46 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
47 make && {
48 mkdir -p _pkg/etc/apache
49 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
50 make INSTALL_ROOT=$PWD/_pkg install
51 }
52 # Recommended config file and phpinfo.
53 cp php.ini-recommended _pkg/etc/php.ini
54 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
55 -i _pkg/etc/php.ini
56 cp -a ../stuff/phpinfo _pkg/usr/share
57 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
58 cp ../stuff/php.desktop _pkg/usr/share/applications
59 cp ../stuff/php.png _pkg/usr/share/pixmaps
60 }
62 # Rules to gen a SliTaz package suitable for Tazpkg.
63 genpkg_rules()
64 {
65 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
66 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
67 for i in $(cd $WOK; ls -d php-*)
68 do
69 tazwok cook $i
70 done
71 }
73 # Post and pre install commands to stop
74 # and restart Web server if needed.
75 pre_install()
76 {
77 if [ -f "$1/var/run/lighttpd.pid" ]; then
78 /etc/init.d/lighttpd stop
79 fi
80 }
81 post_install()
82 {
83 # Enable php
84 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
85 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
86 tazpkg get-install lighttpd-modules --root=$1/
87 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
88 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
89 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
90 -i $1/etc/lighttpd/lighttpd.conf
91 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
92 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
93 -i $1/etc/lighttpd/lighttpd.conf
94 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
95 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
96 -i $1/etc/lighttpd/lighttpd.conf
97 fi
98 # Start Web server.
99 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
100 /etc/init.d/lighttpd start
101 fi
102 }