wok-current view php/receipt @ rev 15492

Up: firefox-langpack-es_ES (17.0.10esr)
author Dominique Corbex <domcox@slitaz.org>
date Sun Nov 17 16:29:54 2013 +0100 (2013-11-17)
parents 78cb1e930abd
children 69ea1d847f2a
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.4.13"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.php.net/"
11 WGET_URL="http://www.php.net/distributions/$TARBALL"
12 PROVIDE="php:lighttpd"
14 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
15 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
16 net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
17 c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \
18 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl pkg-config \
19 jpeg-dev net-snmp-dev libvpx-dev apache 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-mbstring \
31 --enable-sockets \
32 --enable-ftp \
33 --enable-zip \
34 --enable-calendar \
35 --enable-exif \
36 --config-cache \
37 --enable-dba=shared \
38 --with-config-file-path=/etc \
39 --with-zlib \
40 --with-gettext \
41 --with-mcrypt=shared,/usr \
42 --with-mysql=shared,/usr \
43 --with-mysqli=shared \
44 --with-mysql-sock=/var/mysql/mysql.sock \
45 --with-pdo-sqlite=shared,/usr \
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-mhash \
52 --with-gd=shared \
53 --with-jpeg-dir=/usr \
54 --with-png-dir=/usr \
55 --with-vpx-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 --enable-sqlite-utf8 \
63 --with-sqlite3=shared,/usr \
64 --with-sqlite=shared \
65 --enable-maintainer-zts \
66 "
67 sed -i 's/pam_start/pam_nostart/' configure
68 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
69 make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
70 ./configure $COMMON_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
71 make $MAKEFLAGS && {
72 mkdir -p $DESTDIR/etc/apache
73 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
74 make -j1 INSTALL_ROOT=$DESTDIR install
75 }
76 # Production config file.
77 mkdir -p $DESTDIR/etc
78 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
79 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
80 -i $DESTDIR/etc/php.ini
81 }
83 # Rules to gen a SliTaz package suitable for Tazpkg.
84 genpkg_rules()
85 {
86 mkdir -p $fs/usr/bin $fs/usr/share/php
87 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
88 }
90 # Post and pre install commands to stop
91 # and restart Web server if needed.
92 pre_install()
93 {
94 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
95 /etc/init.d/lighttpd stop
96 fi
97 }
99 post_install()
100 {
101 # Enable php
102 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
103 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
104 tazpkg get-install lighttpd-modules --root=$1/
105 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
106 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
107 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
108 -i $1/etc/lighttpd/lighttpd.conf
109 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
110 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
111 -i $1/etc/lighttpd/lighttpd.conf
112 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
113 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
114 -i $1/etc/lighttpd/lighttpd.conf
115 fi
116 # Start Web server.
117 if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
118 -a -f /etc/init.d/lighttpd ]; then
119 /etc/init.d/lighttpd start
120 fi
121 }