wok-current view php/receipt @ rev 25672
patch tazpkg, upgrade core pkgs first
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Mar 03 17:58:42 2024 +0000 (5 months ago) |
parents | 15650f5d595b |
children | bfd1d974e88e |
line source
1 # SliTaz package receipt.
3 PACKAGE="php"
4 VERSION="7.4.33"
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 # Add --with-pic, seem issue on x86, no really know
40 # see https://forum.tinycorelinux.net/index.php/topic,22397.0.html
41 # seem also slackware 15.0 use this flag for php 7.4.x
43 ARCH_ARGS=" \
44 --prefix=/usr \
45 --sysconfdir=/etc \
46 --infodir=/usr/share/info \
47 --mandir=/usr/share/man \
48 --config-cache \
49 --enable-calendar \
50 --enable-dba=shared \
51 --enable-exif \
52 --enable-ftp \
53 --enable-gd=shared \
54 --enable-maintainer-zts \
55 --disable-mbregex \
56 --enable-mbstring \
57 --enable-soap=shared,/usr \
58 --enable-sockets \
59 --with-config-file-path=/etc \
60 --with-curl=shared \
61 --with-gettext \
62 --with-imap=shared \
63 --with-imap-ssl \
64 --with-ldap=shared \
65 --with-mhash \
66 --with-mysql-sock=/var/run/mysqld/mysql.sock \
67 --with-mysqli=shared \
68 --with-openssl=shared \
69 --with-pdo-mysql=shared \
70 --with-pdo-pgsql=shared \
71 --with-pdo-sqlite=shared,/usr \
72 --with-pear=/usr/share/php \
73 --with-pgsql=shared,/usr \
74 --with-snmp=shared,/usr \
75 --with-sqlite3=shared,/usr \
76 --with-unixODBC=shared,/usr \
77 --with-pic \
78 --with-zlib" ;;
79 arm*)
80 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
81 ARCH_ARGS="\
82 --prefix=/usr \
83 --sysconfdir=/etc \
84 --infodir=/usr/share/info \
85 --mandir=/usr/share/man \
86 --config-cache \
87 --enable-mbstring \
88 --enable-sockets \
89 --enable-ftp \
90 --enable-zip \
91 --enable-calendar \
92 --enable-exif \
93 --enable-dba=shared \
94 --enable-sqlite-utf8 \
95 --with-mhash \
96 --with-sqlite=shared \
97 --with-config-file-path=/etc \
98 --with-zlib \
99 --with-gettext \
100 --with-curl=shared \
101 --with-openssl=shared \
102 --with-jpeg-dir=/usr \
103 --with-png-dir=/usr \
104 --with-apxs2=/usr/bin/apxs" ;;
105 esac
107 # Rules to configure and make the package.
108 compile_rules()
109 {
110 sed -i 's/pam_start/pam_nostart/' configure
112 ./configure $ARCH_ARGS $CONFIGURE_ARGS &&
113 make $MAKEFLAGS &&
114 make -j1 INSTALL_ROOT=$DESTDIR install &&
115 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs &&
116 make $MAKEFLAGS &&
117 {
118 mkdir -p $DESTDIR/etc/apache
119 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
120 make -j1 INSTALL_ROOT=$DESTDIR install
121 }
123 # Production configuration file.
124 mkdir -p $DESTDIR/etc
125 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
126 sed -i -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
127 $DESTDIR/etc/php.ini
128 }
130 # Rules to gen a SliTaz package suitable for Tazpkg.
131 genpkg_rules()
132 {
133 mkdir -p $fs/usr/bin
134 mkdir -p $fs/usr/share/php
136 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
137 }
139 # Post and pre install commands to stop
140 # and restart Web server if needed.
141 pre_install()
142 {
143 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
144 then
145 /etc/init.d/lighttpd stop
146 fi
147 }
149 post_install()
150 {
151 # Enable PHP
152 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
153 then
154 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
155 tazpkg get-install lighttpd-modules --root="$1/"
156 sed -i -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
157 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
158 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
159 "$1/etc/lighttpd/lighttpd.conf"
160 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
161 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
162 -i "$1/etc/lighttpd/lighttpd.conf"
163 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
164 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
165 -i "$1/etc/lighttpd/lighttpd.conf"
166 fi
168 # Start Web server.
169 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
170 then
171 /etc/init.d/lighttpd start
172 fi
173 }