wok-6.x view php/receipt @ rev 13294
sslh: fix bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 27 17:15:42 2012 +0200 (2012-08-27) |
parents | 538b411fe284 |
children | f9732678756f |
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-pgsql=shared,/usr \
48 --with-snmp=shared,/usr \
49 --enable-soap=shared,/usr \
50 --with-ldap=shared \
51 --with-imap=shared --with-imap-ssl \
52 --with-freetype-dir=/usr/include/freetype2 \
53 --with-mhash=shared \
54 --with-gd=shared \
55 --with-jpeg-dir=/usr \
56 --with-png-dir=/usr \
57 --with-openssl=shared \
58 --with-unixODBC=shared,/usr \
59 --with-pear=/usr/share/php \
60 --with-pdo-mysql=shared \
61 --with-pdo-pgsql=shared \
62 --with-curl=shared \
63 "
64 sed -i 's/pam_start/pam_nostart/' configure
65 ./configure $COMMON_ARGS && \
66 make $MAKEFLAGS && make INSTALL_ROOT=$DESTDIR install
67 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \
68 make $MAKEFLAGS && {
69 mkdir -p $DESTDIR/etc/apache
70 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
71 make INSTALL_ROOT=$DESTDIR install
72 }
73 # Production config file.
74 mkdir -p $DESTDIR/etc
75 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
76 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
77 -i $DESTDIR/etc/php.ini
78 }
80 # Rules to gen a SliTaz package suitable for Tazpkg.
81 genpkg_rules()
82 {
83 mkdir -p $fs/usr/bin $fs/usr/share/php
84 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
85 }
87 # Post and pre install commands to stop 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 }
95 post_install()
96 {
97 # Enable php
98 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
99 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
100 tazpkg get-install lighttpd-modules --root=$1/
101 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
102 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
103 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
104 -i $1/etc/lighttpd/lighttpd.conf
105 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
106 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
107 -i $1/etc/lighttpd/lighttpd.conf
108 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
109 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
110 -i $1/etc/lighttpd/lighttpd.conf
111 fi
112 # Start Web server.
113 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
114 /etc/init.d/lighttpd start
115 fi
116 }