wok-current view php/receipt @ rev 4345

syslinux: ifmem.c32 accepts unit K, M, G
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 02 11:37:50 2009 +0200 (2009-10-02)
parents 2927081919c9
children 5043ba1d9bd1
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 net-snmp-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 --enable-sockets \
31 --enable-ftp \
32 --enable-zip \
33 --enable-calendar \
34 --enable-exif \
35 --enable-dba=shared \
36 --with-config-file-path=/etc \
37 --with-zlib \
38 --with-gettext \
39 --with-mysql=shared,/usr \
40 --with-pgsql=shared,/usr \
41 --with-snmp=shared,/usr \
42 --with-ldap=shared \
43 --with-imap=shared --with-imap-ssl \
44 --with-mhash=shared \
45 --with-gd=shared \
46 --with-jpeg-dir=/usr \
47 --with-png-dir=/usr \
48 --with-openssl=shared \
49 --with-unixODBC=shared,/usr \
50 --with-pear=/usr/share/php \
51 "
52 sed -i 's/pam_start/pam_nostart/' configure
53 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
54 make && make INSTALL_ROOT=$PWD/_pkg install
55 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
56 make && {
57 mkdir -p _pkg/etc/apache
58 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
59 make INSTALL_ROOT=$PWD/_pkg install
60 }
61 # Recommended config file and phpinfo.
62 cp php.ini-recommended _pkg/etc/php.ini
63 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
64 -i _pkg/etc/php.ini
65 cp -a ../stuff/phpinfo _pkg/usr/share
66 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
67 cp ../stuff/php.desktop _pkg/usr/share/applications
68 cp ../stuff/php.png _pkg/usr/share/pixmaps
69 }
71 # Rules to gen a SliTaz package suitable for Tazpkg.
72 genpkg_rules()
73 {
74 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
75 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
76 for i in $(cd $WOK; ls -d php-*)
77 do
78 tazwok cook $i
79 done
80 }
82 # Post and pre install commands to stop
83 # and restart Web server if needed.
84 pre_install()
85 {
86 if [ -f "$1/var/run/lighttpd.pid" ]; then
87 /etc/init.d/lighttpd stop
88 fi
89 }
90 post_install()
91 {
92 # Enable php
93 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
94 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
95 tazpkg get-install lighttpd-modules --root=$1/
96 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
97 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
98 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
99 -i $1/etc/lighttpd/lighttpd.conf
100 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
101 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
102 -i $1/etc/lighttpd/lighttpd.conf
103 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
104 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
105 -i $1/etc/lighttpd/lighttpd.conf
106 fi
107 # Start Web server.
108 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
109 /etc/init.d/lighttpd start
110 fi
111 }