wok-current view php/receipt @ rev 13561

Up: spacefm (0.8.2)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Nov 03 10:51:53 2012 +0100 (2012-11-03)
parents dbd759dcccf3
children ea4381b83496
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 \
19 re2c coreutils-conditions"
21 # Rules to configure and make the package.
22 compile_rules()
23 {
24 cd $src
25 COMMON_ARGS="\
26 --prefix=/usr \
27 --sysconfdir=/etc \
28 --infodir=/usr/share/info \
29 --mandir=/usr/share/man \
30 --enable-fastcgi \
31 --enable-discard-path \
32 --enable-force-cgi-redirect \
33 --enable-mbstring \
34 --enable-sockets \
35 --enable-ftp \
36 --enable-zip \
37 --enable-calendar \
38 --enable-exif \
39 --enable-dba=shared \
40 --enable-dbase=shared \
41 --with-config-file-path=/etc \
42 --with-zlib \
43 --with-gettext \
44 --with-mcrypt=shared,/usr \
45 --with-mysql=shared,/usr \
46 --with-mysqli=shared \
47 --with-mysql-sock=/var/mysql/mysql.sock \
48 --with-pgsql=shared,/usr \
49 --with-snmp=shared,/usr \
50 --enable-soap=shared,/usr \
51 --with-ldap=shared \
52 --with-imap=shared --with-imap-ssl \
53 --with-freetype-dir=/usr/include/freetype2 \
54 --with-mhash=shared \
55 --with-gd=shared \
56 --with-jpeg-dir=/usr \
57 --with-png-dir=/usr \
58 --with-openssl=shared \
59 --with-unixODBC=shared,/usr \
60 --with-pear=/usr/share/php \
61 --with-pdo-mysql=shared \
62 --with-pdo-pgsql=shared \
63 --with-curl=shared \
64 "
65 sed -i 's/pam_start/pam_nostart/' configure
66 ./configure $COMMON_ARGS && \
67 make $MAKEFLAGS && make INSTALL_ROOT=$DESTDIR install
68 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \
69 make $MAKEFLAGS && {
70 mkdir -p $DESTDIR/etc/apache
71 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
72 make INSTALL_ROOT=$DESTDIR install
73 }
74 # Production config file.
75 mkdir -p $DESTDIR/etc
76 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
77 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
78 -i $DESTDIR/etc/php.ini
79 }
81 # Rules to gen a SliTaz package suitable for Tazpkg.
82 genpkg_rules()
83 {
84 mkdir -p $fs/usr/bin $fs/usr/share/php
85 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
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 }