wok view php/receipt @ rev 16079

ARM: add more *usb* support and unixODBC
author Christophe Lincoln <pankso@slitaz.org>
date Sat Mar 15 05:33:56 2014 +0100 (2014-03-15)
parents fec9d55946a2
children 76c1f14d1820
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.4.23"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 TARBALL="$PACKAGE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.php.net/"
11 WGET_URL="http://www.php.net/distributions/$TARBALL"
12 PROVIDE="php:lighttpd"
13 #HOST_ARCH="i486 arm"
15 DEPENDS="php-common lighttpd zlib libxml2 sqlite libssl"
16 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev libmysqlclient mysql-dev \
17 net-snmp-dev postgresql-dev gettext openssl-dev apache-dev apr-util-dev \
18 c-client mhash-dev libpng-dev libunixODBC unixODBC-dev openldap-dev \
19 libldap apr-dev libmcrypt-dev curl-dev cyrus-sasl-dev perl pkg-config \
20 jpeg-dev net-snmp-dev libvpx-dev apache coreutils-conditions sed re2c"
22 case "$ARCH" in
23 i?86)
24 ARCH_ARGS="\
25 --prefix=/usr \
26 --sysconfdir=/etc \
27 --infodir=/usr/share/info \
28 --mandir=/usr/share/man \
29 --enable-mbstring \
30 --enable-sockets \
31 --enable-ftp \
32 --enable-zip \
33 --enable-calendar \
34 --enable-exif \
35 --config-cache \
36 --enable-dba=shared \
37 --with-config-file-path=/etc \
38 --with-zlib \
39 --with-gettext \
40 --with-mcrypt=shared,/usr \
41 --with-mysql=shared,/usr \
42 --with-mysqli=shared \
43 --with-mysql-sock=/var/mysql/mysql.sock \
44 --with-pdo-sqlite=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 \
50 --with-imap-ssl \
51 --with-mhash \
52 --with-gd=shared \
53 --with-jpeg-dir=/usr \
54 --with-png-dir=/usr \
55 --with-vpx-dir=/usr \
56 --with-openssl=shared \
57 --with-unixODBC=shared,/usr \
58 --with-pear=/usr/share/php \
59 --with-pdo-mysql=shared \
60 --with-pdo-pgsql=shared \
61 --with-curl=shared \
62 --enable-sqlite-utf8 \
63 --with-sqlite3=shared,/usr \
64 --with-sqlite=shared \
65 --enable-maintainer-zts" ;;
66 arm*)
67 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
68 ARCH_ARGS="\
69 --prefix=/usr \
70 --sysconfdir=/etc \
71 --infodir=/usr/share/info \
72 --mandir=/usr/share/man \
73 --config-cache \
74 --enable-mbstring \
75 --enable-sockets \
76 --enable-ftp \
77 --enable-zip \
78 --enable-calendar \
79 --enable-exif \
80 --enable-dba=shared \
81 --enable-sqlite-utf8 \
82 --with-mhash \
83 --with-sqlite=shared \
84 --with-config-file-path=/etc \
85 --with-zlib \
86 --with-gettext \
87 --with-curl=shared \
88 --with-openssl=shared \
89 --with-jpeg-dir=/usr \
90 --with-png-dir=/usr \
91 --with-apxs2=/usr/bin/apxs" ;;
92 esac
94 # Rules to configure and make the package.
95 compile_rules()
96 {
97 sed -i 's/pam_start/pam_nostart/' configure
98 ./configure $COMMON_ARGS $CONFIGURE_ARGS && \
99 make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
100 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
101 make $MAKEFLAGS && {
102 mkdir -p $DESTDIR/etc/apache
103 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
104 make -j1 INSTALL_ROOT=$DESTDIR install
105 }
106 # Production config file.
107 mkdir -p $DESTDIR/etc
108 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
109 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
110 -i $DESTDIR/etc/php.ini
111 }
113 # Rules to gen a SliTaz package suitable for Tazpkg.
114 genpkg_rules()
115 {
116 mkdir -p $fs/usr/bin $fs/usr/share/php
117 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
118 }
120 # Post and pre install commands to stop
121 # and restart Web server if needed.
122 pre_install()
123 {
124 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
125 /etc/init.d/lighttpd stop
126 fi
127 }
129 post_install()
130 {
131 # Enable php
132 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
133 [ -f $1/usr/lib/lighttpd/mod_fastcgi.so ] || \
134 tazpkg get-install lighttpd-modules --root=$1/
135 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
136 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
137 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
138 -i $1/etc/lighttpd/lighttpd.conf
139 grep -q mod_fastcgi $1/etc/lighttpd/lighttpd.conf || \
140 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
141 -i $1/etc/lighttpd/lighttpd.conf
142 grep -q php3 $1/etc/lighttpd/lighttpd.conf || \
143 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
144 -i $1/etc/lighttpd/lighttpd.conf
145 fi
146 # Start Web server.
147 if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
148 -a -f /etc/init.d/lighttpd ]; then
149 /etc/init.d/lighttpd start
150 fi
151 }