wok view php/receipt @ rev 24102

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 17 10:35:57 2021 +0000 (2021-09-17)
parents bcea19bfa7af
children
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="7.4.4"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.php.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.bz2"
12 WGET_URL="https://www.php.net/distributions/$TARBALL"
14 PROVIDE="php:lighttpd"
15 DEPENDS="libssl libzip libxml2 lighttpd php-common sqlite"
16 BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client
17 coreutils-conditions curl-dev cyrus-sasl-dev gettext
18 jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev
19 libtool libunixODBC libvpx-dev libxml2-dev libzip-dev
20 mhash-dev mysql-dev net-snmp-dev openldap-dev openssl-dev
21 perl pkg-config postgresql-dev re2c sed sqlite-dev
22 unixODBC-dev"
24 #HOST_ARCH="i486 arm"
26 current_version()
27 {
28 wget -O - $WEB_SITE 2>/dev/null | \
29 sed '/Released/!d;s|.*PHP ||;s| Rel.*||' | sort -Vr | sed q
30 }
32 case "$ARCH" in
33 i?86)
34 # 7.4.4 unrecognised:
35 # --enable-zip
36 # --with-jpeg-dir=/usr
37 # --with-png-dir=/usr
39 ARCH_ARGS=" \
40 --prefix=/usr \
41 --sysconfdir=/etc \
42 --infodir=/usr/share/info \
43 --mandir=/usr/share/man \
44 --config-cache \
45 --enable-calendar \
46 --enable-dba=shared \
47 --enable-exif \
48 --enable-ftp \
49 --enable-gd=shared \
50 --enable-maintainer-zts \
51 --disable-mbregex \
52 --enable-mbstring \
53 --enable-soap=shared,/usr \
54 --enable-sockets \
55 --with-config-file-path=/etc \
56 --with-curl=shared \
57 --with-gettext \
58 --with-imap=shared \
59 --with-imap-ssl \
60 --with-ldap=shared \
61 --with-mhash \
62 --with-mysql-sock=/var/run/mysqld/mysql.sock \
63 --with-mysqli=shared \
64 --with-openssl=shared \
65 --with-pdo-mysql=shared \
66 --with-pdo-pgsql=shared \
67 --with-pdo-sqlite=shared,/usr \
68 --with-pear=/usr/share/php \
69 --with-pgsql=shared,/usr \
70 --with-snmp=shared,/usr \
71 --with-sqlite3=shared,/usr \
72 --with-unixODBC=shared,/usr \
73 --with-zlib" ;;
74 arm*)
75 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
76 ARCH_ARGS="\
77 --prefix=/usr \
78 --sysconfdir=/etc \
79 --infodir=/usr/share/info \
80 --mandir=/usr/share/man \
81 --config-cache \
82 --enable-mbstring \
83 --enable-sockets \
84 --enable-ftp \
85 --enable-zip \
86 --enable-calendar \
87 --enable-exif \
88 --enable-dba=shared \
89 --enable-sqlite-utf8 \
90 --with-mhash \
91 --with-sqlite=shared \
92 --with-config-file-path=/etc \
93 --with-zlib \
94 --with-gettext \
95 --with-curl=shared \
96 --with-openssl=shared \
97 --with-jpeg-dir=/usr \
98 --with-png-dir=/usr \
99 --with-apxs2=/usr/bin/apxs" ;;
100 esac
102 # Rules to configure and make the package.
103 compile_rules()
104 {
105 sed -i 's/pam_start/pam_nostart/' configure
107 ./configure $ARCH_ARGS $CONFIGURE_ARGS &&
108 make $MAKEFLAGS &&
109 make -j1 INSTALL_ROOT=$DESTDIR install &&
110 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs &&
111 make $MAKEFLAGS &&
112 {
113 mkdir -p $DESTDIR/etc/apache
114 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
115 make -j1 INSTALL_ROOT=$DESTDIR install
116 }
118 # Production configuration file.
119 mkdir -p $DESTDIR/etc
120 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
121 sed -i -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
122 $DESTDIR/etc/php.ini
123 }
125 # Rules to gen a SliTaz package suitable for Tazpkg.
126 genpkg_rules()
127 {
128 mkdir -p $fs/usr/bin
129 mkdir -p $fs/usr/share/php
131 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
132 }
134 # Post and pre install commands to stop
135 # and restart Web server if needed.
136 pre_install()
137 {
138 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
139 then
140 /etc/init.d/lighttpd stop
141 fi
142 }
144 post_install()
145 {
146 # Enable PHP
147 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
148 then
149 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
150 tazpkg get-install lighttpd-modules --root="$1/"
151 sed -i -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
152 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
153 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
154 "$1/etc/lighttpd/lighttpd.conf"
155 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
156 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
157 -i "$1/etc/lighttpd/lighttpd.conf"
158 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
159 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
160 -i "$1/etc/lighttpd/lighttpd.conf"
161 fi
163 # Start Web server.
164 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
165 then
166 /etc/init.d/lighttpd start
167 fi
168 }