wok view php/receipt @ rev 5781

Speedup some builds
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 10 09:37:09 2010 +0200 (2010-07-10)
parents 63221aff137b
children 11b005eb0d03
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.11"
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 libmcrypt-dev curl-dev cyrus-sasl-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-mcrypt=shared,/usr \
40 --with-mysql=shared,/usr \
41 --with-pgsql=shared,/usr \
42 --with-snmp=shared,/usr \
43 --with-ldap=shared \
44 --with-imap=shared --with-imap-ssl \
45 --with-mhash=shared \
46 --with-gd=shared \
47 --with-jpeg-dir=/usr \
48 --with-png-dir=/usr \
49 --with-openssl=shared \
50 --with-unixODBC=shared,/usr \
51 --with-pear=/usr/share/php \
52 --with-pdo-mysql=shared \
53 --with-pdo-pgsql=shared \
54 --with-curl=shared \
55 "
56 sed -i 's/pam_start/pam_nostart/' configure
57 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
58 make -j 4 && make INSTALL_ROOT=$PWD/_pkg install
59 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
60 make -j 4 && {
61 mkdir -p _pkg/etc/apache
62 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
63 make INSTALL_ROOT=$PWD/_pkg install
64 }
65 # Recommended config file and phpinfo.
66 cp php.ini-recommended _pkg/etc/php.ini
67 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
68 -i _pkg/etc/php.ini
69 cp -a ../stuff/phpinfo _pkg/usr/share
70 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
71 cp ../stuff/php.desktop _pkg/usr/share/applications
72 cp ../stuff/php.png _pkg/usr/share/pixmaps
73 }
75 # Rules to gen a SliTaz package suitable for Tazpkg.
76 genpkg_rules()
77 {
78 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
79 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
80 for i in $(cd $WOK; ls -d php-*)
81 do
82 tazwok cook $i
83 done
84 }
86 # Post and pre install commands to stop
87 # and restart Web server if needed.
88 pre_install()
89 {
90 if [ -f "$1/var/run/lighttpd.pid" ]; then
91 /etc/init.d/lighttpd stop
92 fi
93 }
94 post_install()
95 {
96 # Enable php
97 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
98 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
99 tazpkg get-install lighttpd-modules --root=$1/
100 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
101 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
102 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
103 -i $1/etc/lighttpd/lighttpd.conf
104 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
105 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
106 -i $1/etc/lighttpd/lighttpd.conf
107 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
108 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
109 -i $1/etc/lighttpd/lighttpd.conf
110 fi
111 # Start Web server.
112 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
113 /etc/init.d/lighttpd start
114 fi
115 }