wok-current view php56/receipt @ rev 25791
Up expat (2.7.3), patch (2.8), openssl (3.0.18)
| author | Stanislas Leduc <shann@slitaz.org> |
|---|---|
| date | Fri Oct 03 17:05:15 2025 +0000 (3 weeks ago) |
| parents | 4df81955d899 |
| children |
line source
1 # SliTaz package receipt.
3 PACKAGE="php56"
4 VERSION="5.6.40"
5 CATEGORY="development"
6 SHORT_DESC="PHP web programming language."
7 MAINTAINER="shann@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="https://www.php.net/"
11 TARBALL="$PACKAGE-$VERSION.tar.xz"
12 WGET_URL="https://packages.sury.org/php/pool/main/p/php5.6/php5.6_5.6.40.orig.tar.xz"
14 DEPENDS="libssl libzip libxml2 lighttpd php56-common sqlite"
15 BUILD_DEPENDS="apache apache-dev apr-dev apr-util-dev c-client
16 coreutils-conditions curl-dev cyrus-sasl-dev gettext
17 jpeg-dev libldap libmcrypt-dev libmysqlclient libpng-dev
18 libtool libunixODBC libvpx-dev libxml2-dev libzip-dev
19 mhash-dev mysql-dev net-snmp-dev openldap-dev openssl-dev
20 perl pkg-config postgresql-dev re2c sed sqlite-dev
21 unixODBC-dev pcre-dev"
23 HOST_ARCH="i486 arm x86_64"
25 current_version()
26 {
27 wget -O - $WEB_SITE 2>/dev/null | \
28 sed '/Released/!d;s|.*PHP ||;s| Rel.*||' | sort -Vr | sed q
29 }
31 # Special thanks to Ondřej Surý and Freexian for support php 5.6 branch
33 case "$ARCH" in
34 i?86|x86_64)
35 # Add --with-pic, seem issue on x86, no really know
36 # see https://forum.tinycorelinux.net/index.php/topic,22397.0.html
37 # seem also slackware 15.0 use this flag for php 7.4.x
39 ARCH_ARGS=" \
40 --prefix=/usr \
41 --program-suffix=56 \
42 --sysconfdir=/etc/php56 \
43 --datadir=/usr/share/php56 \
44 --infodir=/usr/share/info \
45 --mandir=/usr/share/man \
46 --localstatedir=/var \
47 --config-cache \
48 --enable-calendar \
49 --enable-dba=shared \
50 --enable-exif \
51 --enable-fpm \
52 --enable-ftp \
53 --enable-zip \
54 --enable-opcache \
55 --enable-maintainer-zts \
56 --disable-mbregex \
57 --enable-mbstring \
58 --enable-soap=shared,/usr \
59 --enable-sockets \
60 --with-config-file-path=/etc/php56 \
61 --with-curl=shared \
62 --with-gettext \
63 --with-gd=shared \
64 --with-imap=shared \
65 --with-imap-ssl \
66 --with-ldap=shared \
67 --with-mcrypt=shared \
68 --with-mhash \
69 --with-mysql-sock=/var/run/mysqld/mysql.sock \
70 --with-mysql=shared \
71 --with-mysqli=shared \
72 --with-openssl=shared \
73 --with-jpeg-dir=/usr \
74 --with-pcre-dir=/usr \
75 --with-pcre-regex=/usr \
76 --with-png-dir=/usr \
77 --with-pdo-mysql=shared \
78 --with-pdo-pgsql=shared \
79 --with-pdo-sqlite=shared,/usr \
80 --with-pear=/usr/share/php56 \
81 --with-pgsql=shared,/usr \
82 --with-snmp=shared,/usr \
83 --with-sqlite3=shared,/usr \
84 --with-unixODBC=shared,/usr \
85 --with-pic \
86 --with-zlib" ;;
87 arm*)
88 BUILD_DEPENDS="sqlite-dev libxml2-dev zlib-dev curl-dev"
89 ARCH_ARGS="\
90 --prefix=/usr \
91 --sysconfdir=/etc \
92 --infodir=/usr/share/info \
93 --mandir=/usr/share/man \
94 --config-cache \
95 --enable-mbstring \
96 --enable-sockets \
97 --enable-ftp \
98 --enable-zip \
99 --enable-calendar \
100 --enable-exif \
101 --enable-dba=shared \
102 --enable-sqlite-utf8 \
103 --with-mhash \
104 --with-sqlite=shared \
105 --with-config-file-path=/etc \
106 --with-zlib \
107 --with-gettext \
108 --with-curl=shared \
109 --with-openssl=shared \
110 --with-jpeg-dir=/usr \
111 --with-png-dir=/usr \
112 --with-apxs2=/usr/bin/apxs" ;;
113 esac
115 # Rules to configure and make the package.
116 compile_rules()
117 {
118 for patch in $(cat $stuff/patches/series)
119 do
120 patch -p1 < $stuff/patches/$patch
121 done
123 # Fix credits too few args for php_print_packaging_credits
124 # see https://github.com/oerdnj/deb.sury.org/issues/2138
125 patch -p1 < $stuff/php56-fix-credits.patch
127 export CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration"
129 sed -i 's/pam_start/pam_nostart/' configure
131 ./configure $ARCH_ARGS $CONFIGURE_ARGS &&
132 make $MAKEFLAGS &&
133 make -j1 INSTALL_ROOT=$DESTDIR install &&
134 ./configure $ARCH_ARGS $CONFIGURE_ARGS --with-apxs2=/usr/bin/apxs &&
135 make $MAKEFLAGS &&
136 {
137 mkdir -p $DESTDIR/etc/apache
138 cp /etc/apache/httpd.conf $DESTDIR/etc/apache/httpd.conf
139 make -j1 INSTALL_ROOT=$DESTDIR install
140 }
142 # Production configuration file.
143 mkdir -p $DESTDIR/etc
144 cp $src/php.ini-production $DESTDIR/etc/php56/php.ini || exit 1
145 sed -i -e 's|.dll|.so|g;s|extension=php_|extension=|g' $DESTDIR/etc/php56/php.ini
146 sed -i -e 's|extension_dir = "./"|extension_dir = "/usr/share/php56/"|' \
147 $DESTDIR/etc/php56/php.ini
148 # Don't expose php
149 sed -i -e "s/expose_php = .*/expose_php = Off/g" $DESTDIR/etc/php56/php.ini
150 }
152 # Rules to gen a SliTaz package suitable for Tazpkg.
153 genpkg_rules()
154 {
155 mkdir -p $fs/usr/bin
156 mkdir -p $fs/usr/share/php56
158 cp -a $install/usr/bin/php-cgi56 $fs/usr/bin
159 }
161 # Post and pre install commands to stop
162 # and restart Web server if needed.
163 pre_install()
164 {
165 if [ -z "$1" -a ! -f "/var/run/lighttpd.pid" ]
166 then
167 /etc/init.d/lighttpd stop
168 fi
169 }
171 post_install()
172 {
173 # Enable PHP
174 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
175 then
176 [ -f "$1/usr/lib/lighttpd/mod_fastcgi.so" ] ||
177 tazpkg get-install lighttpd-modules --root="$1/"
178 sed -i -e 's|#fastcgi.server = ( ".php"|fastcgi.server = ( ".php"|' \
179 -e 's|#"bin-path" => "/usr/bin/php-cgi"|"bin-path" => "/usr/bin/php-cgi56"|' \
180 -e 's|#"socket" => "/tmp/php.socket"|"socket" => "/tmp/php56.socket"\n )))|' \
181 "$1/etc/lighttpd/lighttpd.conf"
182 grep -q mod_fastcgi "$1/etc/lighttpd/lighttpd.conf" ||
183 sed -e 's|server.modules = (|server.modules = (\n "mod_fastcgi",|' \
184 -i "$1/etc/lighttpd/lighttpd.conf"
185 grep -q php3 "$1/etc/lighttpd/lighttpd.conf" || \
186 sed -e 's|for PHP.*|for PHP.\nfastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php" )|' \
187 -i "$1/etc/lighttpd/lighttpd.conf"
188 fi
190 # Start Web server.
191 if [ -z "$1" -a ! -f /var/run/lighttpd.pid -a -f /etc/init.d/lighttpd ]
192 then
193 /etc/init.d/lighttpd start
194 fi
195 }