wok view php/receipt @ rev 7809

Up slitaz-tools (3.9.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Dec 24 19:01:39 2010 +0100 (2010-12-24)
parents 48880e2d195b
children a82ead0ea109
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.16"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib zlib-dev libmysqlclient 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 libunixODBC unixODBC-dev openldap-dev libldap apr-dev libmcrypt-dev curl curl-dev cyrus-sasl-dev perl pkg-config jpeg-dev jpeg"
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 --enable-dbase=shared \
37 --with-config-file-path=/etc \
38 --with-zlib \
39 --with-gettext \
40 --with-mcrypt=shared,/usr \
41 --with-mysql=shared,/usr \
42 --with-pgsql=shared,/usr \
43 --with-snmp=shared,/usr \
44 --enable-soap=shared,/usr \
45 --with-ldap=shared \
46 --with-imap=shared --with-imap-ssl \
47 --with-mhash=shared \
48 --with-gd=shared \
49 --with-jpeg-dir=/usr \
50 --with-png-dir=/usr \
51 --with-openssl=shared \
52 --with-unixODBC=shared,/usr \
53 --with-pear=/usr/share/php \
54 --with-pdo-mysql=shared \
55 --with-pdo-pgsql=shared \
56 --with-curl=shared \
57 "
58 sed -i 's/pam_start/pam_nostart/' configure
59 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
60 make -j 4 && make INSTALL_ROOT=$PWD/_pkg install
61 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
62 make -j 4 && {
63 mkdir -p _pkg/etc/apache
64 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
65 make INSTALL_ROOT=$PWD/_pkg install
66 }
67 # Recommended config file and phpinfo.
68 cp php.ini-recommended _pkg/etc/php.ini
69 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
70 -i _pkg/etc/php.ini
71 cp -a ../stuff/phpinfo _pkg/usr/share
72 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
73 cp ../stuff/php.desktop _pkg/usr/share/applications
74 cp ../stuff/php.png _pkg/usr/share/pixmaps
75 }
77 # Rules to gen a SliTaz package suitable for Tazpkg.
78 genpkg_rules()
79 {
80 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
81 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
82 for i in $(cd $WOK; ls -d php-*)
83 do
84 tazwok cook $i
85 done
86 }
88 # Post and pre install commands to stop
89 # and restart Web server if needed.
90 pre_install()
91 {
92 if [ -f "$1/var/run/lighttpd.pid" ]; then
93 /etc/init.d/lighttpd stop
94 fi
95 }
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 }