wok-current view php/receipt @ rev 21582

Use python-setuptools as bdeps (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 19 19:45:04 2019 +0200 (2019-05-19)
parents ccb0caebef6f
children 84a3b4b621e1
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="5.5.13"
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="https://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/run/mysqld/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 --with-sqlite3=shared,/usr \
63 --enable-maintainer-zts" ;;
64 arm*)
65 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
66 ARCH_ARGS="\
67 --prefix=/usr \
68 --sysconfdir=/etc \
69 --infodir=/usr/share/info \
70 --mandir=/usr/share/man \
71 --config-cache \
72 --enable-mbstring \
73 --enable-sockets \
74 --enable-ftp \
75 --enable-zip \
76 --enable-calendar \
77 --enable-exif \
78 --enable-dba=shared \
79 --enable-sqlite-utf8 \
80 --with-mhash \
81 --with-sqlite=shared \
82 --with-config-file-path=/etc \
83 --with-zlib \
84 --with-gettext \
85 --with-curl=shared \
86 --with-openssl=shared \
87 --with-jpeg-dir=/usr \
88 --with-png-dir=/usr \
89 --with-apxs2=/usr/bin/apxs" ;;
90 esac
92 # Rules to configure and make the package.
93 compile_rules()
94 {
95 sed -i 's|IMG_FMT_I420|VPX_&|;s|PLANE_|VPX_&|' ext/gd/libgd/webpimg.c
96 sed -i 's/pam_start/pam_nostart/' configure
97 ./configure $ARCH_ARGS $CONFIGURE_ARGS && \
98 make $MAKEFLAGS && make -j1 INSTALL_ROOT=$DESTDIR install
99 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs && \
100 make $MAKEFLAGS && {
101 mkdir -p $DESTDIR/etc/apache
102 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
103 make -j1 INSTALL_ROOT=$DESTDIR install
104 }
105 # Production config file.
106 mkdir -p $DESTDIR/etc
107 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
108 sed -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
109 -i $DESTDIR/etc/php.ini
110 }
112 # Rules to gen a SliTaz package suitable for Tazpkg.
113 genpkg_rules()
114 {
115 mkdir -p $fs/usr/bin $fs/usr/share/php
116 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
117 }
119 # Post and pre install commands to stop
120 # and restart Web server if needed.
121 pre_install()
122 {
123 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]; then
124 /etc/init.d/lighttpd stop
125 fi
126 }
128 post_install()
129 {
130 # Enable php
131 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
132 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] || \
133 tazpkg get-install lighttpd-modules --root="$1/"
134 sed -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
135 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
136 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
137 -i "$1/etc/lighttpd/lighttpd.conf"
138 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" || \
139 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
140 -i "$1/etc/lighttpd/lighttpd.conf"
141 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
142 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
143 -i "$1/etc/lighttpd/lighttpd.conf"
144 fi
145 # Start Web server.
146 if [ -z "$1" -a ! -f /var/run/lighttpd.pid \
147 -a -f /etc/init.d/lighttpd ]; then
148 /etc/init.d/lighttpd start
149 fi
150 }