wok view php/receipt @ rev 10694

Add qemu-light (stripped down, but works) - qemu* may move to undigest since I can't make it work properly
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 27 22:52:39 2011 +0200 (2011-05-27)
parents 95a06d7c9189
children 62786d242bc4
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.17"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.bz2"
9 WEB_SITE="http://www.php.net/"
10 WGET_URL="http://us2.php.net/distributions/$TARBALL"
11 PROVIDE="php:lighttpd"
13 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
14 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
15 net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
16 c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \
17 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl pkg-config \
18 jpeg-dev net-snmp-dev"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 cd $src
24 COMMON_ARGS="\
25 --prefix=/usr \
26 --sysconfdir=/etc \
27 --infodir=/usr/share/info \
28 --mandir=/usr/share/man \
29 --enable-fastcgi \
30 --enable-discard-path \
31 --enable-force-cgi-redirect \
32 --enable-mbstring \
33 --enable-sockets \
34 --enable-ftp \
35 --enable-zip \
36 --enable-calendar \
37 --enable-exif \
38 --enable-dba=shared \
39 --enable-dbase=shared \
40 --with-config-file-path=/etc \
41 --with-zlib \
42 --with-gettext \
43 --with-mcrypt=shared,/usr \
44 --with-mysql=shared,/usr \
45 --with-pgsql=shared,/usr \
46 --with-snmp=shared,/usr \
47 --enable-soap=shared,/usr \
48 --with-ldap=shared \
49 --with-imap=shared --with-imap-ssl \
50 --with-mhash=shared \
51 --with-gd=shared \
52 --with-jpeg-dir=/usr \
53 --with-png-dir=/usr \
54 --with-openssl=shared \
55 --with-unixODBC=shared,/usr \
56 --with-pear=/usr/share/php \
57 --with-pdo-mysql=shared \
58 --with-pdo-pgsql=shared \
59 --with-curl=shared \
60 "
61 sed -i 's/pam_start/pam_nostart/' configure
62 ./configure $COMMON_ARGS && \
63 make -j 4 && make INSTALL_ROOT=$DESTDIR install
64 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \
65 make -j 4 && {
66 mkdir -p $DESTDIR/etc/apache
67 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
68 make INSTALL_ROOT=$DESTDIR install
69 }
70 # Recommended config file and phpinfo.
71 cp $src/php.ini-recommended $DESTDIR/etc/php.ini
72 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
73 -i $DESTDIR/etc/php.ini
74 mkdir -p $DESTDIR/usr/share/applicattions $DESTDIR/usr/share/pixmaps
75 cp $stuff/php.desktop $DESTDIR/usr/share/applications
76 cp $stuff/php.png $DESTDIR/usr/share/pixmaps
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share/php
83 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
85 cp -a $stuff/phpinfo $install/usr/share
86 }
88 # Post and pre install commands to stop and restart Web server if needed.
89 pre_install()
90 {
91 if [ -f "$1/var/run/lighttpd.pid" ]; then
92 /etc/init.d/lighttpd stop
93 fi
94 }
96 post_install()
97 {
98 # Enable php
99 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
100 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
101 tazpkg get-install lighttpd-modules --root=$1/
102 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
103 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
104 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
105 -i $1/etc/lighttpd/lighttpd.conf
106 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
107 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
108 -i $1/etc/lighttpd/lighttpd.conf
109 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
110 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
111 -i $1/etc/lighttpd/lighttpd.conf
112 fi
113 # Start Web server.
114 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
115 /etc/init.d/lighttpd start
116 fi
117 }