wok-stable view php/receipt @ rev 10477
youtube-dl: Fixed genpkg_rules.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed May 25 06:00:18 2011 +0000 (2011-05-25) |
parents | 5aaf9b5cc9b2 |
children | 0dcf1c9b84df |
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 net-snmp-dev"
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 && \
63 make -j 4 && make INSTALL_ROOT=$DESTDIR install
64 ./configure $COMMON_ARGS --with-apxs2=/usr/bin/apxs && \
65 make -j 4 && {
66 mkdir -p $DESTDIR/etc/apache
67 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
68 make INSTALL_ROOT=$DESTDIR install
69 }
70 }
72 # Rules to gen a SliTaz package suitable for Tazpkg.
73 genpkg_rules()
74 {
75 mkdir -p $fs/usr/bin $fs/etc $fs/usr/share/php
76 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
77 # Recommended config file and phpinfo.
78 cp $src/php.ini-recommended $fs/etc/php.ini
79 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
80 -i $fs/etc/php.ini
81 cp -a $stuff/phpinfo $install/usr/share
82 }
84 # Post and pre install commands to stop and restart Web server if needed.
85 pre_install()
86 {
87 if [ -f "$1/var/run/lighttpd.pid" ]; then
88 /etc/init.d/lighttpd stop
89 fi
90 }
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 }