wok view php/receipt @ rev 1324

Add php-imap, php-mhash
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 29 07:59:39 2008 +0000 (2008-08-29)
parents 41897da4a1db
children 24cffdc5d961
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.5"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 DEPENDS="php-common lighttpd zlib libxml2 sqlite"
9 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev mysql-dev \
10 postgresql postgresql-dev gettext openssl-dev apache-dev apache \
11 c-client mhash mhash-dev"
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 --with-config-file-path=/etc \
31 --with-zlib \
32 --with-gettext \
33 --with-mysql=shared,/usr \
34 --with-pgsql=shared,/usr \
35 --with-ldap=shared \
36 --with-imap=shared --with-imap-ssl \
37 --with-mhash=shared \
38 --disable-cli"
39 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
40 make && make INSTALL_ROOT=$PWD/_pkg install
41 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
42 make && {
43 mkdir -p _pkg/etc/apache
44 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
45 make INSTALL_ROOT=$PWD/_pkg install
46 }
47 # Recommended config file and phpinfo.
48 cp php.ini-recommended _pkg/etc/php.ini
49 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
50 -i _pkg/etc/php.ini
51 cp -a ../stuff/phpinfo _pkg/usr/share
52 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmap
53 cp ../stuff/php.desktop _pkg/usr/share/applications
54 cp ../stuff/php.png _pkg/usr/share/pixmap
55 }
57 # Rules to gen a SliTaz package suitable for Tazpkg.
58 genpkg_rules()
59 {
60 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
61 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
62 for i in $(cd $WOK; ls -d php-*)
63 do
64 tazwok cook $i
65 done
66 }
68 # Post and pre install commands to stop
69 # and restart Web server if needed.
70 pre_install()
71 {
72 if [ -f "$1/var/run/lighttpd.pid" ]; then
73 /etc/init.d/lighttpd stop
74 fi
75 }
76 post_install()
77 {
78 # Enable php
79 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
80 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
81 tazpkg get-install lighttpd-modules --root=$1/
82 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
83 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
84 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
85 -i $1/etc/lighttpd/lighttpd.conf
86 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
87 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
88 -i $1/etc/lighttpd/lighttpd.conf
89 fi
90 # Start Web server.
91 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
92 /etc/init.d/lighttpd start
93 fi
94 }