wok view php/receipt @ rev 9859
php: should fix the receipt (missing $install and sed bdep)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 16 16:29:17 2011 +0200 (2011-05-16) |
parents | fc0d661345d6 |
children | cb5c920771ca |
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 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 sed"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 cd $src
24 COMMON_ARGS="\
25 --prefix=/usr \
26 --sysconfdir=/etc \
27 --infodir=/usr/share/info \
28 --mandir=/usr/share/man \
29 --enable-fastcgi \
30 --enable-discard-path \
31 --enable-force-cgi-redirect \
32 --enable-mbstring \
33 --enable-sockets \
34 --enable-ftp \
35 --enable-zip \
36 --enable-calendar \
37 --enable-exif \
38 --enable-dba=shared \
39 --enable-dbase=shared \
40 --with-config-file-path=/etc \
41 --with-zlib \
42 --with-gettext \
43 --with-mcrypt=shared,/usr \
44 --with-mysql=shared,/usr \
45 --with-pgsql=shared,/usr \
46 --with-snmp=shared,/usr \
47 --enable-soap=shared,/usr \
48 --with-ldap=shared \
49 --with-imap=shared --with-imap-ssl \
50 --with-mhash=shared \
51 --with-gd=shared \
52 --with-jpeg-dir=/usr \
53 --with-png-dir=/usr \
54 --with-openssl=shared \
55 --with-unixODBC=shared,/usr \
56 --with-pear=/usr/share/php \
57 --with-pdo-mysql=shared \
58 --with-pdo-pgsql=shared \
59 --with-curl=shared \
60 "
61 sed -i 's/pam_start/pam_nostart/' configure
62 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
63 make -j 4 && make INSTALL_ROOT=$PWD/install install
64 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
65 make -j 4 && {
66 mkdir -p $install/etc/apache
67 cp /etc/apache/httpd.conf $install/etc/apache/httpd.conf
68 make INSTALL_ROOT=$install install
69 }
70 # Recommended config file and phpinfo.
71 cp php.ini-recommended $install/etc/php.ini
72 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
73 -i $install/etc/php.ini
74 cp -a $stuff/phpinfo $install/usr/share
75 mkdir install/usr/share/applications $install/usr/share/pixmaps
76 cp $stuff/php.desktop $install/usr/share/applications
77 cp $stuff/php.png $install/usr/share/pixmaps
78 }
80 # Rules to gen a SliTaz package suitable for Tazpkg.
81 genpkg_rules()
82 {
83 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
84 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
85 }
87 # Post and pre install commands to stop
88 # and restart Web server if needed.
89 pre_install()
90 {
91 if [ -f "$1/var/run/lighttpd.pid" ]; then
92 /etc/init.d/lighttpd stop
93 fi
94 }
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 }