wok view php/receipt @ rev 8915

gtk+: add bash in BUILD_DEPENDS
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 28 17:24:10 2011 +0100 (2011-02-28)
parents 9ef4bd480280
children d1768332cee0
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.17"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib zlib-dev libmysqlclient \
10 mysql-dev net-snmp-dev postgresql postgresql-dev gettext openssl-dev \
11 apache-dev apache apr-util-dev c-client mhash mhash-dev libpng libpng-dev \
12 libunixODBC unixODBC-dev openldap-dev libldap apr-dev libmcrypt-dev curl \
13 curl-dev cyrus-sasl-dev perl pkg-config jpeg-dev jpeg openldap"
14 TARBALL="$PACKAGE-$VERSION.tar.bz2"
15 WEB_SITE="http://www.php.net/"
16 WGET_URL="http://us2.php.net/distributions/$TARBALL"
17 PROVIDE="php:lighttpd"
19 # Rules to configure and make the package.
20 compile_rules()
21 {
22 cd $src
23 COMMON_ARGS="\
24 --prefix=/usr \
25 --sysconfdir=/etc \
26 --infodir=/usr/share/info \
27 --mandir=/usr/share/man \
28 --enable-fastcgi \
29 --enable-discard-path \
30 --enable-force-cgi-redirect \
31 --enable-mbstring \
32 --enable-sockets \
33 --enable-ftp \
34 --enable-zip \
35 --enable-calendar \
36 --enable-exif \
37 --enable-dba=shared \
38 --enable-dbase=shared \
39 --with-config-file-path=/etc \
40 --with-zlib \
41 --with-gettext \
42 --with-mcrypt=shared,/usr \
43 --with-mysql=shared,/usr \
44 --with-pgsql=shared,/usr \
45 --with-snmp=shared,/usr \
46 --enable-soap=shared,/usr \
47 --with-ldap=shared \
48 --with-imap=shared --with-imap-ssl \
49 --with-mhash=shared \
50 --with-gd=shared \
51 --with-jpeg-dir=/usr \
52 --with-png-dir=/usr \
53 --with-openssl=shared \
54 --with-unixODBC=shared,/usr \
55 --with-pear=/usr/share/php \
56 --with-pdo-mysql=shared \
57 --with-pdo-pgsql=shared \
58 --with-curl=shared \
59 "
60 sed -i 's/pam_start/pam_nostart/' configure
61 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
62 make -j 4 && make INSTALL_ROOT=$PWD/_pkg install
63 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
64 make -j 4 && {
65 mkdir -p _pkg/etc/apache
66 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
67 make INSTALL_ROOT=$PWD/_pkg install
68 }
69 # Recommended config file and phpinfo.
70 cp php.ini-recommended _pkg/etc/php.ini
71 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
72 -i _pkg/etc/php.ini
73 cp -a ../stuff/phpinfo _pkg/usr/share
74 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
75 cp ../stuff/php.desktop _pkg/usr/share/applications
76 cp ../stuff/php.png _pkg/usr/share/pixmaps
77 }
79 # Rules to gen a SliTaz package suitable for Tazpkg.
80 genpkg_rules()
81 {
82 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
83 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
84 }
86 # Post and pre install commands to stop
87 # 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 }
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 }