wok-current view php/receipt @ rev 13052

Up: php (5.4.4)
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Jun 18 22:09:11 2012 +0200 (2012-06-18)
parents 5e702bac8175
children dbd759dcccf3
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.4.4"
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 apache freetype-dev libtool bison"
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-mysqli=shared \
46 --with-pgsql=shared,/usr \
47 --with-snmp=shared,/usr \
48 --enable-soap=shared,/usr \
49 --with-ldap=shared \
50 --with-imap=shared --with-imap-ssl \
51 --with-freetype-dir=/usr/include/freetype2 \
52 --with-mhash=shared \
53 --with-gd=shared \
54 --with-jpeg-dir=/usr \
55 --with-png-dir=/usr \
56 --with-openssl=shared \
57 --with-unixODBC=shared,/usr \
58 --with-pear=/usr/share/php \
59 --with-pdo-mysql=shared \
60 --with-pdo-pgsql=shared \
61 --with-curl=shared \
62 "
63 sed -i 's/pam_start/pam_nostart/' configure
64 ./configure $COMMON_ARGS && \
65 make $MAKEFLAGS && make INSTALL_ROOT=$DESTDIR install
66 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \
67 make $MAKEFLAGS && {
68 mkdir -p $DESTDIR/etc/apache
69 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
70 make INSTALL_ROOT=$DESTDIR install
71 }
72 # Production config file.
73 mkdir -p $DESTDIR/etc
74 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
75 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
76 -i $DESTDIR/etc/php.ini
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 mkdir -p $fs/usr/bin $fs/usr/share/php
83 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
84 }
86 # Post and pre install commands to stop 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 }
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 }