wok-next view php/receipt @ rev 15288
pkg-config: remove a wrong error trigger
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Sep 26 17:57:02 2013 +0000 (2013-09-26) |
parents | 7b91061e7189 |
children | bd6312b5bcda |
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 "
66 sed -i 's/pam_start/pam_nostart/' configure
67 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
68 make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
69 ./configure $COMMON_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
70 make $MAKEFLAGS && {
71 mkdir -p $DESTDIR/etc/apache
72 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
73 make -j1 INSTALL_ROOT=$DESTDIR install
74 }
75 # Production config file.
76 mkdir -p $DESTDIR/etc
77 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
78 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
79 -i $DESTDIR/etc/php.ini
80 }
82 # Rules to gen a SliTaz package suitable for Tazpkg.
83 genpkg_rules()
84 {
85 mkdir -p $fs/usr/bin $fs/usr/share/php
86 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
87 }
89 # Post and pre install commands to stop
90 # and restart Web server if needed.
91 pre_install()
92 {
93 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
94 /etc/init.d/lighttpd stop
95 fi
96 }
98 post_install()
99 {
100 # Enable php
101 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
102 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
103 tazpkg get-install lighttpd-modules --root=$1/
104 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
105 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
106 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
107 -i $1/etc/lighttpd/lighttpd.conf
108 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
109 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
110 -i $1/etc/lighttpd/lighttpd.conf
111 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
112 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
113 -i $1/etc/lighttpd/lighttpd.conf
114 fi
115 # Start Web server.
116 if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
117 -a -f /etc/init.d/lighttpd ]; then
118 /etc/init.d/lighttpd start
119 fi
120 }