wok view php/receipt @ rev 7940

Up: slitaz-icon (1.1) - Sync theme with website/artwork
author Christophe Lincoln <pankso@slitaz.org>
date Wed Jan 12 00:21:05 2011 +0100 (2011-01-12)
parents a82ead0ea109
children 978398096ad8
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 mysql-dev net-snmp-dev \
10 postgresql postgresql-dev gettext openssl-dev apache-dev apache apr-util-dev \
11 c-client mhash mhash-dev libpng libpng-dev libunixODBC unixODBC-dev openldap-dev libldap apr-dev libmcrypt-dev curl curl-dev cyrus-sasl-dev perl pkg-config jpeg-dev jpeg"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.php.net/"
14 WGET_URL="http://us2.php.net/distributions/$TARBALL"
15 PROVIDE="php:lighttpd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 COMMON_ARGS="\
22 --prefix=/usr \
23 --sysconfdir=/etc \
24 --infodir=/usr/share/info \
25 --mandir=/usr/share/man \
26 --enable-fastcgi \
27 --enable-discard-path \
28 --enable-force-cgi-redirect \
29 --enable-mbstring \
30 --enable-sockets \
31 --enable-ftp \
32 --enable-zip \
33 --enable-calendar \
34 --enable-exif \
35 --enable-dba=shared \
36 --enable-dbase=shared \
37 --with-config-file-path=/etc \
38 --with-zlib \
39 --with-gettext \
40 --with-mcrypt=shared,/usr \
41 --with-mysql=shared,/usr \
42 --with-pgsql=shared,/usr \
43 --with-snmp=shared,/usr \
44 --enable-soap=shared,/usr \
45 --with-ldap=shared \
46 --with-imap=shared --with-imap-ssl \
47 --with-mhash=shared \
48 --with-gd=shared \
49 --with-jpeg-dir=/usr \
50 --with-png-dir=/usr \
51 --with-openssl=shared \
52 --with-unixODBC=shared,/usr \
53 --with-pear=/usr/share/php \
54 --with-pdo-mysql=shared \
55 --with-pdo-pgsql=shared \
56 --with-curl=shared \
57 "
58 sed -i 's/pam_start/pam_nostart/' configure
59 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
60 make -j 4 && make INSTALL_ROOT=$PWD/_pkg install
61 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
62 make -j 4 && {
63 mkdir -p _pkg/etc/apache
64 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
65 make INSTALL_ROOT=$PWD/_pkg install
66 }
67 # Recommended config file and phpinfo.
68 cp php.ini-recommended _pkg/etc/php.ini
69 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
70 -i _pkg/etc/php.ini
71 cp -a ../stuff/phpinfo _pkg/usr/share
72 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
73 cp ../stuff/php.desktop _pkg/usr/share/applications
74 cp ../stuff/php.png _pkg/usr/share/pixmaps
75 }
77 # Rules to gen a SliTaz package suitable for Tazpkg.
78 genpkg_rules()
79 {
80 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
81 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
82 }
84 # Post and pre install commands to stop
85 # and restart Web server if needed.
86 pre_install()
87 {
88 if [ -f "$1/var/run/lighttpd.pid" ]; then
89 /etc/init.d/lighttpd stop
90 fi
91 }
92 post_install()
93 {
94 # Enable php
95 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
96 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
97 tazpkg get-install lighttpd-modules --root=$1/
98 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
99 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
100 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
101 -i $1/etc/lighttpd/lighttpd.conf
102 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
103 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
104 -i $1/etc/lighttpd/lighttpd.conf
105 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
106 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
107 -i $1/etc/lighttpd/lighttpd.conf
108 fi
109 # Start Web server.
110 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
111 /etc/init.d/lighttpd start
112 fi
113 }