wok-next view php/receipt @ rev 5304
Up: All Xorg driver (7.5 and up)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon Apr 19 22:14:19 2010 +0200 (2010-04-19) |
parents | 5043ba1d9bd1 |
children | 63221aff137b |
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"
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 "
55 sed -i 's/pam_start/pam_nostart/' configure
56 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
57 make && make INSTALL_ROOT=$PWD/_pkg install
58 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
59 make && {
60 mkdir -p _pkg/etc/apache
61 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
62 make INSTALL_ROOT=$PWD/_pkg install
63 }
64 # Recommended config file and phpinfo.
65 cp php.ini-recommended _pkg/etc/php.ini
66 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
67 -i _pkg/etc/php.ini
68 cp -a ../stuff/phpinfo _pkg/usr/share
69 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
70 cp ../stuff/php.desktop _pkg/usr/share/applications
71 cp ../stuff/php.png _pkg/usr/share/pixmaps
72 }
74 # Rules to gen a SliTaz package suitable for Tazpkg.
75 genpkg_rules()
76 {
77 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
78 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
79 for i in $(cd $WOK; ls -d php-*)
80 do
81 tazwok cook $i
82 done
83 }
85 # Post and pre install commands to stop
86 # and restart Web server if needed.
87 pre_install()
88 {
89 if [ -f "$1/var/run/lighttpd.pid" ]; then
90 /etc/init.d/lighttpd stop
91 fi
92 }
93 post_install()
94 {
95 # Enable php
96 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
97 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
98 tazpkg get-install lighttpd-modules --root=$1/
99 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
100 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
101 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
102 -i $1/etc/lighttpd/lighttpd.conf
103 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
104 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
105 -i $1/etc/lighttpd/lighttpd.conf
106 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
107 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
108 -i $1/etc/lighttpd/lighttpd.conf
109 fi
110 # Start Web server.
111 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
112 /etc/init.d/lighttpd start
113 fi
114 }