wok-next view php/receipt @ rev 3729
php-gd: add jpeg & png support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 22 17:16:37 2009 +0200 (2009-07-22) |
parents | 86e0619b7121 |
children | 2927081919c9 |
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.2.9"
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 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 unixODBC-dev openldap-dev libldap apr-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 --enable-sockets \
31 --with-config-file-path=/etc \
32 --with-zlib \
33 --with-gettext \
34 --with-mysql=shared,/usr \
35 --with-pgsql=shared,/usr \
36 --with-snmp=shared,/usr \
37 --with-ldap=shared \
38 --with-imap=shared --with-imap-ssl \
39 --with-mhash=shared \
40 --with-gd=shared \
41 --with-jpeg-dir=/usr \
42 --with-png-dir=/usr \
43 --with-openssl=shared \
44 --with-unixODBC=shared,/usr \
45 --with-pear=/usr/share/php \
46 "
47 sed -i 's/pam_start/pam_nostart/' configure
48 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
49 make && make INSTALL_ROOT=$PWD/_pkg install
50 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs $CONFIGURE_ARGS && \
51 make && {
52 mkdir -p _pkg/etc/apache
53 cp /etc/apache/httpd.conf _pkg/etc/apache/httpd.conf
54 make INSTALL_ROOT=$PWD/_pkg install
55 }
56 # Recommended config file and phpinfo.
57 cp php.ini-recommended _pkg/etc/php.ini
58 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
59 -i _pkg/etc/php.ini
60 cp -a ../stuff/phpinfo _pkg/usr/share
61 mkdir _pkg/usr/share/applications _pkg/usr/share/pixmaps
62 cp ../stuff/php.desktop _pkg/usr/share/applications
63 cp ../stuff/php.png _pkg/usr/share/pixmaps
64 }
66 # Rules to gen a SliTaz package suitable for Tazpkg.
67 genpkg_rules()
68 {
69 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share
70 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
71 for i in $(cd $WOK; ls -d php-*)
72 do
73 tazwok cook $i
74 done
75 }
77 # Post and pre install commands to stop
78 # and restart Web server if needed.
79 pre_install()
80 {
81 if [ -f "$1/var/run/lighttpd.pid" ]; then
82 /etc/init.d/lighttpd stop
83 fi
84 }
85 post_install()
86 {
87 # Enable php
88 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
89 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
90 tazpkg get-install lighttpd-modules --root=$1/
91 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
92 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
93 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
94 -i $1/etc/lighttpd/lighttpd.conf
95 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
96 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
97 -i $1/etc/lighttpd/lighttpd.conf
98 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
99 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
100 -i $1/etc/lighttpd/lighttpd.conf
101 fi
102 # Start Web server.
103 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
104 /etc/init.d/lighttpd start
105 fi
106 }