wok view php/receipt @ rev 1320

Fix: DEPENDS in claws-mail
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Thu Aug 28 23:01:04 2008 +0200 (2008-08-28)
parents c932ccf0e453
children 0db2ef809433
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 postgresql postgresql-dev gettext openssl-dev apache-dev apache"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.php.net/"
12 WGET_URL="http://us2.php.net/distributions/$TARBALL"
13 PROVIDE="php:lighttpd"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 cd $src
19 COMMON_ARGS="\
20 --prefix=/usr \
21 --sysconfdir=/etc \
22 --infodir=/usr/share/info \
23 --mandir=/usr/share/man \
24 --enable-fastcgi \
25 --enable-discard-path \
26 --enable-force-cgi-redirect \
27 --enable-mbstring \
28 --with-config-file-path=/etc \
29 --with-zlib \
30 --with-gettext \
31 --with-mysql=shared,usr \
32 --with-pgsql=shared,usr \
33 --with-ldap=shared \
34 --disable-cli"
35 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
36 make && make INSTALL_ROOT=$PWD/_pkg install
37 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
38 make && {
39 mkdir -p _pkg/etc/apache
40 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
41 make INSTALL_ROOT=$PWD/_pkg install
42 }
43 # Recommended config file and phpinfo.
44 cp php.ini-recommended _pkg/etc/php.ini
45 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
46 -i _pkg/etc/php.ini
47 cp -a ../stuff/phpinfo _pkg/usr/share
48 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmap
49 cp ../stuff/php.desktop _pkg/usr/share/applications
50 cp ../stuff/php.png _pkg/usr/share/pixmap
51 }
53 # Rules to gen a SliTaz package suitable for Tazpkg.
54 genpkg_rules()
55 {
56 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
57 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
58 for i in $(cd $WOK; ls -d php-*)
59 do
60 tazwok cook $i
61 done
62 }
64 # Post and pre install commands to stop
65 # and restart Web server if needed.
66 pre_install()
67 {
68 if [ -f "$1/var/run/lighttpd.pid" ]; then
69 /etc/init.d/lighttpd stop
70 fi
71 }
72 post_install()
73 {
74 # Enable php
75 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
76 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
77 tazpkg get-install lighttpd-modules --root=$1/
78 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
79 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
80 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
81 -i $1/etc/lighttpd/lighttpd.conf
82 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
83 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
84 -i $1/etc/lighttpd/lighttpd.conf
85 fi
86 # Start Web server.
87 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
88 /etc/init.d/lighttpd start
89 fi
90 }