wok-current view php/receipt @ rev 25693

Up depends pkgs for cups, need to rebuild it for ssl 3.0
author Stanislas Leduc <shann@slitaz.org>
date Sun Mar 24 15:17:37 2024 +0000 (2 months ago)
parents a23978bfa665
children
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="libssl11 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 openssl11-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 # Adjust path for use OpenSSL 1.1
44 export PHP_OPENSSL_DIR="/usr/lib/openssl-1.1"
45 export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/openssl-1.1/pkgconfig"
47 ARCH_ARGS=" \
48 --prefix=/usr \
49 --sysconfdir=/etc \
50 --infodir=/usr/share/info \
51 --mandir=/usr/share/man \
52 --config-cache \
53 --enable-calendar \
54 --enable-dba=shared \
55 --enable-exif \
56 --enable-ftp \
57 --enable-gd=shared \
58 --enable-maintainer-zts \
59 --disable-mbregex \
60 --enable-mbstring \
61 --enable-soap=shared,/usr \
62 --enable-sockets \
63 --with-config-file-path=/etc \
64 --with-curl=shared \
65 --with-gettext \
66 --with-imap=shared \
67 --with-imap-ssl \
68 --with-ldap=shared \
69 --with-mhash \
70 --with-mysql-sock=/var/run/mysqld/mysql.sock \
71 --with-mysqli=shared \
72 --with-openssl=shared \
73 --with-pdo-mysql=shared \
74 --with-pdo-pgsql=shared \
75 --with-pdo-sqlite=shared,/usr \
76 --with-pear=/usr/share/php \
77 --with-pgsql=shared,/usr \
78 --with-snmp=shared,/usr \
79 --with-sqlite3=shared,/usr \
80 --with-unixODBC=shared,/usr \
81 --with-pic \
82 --with-zlib" ;;
83 arm*)
84 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
85 ARCH_ARGS="\
86 --prefix=/usr \
87 --sysconfdir=/etc \
88 --infodir=/usr/share/info \
89 --mandir=/usr/share/man \
90 --config-cache \
91 --enable-mbstring \
92 --enable-sockets \
93 --enable-ftp \
94 --enable-zip \
95 --enable-calendar \
96 --enable-exif \
97 --enable-dba=shared \
98 --enable-sqlite-utf8 \
99 --with-mhash \
100 --with-sqlite=shared \
101 --with-config-file-path=/etc \
102 --with-zlib \
103 --with-gettext \
104 --with-curl=shared \
105 --with-openssl=shared \
106 --with-jpeg-dir=/usr \
107 --with-png-dir=/usr \
108 --with-apxs2=/usr/bin/apxs" ;;
109 esac
111 # Rules to configure and make the package.
112 compile_rules()
113 {
114 sed -i 's/pam_start/pam_nostart/' configure
116 ./configure $ARCH_ARGS $CONFIGURE_ARGS &&
117 make $MAKEFLAGS &&
118 make -j1 INSTALL_ROOT=$DESTDIR install &&
119 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs &&
120 make $MAKEFLAGS &&
121 {
122 mkdir -p $DESTDIR/etc/apache
123 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
124 make -j1 INSTALL_ROOT=$DESTDIR install
125 }
127 # Production configuration file.
128 mkdir -p $DESTDIR/etc
129 cp $src/php.ini-production $DESTDIR/etc/php.ini || exit 1
130 sed -i -e 's|extension_dir = "./"|extension_dir = "/usr/share/php/"|' \
131 $DESTDIR/etc/php.ini
132 }
134 # Rules to gen a SliTaz package suitable for Tazpkg.
135 genpkg_rules()
136 {
137 mkdir -p $fs/usr/bin
138 mkdir -p $fs/usr/share/php
140 cp -a $src/sapi/cgi/php-cgi $fs/usr/bin
141 }
143 # Post and pre install commands to stop
144 # and restart Web server if needed.
145 pre_install()
146 {
147 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
148 then
149 /etc/init.d/lighttpd stop
150 fi
151 }
153 post_install()
154 {
155 # Enable PHP
156 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
157 then
158 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
159 tazpkg get-install lighttpd-modules --root="$1/"
160 sed -i -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
161 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi"|' \
162 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php.socket"\n )))|' \
163 "$1/etc/lighttpd/lighttpd.conf"
164 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
165 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
166 -i "$1/etc/lighttpd/lighttpd.conf"
167 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
168 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
169 -i "$1/etc/lighttpd/lighttpd.conf"
170 fi
172 # Start Web server.
173 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
174 then
175 /etc/init.d/lighttpd start
176 fi
177 }