mirror of
				https://gitlab.alpinelinux.org/alpine/aports.git
				synced 2025-10-31 00:12:05 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			738 lines
		
	
	
		
			20 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			738 lines
		
	
	
		
			20 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| # Contributor: Valery Kartel <valery.kartel@gmail.com>
 | |
| # Contributor: Jakub Jirutka <jakub@jirutka.cz>
 | |
| # Maintainer: Valery Kartel <valery.kartel@gmail.com>
 | |
| 
 | |
| # Bundled libraries
 | |
| #
 | |
| # Name      | License             | Location               | State
 | |
| # ----------+---------------------+------------------------+---------
 | |
| # bcmath    | LGPL-2.1-or-later   | ext/bcmath/libbcmath   | used
 | |
| # date      | MIT                 | ext/date/lib           | used
 | |
| # fileinfo  | BSD-2-Clause        | ext/fileinfo/libmagic  | used
 | |
| # gd        | BSD                 | ext/gd/libgd           | used
 | |
| # hash      | CC0-1.0             | ext/hash/sha3          | used
 | |
| # libmbfl   | LGPL-2.1-only       | ext/mbstring/libmbfl   | used
 | |
| # pcre      | BSD-3-Clause        | ext/pcre/pcrelib       | not used
 | |
| # sqlite3   | Public              | ext/sqlite3/libsqlite  | not used
 | |
| # libXMLRPC | BSD-3-Clause        | ext/xmlrpc/libxmlrpc   | used
 | |
| # libzip    | BSD-3-Clause        | ext/zip/lib            | not used
 | |
| 
 | |
| # Static extensions
 | |
| #
 | |
| # Name      | Reason
 | |
| # ----------+--------------------------------------------
 | |
| # zlib      | https://bugs.alpinelinux.org/issues/8299
 | |
| 
 | |
| pkgname=php7
 | |
| _pkgreal=php
 | |
| pkgver=7.4.33
 | |
| pkgrel=1
 | |
| _apiver=20190902
 | |
| _suffix=${pkgname#php}
 | |
| # Is this package the default (latest) PHP version?
 | |
| _default_php="no"
 | |
| pkgdesc="The PHP$_suffix language runtime engine"
 | |
| # priority of community/php81 is 100
 | |
| provider_priority=0
 | |
| url="https://www.php.net/"
 | |
| arch="all"
 | |
| license="PHP-3.01 BSD-3-Clause LGPL-2.0-or-later MIT Zend-2.0"
 | |
| depends="$pkgname-common"
 | |
| depends_dev="$pkgname=$pkgver-r$pkgrel autoconf pcre2-dev re2c"
 | |
| # Most dependencies between extensions is auto-discovered (see _extension()).
 | |
| _depends_mysqlnd="$pkgname-openssl"
 | |
| _depends_pdo_mysql="$pkgname-pdo $pkgname-mysqlnd"
 | |
| _depends_phar="$pkgname"
 | |
| # openssl is actually transitive dependency here, but we need to because of
 | |
| # load index based on number of dependencies.
 | |
| _depends_mysqli="$pkgname-mysqlnd $pkgname-openssl"
 | |
| makedepends="
 | |
| 	$depends_dev
 | |
| 	apache2-dev
 | |
| 	argon2-dev
 | |
| 	aspell-dev
 | |
| 	bison
 | |
| 	bzip2-dev
 | |
| 	curl-dev
 | |
| 	enchant2-dev
 | |
| 	freetds-dev
 | |
| 	freetype-dev
 | |
| 	gdbm-dev
 | |
| 	gettext-dev
 | |
| 	gmp-dev
 | |
| 	icu-dev
 | |
| 	imap-dev
 | |
| 	krb5-dev
 | |
| 	libedit-dev
 | |
| 	libical-dev
 | |
| 	libjpeg-turbo-dev
 | |
| 	libpng-dev
 | |
| 	libpq-dev
 | |
| 	lmdb-dev
 | |
| 	oniguruma-dev
 | |
| 	libsodium-dev
 | |
| 	libwebp-dev
 | |
| 	libxml2-dev
 | |
| 	libxpm-dev
 | |
| 	libxslt-dev
 | |
| 	libzip-dev
 | |
| 	net-snmp-dev
 | |
| 	openldap-dev
 | |
| 	sqlite-dev
 | |
| 	tidyhtml-dev
 | |
| 	unixodbc-dev
 | |
| 	zlib-dev
 | |
| 	"
 | |
| checkdepends="icu-data-full"
 | |
| subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc
 | |
| 	$pkgname-phpdbg $pkgname-apache2
 | |
| 	$pkgname-embed $pkgname-cgi $pkgname-fpm
 | |
| 	$pkgname-pear::noarch
 | |
| 	"
 | |
| source="https://php.net/distributions/$_pkgreal-$pkgver.tar.xz
 | |
| 	$pkgname-fpm.initd
 | |
| 	$pkgname-fpm.logrotate
 | |
| 	$pkgname-module.conf
 | |
| 	disabled-tests.list
 | |
| 	install-pear.patch
 | |
| 	includedir.patch
 | |
| 	sharedir.patch
 | |
| 	php7-fpm-version-suffix.patch
 | |
| 	fix-tests-devserver.patch
 | |
| 	enchant-2.patch
 | |
| 	xfail-openssl-1.1-test.patch
 | |
| 	atomic-lsapi.patch
 | |
| 	fix-curl-7.83-test.patch
 | |
| 	openssl3.patch
 | |
| 	fix-icu72.patch
 | |
| 	CVE-2023-0567-1.patch
 | |
| 	CVE-2023-0567-2.patch
 | |
| 	CVE-2023-0568.patch
 | |
| 	CVE-2023-0662-1.patch
 | |
| 	CVE-2023-0662-2.patch
 | |
| 	fix-fpm-tests.patch
 | |
| 	fix-fpm-syntax.patch
 | |
| 	"
 | |
| builddir="$srcdir/$_pkgreal-$pkgver"
 | |
| 
 | |
| _libdir="/usr/lib/$pkgname"
 | |
| _extension_dir="$_libdir/modules"
 | |
| _extension_confd="/etc/$pkgname/conf.d"
 | |
| 
 | |
| _extensions="
 | |
| 	bcmath
 | |
| 	bz2
 | |
| 	calendar
 | |
| 	ctype
 | |
| 	curl
 | |
| 	dba
 | |
| 	dom
 | |
| 	enchant
 | |
| 	exif
 | |
| 	ffi
 | |
| 	fileinfo
 | |
| 	ftp
 | |
| 	gd
 | |
| 	gettext
 | |
| 	gmp
 | |
| 	iconv
 | |
| 	imap
 | |
| 	intl
 | |
| 	json
 | |
| 	ldap
 | |
| 	mbstring
 | |
| 	mysqli
 | |
| 	mysqlnd
 | |
| 	odbc
 | |
| 	opcache
 | |
| 	openssl
 | |
| 	pcntl
 | |
| 	pdo
 | |
| 	pdo_dblib
 | |
| 	pdo_mysql
 | |
| 	pdo_odbc
 | |
| 	pdo_pgsql
 | |
| 	pdo_sqlite
 | |
| 	pgsql
 | |
| 	phar
 | |
| 	posix
 | |
| 	pspell
 | |
| 	session
 | |
| 	shmop
 | |
| 	simplexml
 | |
| 	snmp
 | |
| 	soap
 | |
| 	sodium
 | |
| 	sockets
 | |
| 	sqlite3
 | |
| 	sysvmsg
 | |
| 	sysvsem
 | |
| 	sysvshm
 | |
| 	tidy
 | |
| 	tokenizer
 | |
| 	xml
 | |
| 	xmlreader
 | |
| 	xmlrpc
 | |
| 	xmlwriter
 | |
| 	xsl
 | |
| 	zip
 | |
| 	"
 | |
| for _ext in $_extensions; do
 | |
| 	case "$_ext" in
 | |
| 		phar) subpackages="$subpackages $pkgname-$_ext:$_ext";;
 | |
| 		*) subpackages="$subpackages $pkgname-$_ext:_extension";;
 | |
| 	esac
 | |
| done
 | |
| subpackages="$subpackages $pkgname-common::noarch"
 | |
| 
 | |
| subpackages="$subpackages $pkgname-litespeed"
 | |
| 
 | |
| # secfixes:
 | |
| #   7.4.33-r1:
 | |
| #     - CVE-2023-0567
 | |
| #     - CVE-2023-0568
 | |
| #     - CVE-2023-0662
 | |
| #   7.4.33-r0:
 | |
| #     - CVE-2022-31630
 | |
| #     - CVE-2022-37454
 | |
| #   7.4.32-r0:
 | |
| #     - CVE-2022-31628
 | |
| #     - CVE-2022-31629
 | |
| #   7.4.29-r3:
 | |
| #     - CVE-2022-31625
 | |
| #     - CVE-2022-31626
 | |
| #   7.4.28-r0:
 | |
| #     - CVE-2021-21708
 | |
| #   7.4.26-r0:
 | |
| #     - CVE-2021-21707
 | |
| #   7.4.25-r0:
 | |
| #     - CVE-2021-21703
 | |
| #   7.4.24-r0:
 | |
| #     - CVE-2021-21706
 | |
| #   7.4.21-r0:
 | |
| #     - CVE-2021-21705
 | |
| #   7.4.15-r0:
 | |
| #     - CVE-2021-21702
 | |
| #   7.4.14-r0:
 | |
| #     - CVE-2020-7071
 | |
| #   7.4.11-r0:
 | |
| #     - CVE-2020-7069
 | |
| #     - CVE-2020-7070
 | |
| #   7.3.18-r0:
 | |
| #     - CVE-2019-11048
 | |
| #   7.3.17-r0:
 | |
| #     - CVE-2020-7067
 | |
| #   7.3.16-r0:
 | |
| #     - CVE-2020-7064
 | |
| #     - CVE-2020-7065
 | |
| #     - CVE-2020-7066
 | |
| #   7.3.15-r0:
 | |
| #     - CVE-2020-7061
 | |
| #     - CVE-2020-7062
 | |
| #     - CVE-2020-7063
 | |
| #   7.3.14-r0:
 | |
| #     - CVE-2020-7059
 | |
| #     - CVE-2020-7060
 | |
| #   7.3.13-r0:
 | |
| #     - CVE-2019-11045
 | |
| #     - CVE-2019-11047
 | |
| #     - CVE-2019-11050
 | |
| #   7.3.11-r0:
 | |
| #     - CVE-2019-11043
 | |
| #   7.3.9-r0:
 | |
| #     - CVE-2019-13224
 | |
| #   7.3.8-r0:
 | |
| #     - CVE-2019-11041
 | |
| #     - CVE-2019-11042
 | |
| #   7.2.19-r0:
 | |
| #     - CVE-2019-11039
 | |
| #     - CVE-2019-11040
 | |
| #   7.2.18-r0:
 | |
| #     - CVE-2019-11036
 | |
| #   7.2.17-r0:
 | |
| #     - CVE-2019-11034
 | |
| #     - CVE-2019-11035
 | |
| #   7.2.16-r0:
 | |
| #     - CVE-2019-9641
 | |
| #     - CVE-2019-9640
 | |
| #     - CVE-2019-9639
 | |
| #     - CVE-2019-9638
 | |
| #     - CVE-2019-9637
 | |
| #   7.2.14-r0:
 | |
| #     - CVE-2019-9024
 | |
| #     - CVE-2019-9023
 | |
| #     - CVE-2019-9022
 | |
| #     - CVE-2019-9021
 | |
| #     - CVE-2019-9020
 | |
| #   7.2.13-r0:
 | |
| #     - CVE-2018-20783
 | |
| #   7.2.8-r0:
 | |
| #     - CVE-2015-9253
 | |
| #     - CVE-2018-12882
 | |
| #     - CVE-2018-12883
 | |
| #     - CVE-2018-14851
 | |
| #   7.2.5-r0:
 | |
| #     - CVE-2018-5712
 | |
| #     - CVE-2018-10546
 | |
| #     - CVE-2018-10547
 | |
| #     - CVE-2018-10548
 | |
| #     - CVE-2018-10549
 | |
| 
 | |
| prepare() {
 | |
| 	default_prepare
 | |
| 
 | |
| 	local vapi=$(sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h)
 | |
| 	if [ "$vapi" != "$_apiver" ]; then
 | |
| 		error "Upstream API version is now $vapi. Expecting $_apiver"
 | |
| 		error "After updating _apiver, all 3rd-party extensions must be rebuilt."
 | |
| 		return 1
 | |
| 	fi
 | |
| 
 | |
| 	# https://bugs.php.net/63362 - Not needed but installed headers.
 | |
| 	# Drop some Windows specific headers to avoid installation,
 | |
| 	# before build to ensure they are really not needed.
 | |
| 	rm -f TSRM/tsrm_win32.h \
 | |
| 		TSRM/tsrm_config.w32.h \
 | |
| 		Zend/zend_config.w32.h \
 | |
| 		ext/mysqlnd/config-win.h \
 | |
| 		ext/standard/winver.h
 | |
| 
 | |
| 	# Fix some bogus permissions.
 | |
| 	find . -name '*.[ch]' -exec chmod 644 {} \;
 | |
| 
 | |
| 	# XXX: Delete failing tests.
 | |
| 	sed -n '/^[^#]/p' "$srcdir"/disabled-tests.list | while read -r item; do
 | |
| 		rm -r $item  # do it in this way to apply globbing...
 | |
| 	done
 | |
| 
 | |
| 	autoconf
 | |
| }
 | |
| 
 | |
| # Notes:
 | |
| # * gd-jis-conv breaks any non-latin font rendering (vakartel).
 | |
| # * libxml cannot be build as shared.
 | |
| # * -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 (https://www.php.net/manual/en/intro.filesystem.php andypost)
 | |
| # * -O2 optimize for apps usage (andypost)
 | |
| _build() {
 | |
| 	local common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 | |
| 	export CFLAGS="${CFLAGS/-Os/-O2} $common_flags"
 | |
| 	export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags"
 | |
| 
 | |
| 	local without_pcre_jit
 | |
| 	[ "$CARCH" = "s390x" ] && without_pcre_jit="--without-pcre-jit"
 | |
| 
 | |
| 	EXTENSION_DIR=$_extension_dir ./configure \
 | |
| 		--build=$CBUILD \
 | |
| 		--host=$CHOST \
 | |
| 		--prefix=/usr \
 | |
| 		--program-suffix=$_suffix \
 | |
| 		--libdir=$_libdir \
 | |
| 		--datadir=/usr/share/$pkgname \
 | |
| 		--sysconfdir=/etc/$pkgname \
 | |
| 		--localstatedir=/var \
 | |
| 		--with-layout=GNU \
 | |
| 		--with-pic \
 | |
| 		--with-config-file-path=/etc/$pkgname \
 | |
| 		--with-config-file-scan-dir=$_extension_confd \
 | |
| 		--disable-short-tags \
 | |
| 		\
 | |
| 		--enable-bcmath=shared \
 | |
| 		--with-bz2=shared \
 | |
| 		--enable-calendar=shared \
 | |
| 		--enable-ctype=shared \
 | |
| 		--with-curl=shared \
 | |
| 		--enable-dba=shared \
 | |
| 			--with-dbmaker=shared \
 | |
| 			--with-gdbm \
 | |
| 			--with-lmdb \
 | |
| 		--enable-dom=shared \
 | |
| 		--with-enchant=shared \
 | |
| 		--enable-exif=shared \
 | |
| 		--with-ffi=shared \
 | |
| 		--enable-fileinfo=shared \
 | |
| 		--enable-ftp=shared \
 | |
| 		--enable-gd=shared \
 | |
| 			--with-freetype \
 | |
| 			--with-jpeg \
 | |
| 			--with-webp \
 | |
| 			--with-xpm \
 | |
| 			--disable-gd-jis-conv \
 | |
| 		--with-gettext=shared \
 | |
| 		--with-gmp=shared \
 | |
| 		--with-iconv=shared \
 | |
| 		--with-imap=shared \
 | |
| 			--with-imap-ssl \
 | |
| 		--enable-intl=shared \
 | |
| 		--enable-json=shared \
 | |
| 		--with-ldap=shared \
 | |
| 			--with-ldap-sasl \
 | |
| 		--with-libedit \
 | |
| 		--with-libxml \
 | |
| 		--enable-mbstring=shared \
 | |
| 		--with-mysqli=shared,mysqlnd \
 | |
| 			--with-mysql-sock=/run/mysqld/mysqld.sock \
 | |
| 		--enable-mysqlnd=shared \
 | |
| 		--enable-opcache=shared \
 | |
| 		--with-openssl=shared  \
 | |
| 			--with-kerberos \
 | |
| 			--with-system-ciphers \
 | |
| 		--with-password-argon2 \
 | |
| 		--enable-pcntl=shared \
 | |
| 		--with-external-pcre \
 | |
| 			$without_pcre_jit \
 | |
| 		--enable-pdo=shared \
 | |
| 			--with-pdo-dblib=shared \
 | |
| 			--with-pdo-mysql=shared,mysqlnd \
 | |
| 			--with-pdo-odbc=shared,unixODBC,/usr \
 | |
| 			--with-pdo-pgsql=shared \
 | |
| 			--with-pdo-sqlite=shared \
 | |
| 		--with-pgsql=shared \
 | |
| 		--enable-phar=shared \
 | |
| 		--enable-posix=shared \
 | |
| 		--with-pspell=shared \
 | |
| 		--without-readline \
 | |
| 		--enable-session=shared \
 | |
| 		--enable-shmop=shared \
 | |
| 		--enable-simplexml=shared \
 | |
| 		--with-snmp=shared \
 | |
| 		--enable-soap=shared \
 | |
| 		--with-sodium=shared \
 | |
| 		--enable-sockets=shared \
 | |
| 		--with-sqlite3=shared \
 | |
| 		--enable-sysvmsg=shared \
 | |
| 		--enable-sysvsem=shared \
 | |
| 		--enable-sysvshm=shared \
 | |
| 		--with-tidy=shared \
 | |
| 		--enable-tokenizer=shared \
 | |
| 		--with-unixODBC=shared,/usr \
 | |
| 		--enable-xml=shared \
 | |
| 		--enable-xmlreader=shared \
 | |
| 		--with-xmlrpc=shared \
 | |
| 		--enable-xmlwriter=shared \
 | |
| 		--with-xsl=shared \
 | |
| 		--with-zip=shared \
 | |
| 		--with-zlib \
 | |
| 		"$@"
 | |
| 	make
 | |
| }
 | |
| 
 | |
| build() {
 | |
| 	# apache2 SAPIs because not fixed https://bugs.php.net/bug.php?id=52419
 | |
| 	_build --disable-phpdbg \
 | |
| 		--disable-cli \
 | |
| 		--with-apxs2
 | |
| 	mv libs/libphp$_suffix.so sapi/apache2handler/mod_php$_suffix.so
 | |
| 
 | |
| 	local enable_litespeed
 | |
| 	[ -z ${subpackages##*-litespeed*} ] && enable_litespeed=--enable-litespeed
 | |
| 	# cgi, cli, fpm, embed, pear, litespeed
 | |
| 	_build --enable-phpdbg \
 | |
| 		--enable-phpdbg-webhelper \
 | |
| 		--with-pear=/usr/share/$pkgname \
 | |
| 		--enable-fpm \
 | |
| 		$enable_litespeed \
 | |
| 		--enable-embed
 | |
| }
 | |
| 
 | |
| check() {
 | |
| 	# PHP is so stupid that it's not able to resolve dependencies
 | |
| 	# between extensions and load them in correct order, so we must
 | |
| 	# help it...
 | |
| 	# opcache is Zend extension, it's handled specially in Makefile
 | |
| 	local php_modules=$(_extensions_by_load_order \
 | |
| 		| grep -vx opcache \
 | |
| 		| xargs -n 1 printf "'$builddir/modules/%s.la' ")
 | |
| 	sed -i "/^PHP_TEST_SHARED_EXTENSIONS/,/extension=/ \
 | |
| 		s|in \$(PHP_MODULES)\"*|in $php_modules|" Makefile
 | |
| 
 | |
| 	# XXX: Few tests fail on the named platforms.
 | |
| 	# Ignore it for now and continue build even on test failures.
 | |
| 	local allow_fail='no'
 | |
| 	case "$CARCH" in
 | |
| 		x86 | s390x) allow_fail='yes'
 | |
| 	esac
 | |
| 
 | |
| 	TESTS="${TESTS:- --show-diff}" NO_INTERACTION=1 REPORT_EXIT_STATUS=1 \
 | |
| 		SKIP_SLOW_TESTS=1 SKIP_ONLINE_TESTS=1 TEST_TIMEOUT=10 \
 | |
| 		TZ='' LANG='' LC_ALL='' \
 | |
| 		TRAVIS=true SKIP_IO_CAPTURE_TESTS=1 \
 | |
| 		make test || [ "$allow_fail" = yes ]
 | |
| 
 | |
| 	echo 'NOTE: We have skipped quite a lot tests, see disabled-tests.list.'
 | |
| }
 | |
| 
 | |
| package() {
 | |
| 	make -j1 INSTALL_ROOT="$pkgdir" install
 | |
| 
 | |
| 	install -Dm644 php.ini-production "$pkgdir"/etc/$pkgname/php.ini
 | |
| 
 | |
| 	local file; for file in pear peardev pecl; do
 | |
| 		sed -i -e "s|/usr/bin/php|/usr/bin/php$_suffix|g" \
 | |
| 			-e "s|PHP=php|PHP=php$_suffix|" \
 | |
| 			"$pkgdir"/usr/bin/$file
 | |
| 	done
 | |
| 
 | |
| 	find "$pkgdir" -name '.*' -print0 | xargs -0 rm -rf
 | |
| 	rmdir "$pkgdir"/var/run
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s php$_suffix "$pkgdir"/usr/bin/php
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| dev() {
 | |
| 	default_dev
 | |
| 	replaces="php-dev"
 | |
| 
 | |
| 	cd "$pkgdir"
 | |
| 
 | |
| 	_mv usr/bin/php-config$_suffix \
 | |
| 		usr/bin/phpize$_suffix \
 | |
| 		"$subpkgdir"/usr/bin/
 | |
| 
 | |
| 	_mv ./$_libdir/build "$subpkgdir"/$_libdir/
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s phpize$_suffix "$subpkgdir"/usr/bin/phpize
 | |
| 		ln -s php-config$_suffix "$subpkgdir"/usr/bin/php-config
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| doc() {
 | |
| 	default_doc
 | |
| 
 | |
| 	cd "$builddir"
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
 | |
| 	cp CODING_STANDARDS.md EXTENSIONS LICENSE NEWS \
 | |
| 		README* UPGRADING* \
 | |
| 		"$subpkgdir"/usr/share/doc/$pkgname/
 | |
| }
 | |
| 
 | |
| apache2() {
 | |
| 	pkgdesc="PHP$_suffix Module for Apache2"
 | |
| 	depends="$depends apache2"
 | |
| 	provides="php-apache2"
 | |
| 
 | |
| 	install -D -m 755 "$builddir"/sapi/apache2handler/mod_php$_suffix.so \
 | |
| 		"$subpkgdir"/usr/lib/apache2/mod_php$_suffix.so
 | |
| 
 | |
| 	install -D -m 644 "$srcdir"/php$_suffix-module.conf \
 | |
| 		"$subpkgdir"/etc/apache2/conf.d/php$_suffix-module.conf
 | |
| }
 | |
| 
 | |
| phpdbg() {
 | |
| 	pkgdesc="Interactive PHP$_suffix debugger"
 | |
| 	provides="php-phpdbg"
 | |
| 
 | |
| 	amove usr/bin/phpdbg$_suffix
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s phpdbg$_suffix "$subpkgdir"/usr/bin/phpdbg
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| embed() {
 | |
| 	pkgdesc="PHP$_suffix Embedded Library"
 | |
| 	provides="php-embed"
 | |
| 
 | |
| 	_mv "$pkgdir"/usr/lib/libphp*.so "$subpkgdir"/usr/lib/
 | |
| }
 | |
| 
 | |
| litespeed() {
 | |
| 	pkgdesc="PHP$_suffix LiteSpeed SAPI"
 | |
| 	provides="php-lightspeed"
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/usr/bin
 | |
| 	mv "$pkgdir"/usr/bin/lsphp$_suffix "$subpkgdir"/usr/bin
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s lsphp$_suffix "$subpkgdir"/usr/bin/lsphp
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| cgi() {
 | |
| 	pkgdesc="PHP$_suffix Common Gateway Interface"
 | |
| 	provides="php-cgi"
 | |
| 
 | |
| 	_mv "$pkgdir"/usr/bin/php-cgi$_suffix "$subpkgdir"/usr/bin/
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s php-cgi$_suffix "$subpkgdir"/usr/bin/php-cgi
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| fpm() {
 | |
| 	pkgdesc="PHP$_suffix FastCGI Process Manager"
 | |
| 	provides="php-fpm"
 | |
| 
 | |
| 	cd "$pkgdir"
 | |
| 
 | |
| 	_mv var "$subpkgdir"/
 | |
| 	_mv usr/share/$pkgname/fpm "$subpkgdir"/var/lib/$pkgname/
 | |
| 	_mv usr/sbin "$subpkgdir"/usr/
 | |
| 	_mv etc/$pkgname/php-fpm* "$subpkgdir"/etc/$pkgname/
 | |
| 
 | |
| 	local file; for file in php-fpm.conf php-fpm.d/www.conf; do
 | |
| 		mv "$subpkgdir"/etc/$pkgname/$file.default \
 | |
| 			"$subpkgdir"/etc/$pkgname/$file
 | |
| 	done
 | |
| 
 | |
| 	install -D -m 755 "$srcdir"/$pkgname-fpm.initd \
 | |
| 		"$subpkgdir"/etc/init.d/php-fpm$_suffix
 | |
| 
 | |
| 	install -D -m 644 "$srcdir"/$pkgname-fpm.logrotate \
 | |
| 		"$subpkgdir"/etc/logrotate.d/php-fpm$_suffix
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/var/log/$pkgname
 | |
| }
 | |
| 
 | |
| pear() {
 | |
| 	pkgdesc="PHP$_suffix Extension and Application Repository"
 | |
| 	depends="$pkgname $pkgname-xml"
 | |
| 	provides="php-pear"
 | |
| 
 | |
| 	cd "$pkgdir"
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/usr/bin
 | |
| 	local file; for file in pecl pear peardev; do
 | |
| 		mv usr/bin/$file "$subpkgdir"/usr/bin/$file$_suffix
 | |
| 		if [ "$_default_php" = yes ]; then
 | |
| 			ln -s $file$_suffix "$subpkgdir"/usr/bin/$file
 | |
| 		fi
 | |
| 	done
 | |
| 
 | |
| 	_mv etc/$pkgname/pear.conf "$subpkgdir"/etc/$pkgname/
 | |
| 	_mv usr/share "$subpkgdir"/usr/
 | |
| }
 | |
| 
 | |
| common() {
 | |
| 	pkgdesc="$pkgdesc (common config)"
 | |
| 	provides="php-common $pkgname-zlib php-zlib"  # for backward compatibility
 | |
| 	depends=""
 | |
| 
 | |
| 	cd "$pkgdir"
 | |
| 
 | |
| 	_mv usr/lib "$subpkgdir"/usr/
 | |
| 	_mv etc "$subpkgdir"/
 | |
| 	mkdir -p "$subpkgdir"/$_extension_confd
 | |
| }
 | |
| 
 | |
| phar() {
 | |
| 	_extension
 | |
| 
 | |
| 	cd "$pkgdir"
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/usr/bin
 | |
| 	rm usr/bin/phar$_suffix
 | |
| 	mv usr/bin/phar$_suffix.phar "$subpkgdir"/usr/bin/phar$_suffix.phar
 | |
| 	ln -s phar$_suffix.phar "$subpkgdir"/usr/bin/phar$_suffix
 | |
| 	ln -s phar$_suffix.phar "$subpkgdir"/usr/bin/phar.phar$_suffix
 | |
| 
 | |
| 	if [ "$_default_php" = yes ]; then
 | |
| 		ln -s phar$_suffix.phar "$subpkgdir"/usr/bin/phar.phar
 | |
| 		ln -s phar$_suffix.phar "$subpkgdir"/usr/bin/phar
 | |
| 	fi
 | |
| }
 | |
| 
 | |
| _extension() {
 | |
| 	local extname="${subpkgname#$pkgname-}"
 | |
| 	local extdepends="$(eval "echo \$_depends_$extname")"
 | |
| 	local extdesc="$(head -n1 "$builddir"/ext/$extname/CREDITS 2>/dev/null ||:)"
 | |
| 	pkgdesc="PHP$_suffix extension: ${extdesc:-$extname}"
 | |
| 	provides="php-$extname"
 | |
| 
 | |
| 	: ${extdepends:=$(_resolve_extension_deps "$extname")}
 | |
| 	depends="$depends $extdepends"
 | |
| 
 | |
| 	local load_order=$(_extension_load_order "$extname")
 | |
| 
 | |
| 	# extension prefix
 | |
| 	local prefix=
 | |
| 	[ "$extname" != "opcache" ] || prefix="zend_"
 | |
| 
 | |
| 	_mv "$pkgdir"/$_extension_dir/$extname.so \
 | |
| 		"$subpkgdir"/$_extension_dir/
 | |
| 
 | |
| 	mkdir -p "$subpkgdir"/$_extension_confd
 | |
| 	echo "${prefix}extension=$extname.so" \
 | |
| 		> "$subpkgdir"/$_extension_confd/"$(printf %02d $load_order)"_$extname.ini
 | |
| }
 | |
| 
 | |
| # Resolves dependencies of the given extension name (without $pkgname- prefix)
 | |
| # on other extensions in $_extensions and prints them with $pkgname- prefix.
 | |
| _resolve_extension_deps() {
 | |
| 	local name="$1"
 | |
| 
 | |
| 	# We use config.w32 just because it's more accurate than config.m4.
 | |
| 	local config="$builddir/ext/$name/config.w32"
 | |
| 	[ -f "$config" ] || return 0
 | |
| 
 | |
| 	cat "$config" \
 | |
| 		| sed -En "s/.*ADD_EXTENSION_DEP\('$name', ([^)]+)\).*/\1/p" \
 | |
| 		| tr -d "'," | tr ' ' '\n' \
 | |
| 		| sort -u \
 | |
| 		| while read -r dep; do
 | |
| 			if echo "$_extensions" | grep -qw "$dep"; then
 | |
| 				echo "$pkgname-$dep"
 | |
| 			fi
 | |
| 		done
 | |
| }
 | |
| 
 | |
| # Prints a load order (0-based integer) for the given extension name. Extension
 | |
| # with lower load order should be loaded before exts with higher load order.
 | |
| # It's based on number of dependencies of the extension (with exception for
 | |
| # "imap"), which is flawed, but simple and good enough for now.
 | |
| _extension_load_order() {
 | |
| 	local name="$1"
 | |
| 	local deps=$(eval "echo \$_depends_$name")
 | |
| 
 | |
| 	case "$name" in
 | |
| 		# XXX: This must be loaded after recode, even though it does
 | |
| 		# not depend on it. So we must use this hack...
 | |
| 		*) echo "${deps:=$(_resolve_extension_deps $name)}" | wc -w;;
 | |
| 	esac
 | |
| }
 | |
| 
 | |
| # Prints $_extensions sorted by load order and name.
 | |
| _extensions_by_load_order() {
 | |
| 	local deps list name
 | |
| 
 | |
| 	for name in $_extensions; do
 | |
| 		list="$list $(_extension_load_order $name);$name"
 | |
| 	done
 | |
| 	printf '%s\n' $list | sort -t ';' -k 1 | sed -E 's/\d+;//'
 | |
| }
 | |
| 
 | |
| _mv() {
 | |
| 	local dest; for dest; do true; done  # get last argument
 | |
| 	mkdir -p "$dest"
 | |
| 	mv "$@"
 | |
| }
 | |
| 
 | |
| sha512sums="
 | |
| 499b63b99e5d8e8082ff89d3a91b4cb9a593ea7553b96e48863414c13d2e50275904ed29070e2232e529ee91160f505e6060a4d129cb5bf098aa5b6ea0928d3d  php-7.4.33.tar.xz
 | |
| 1c708de82d1086f272f484faf6cf6d087af7c31750cc2550b0b94ed723961b363f28a947b015b2dfc0765caea185a75f5d2c2f2b099c948b65c290924f606e4f  php7-fpm.initd
 | |
| cacce7bf789467ff40647b7319e3760c6c587218720538516e8d400baa75651f72165c4e28056cd0c1dc89efecb4d00d0d7823bed80b29136262c825ce816691  php7-fpm.logrotate
 | |
| 274bd7b0b2b7002fa84c779640af37b59258bb37b05cb7dd5c89452977d71807f628d91b523b5039608376d1f760f3425d165242ca75ee5129b2730e71c4e198  php7-module.conf
 | |
| 830ec2d0ab920604072eb3751e36783dfc2abf72caa70a7a7a1dd4de739a38003f1747524c28b8d0b0dc08825823b1d26587e58093c4088b19f0746808b2604c  disabled-tests.list
 | |
| a4130d29c7fee2b8cb561b116baf603bdc3a7b5b4985ec3c9918f253d1851197539dfad72c6b36d9f7008f85982904731184c79e4cee4415c1a1b88016639225  install-pear.patch
 | |
| ebf571c5e595221b9944d7e840807ebb68c1be38bf117186e19a3bd1070310ece5918bcaa5f941679f3371a2108ad57bf179c3f90e612a5a2b982db941172859  includedir.patch
 | |
| 965b52893affb666af64e00d09e0208dcd41b17ce2864cf05616c6d05a05c0121694c0b209d403b8c0c55d18e6f1528c4aba1a4fcdce7b282a13304d12cd0f9d  sharedir.patch
 | |
| 16399fbf6a966f9beffe00f659f9551ef8e52285bca116da5bd5b15ec99a2b0bd5fa03be0faa6c893802aa44c100d634083343a9ac0cd2467812865df66dd572  php7-fpm-version-suffix.patch
 | |
| 3bfeea79f9acfaa7be5bab85cd3d02713abb569e54024a22bb2c747c06d97f83ac2c63dcd75c7c409426ac03f8bc2ccc01bcd66bc39a767930d32542349123f9  fix-tests-devserver.patch
 | |
| 7c8c3cac9efce81d525cb5a70e1402e393881b83ef4c7b5d39d3565803d21cd283daf3d74e9a8b059ecac66cf339756acc63608ffcb83d960dba86583bd45108  enchant-2.patch
 | |
| 996b9a542858b0385a300265194afc57eddb72b9d7e4dcdf63b4f1ba7d3588e67309030acc73f00af1717168becd50b1d3582fcb88605e9892fd683a33cae023  xfail-openssl-1.1-test.patch
 | |
| 465b38c089d938a4a072b2eff3edaf928455bf873f5eeb65ff3bee9614f5f45c70f285abb50809c2e2d9d259395acae38bd649860ca3b8d65e43447082a51552  atomic-lsapi.patch
 | |
| be6a57063414bd255def54d5f6e42cbdc3baec55c8eaf9c8ca6e96d0cb3fec942ebb1868806850859d34c5c45d03a2abfec3fecd1aef04524da8eda01d9041ed  fix-curl-7.83-test.patch
 | |
| 6520df6c5339d29aded942c89b0d0424a521d6b4248526b0f63f54194be05992e49b46688615d032c28ce57f484b6defc085da33239d460f67f88dc10c7a4fba  openssl3.patch
 | |
| 0ec10fa60a8aac63791ee8315641d6063230c15dd44d6b48416736e414886e33350535c7eb61b4d256cef22e32f7a02eaba07e314e592cdb19c55dbfa097dbaf  fix-icu72.patch
 | |
| 8dd578f264edaf372a6e787d65e2f8d45ea1af88036cc0d62251b6796aef327b8bd0a4df90eecdbd9e8a8c0e7501f90813a3af745e262151b7f7fe995c7a8c1b  CVE-2023-0567-1.patch
 | |
| 35c9c4bdc8b4091d68ad65732c016dd33a0e3e92b3669dfbda7a107ca7c22d72955fecd73add0338873faf8344721838d72c0aa637fefdb6cdae7a1d310d570b  CVE-2023-0567-2.patch
 | |
| 5fe3a0e9e1cf2e069d3b97c74a12d6f1c05faf694be7527a40a358afc1ee2dd6004f6ce0027c483eda7f6e835dc384258760b098c03d2af04950b58ac0e83cc8  CVE-2023-0568.patch
 | |
| f7e87369658e333247896cb3cc6d56a54e2041453c0dc78180d7d31ac5008f98837039c215beda24e12b78ac183d70b7488e3d2978b159e565fc6517ed023cb1  CVE-2023-0662-1.patch
 | |
| 22c8f8b31b76832a0ccd45e0df808ba07e2cab67c7e6ca94d5cc124ad185fd0494a11ed1573b4ac03094c21979de40ecb4ee76cf8e63cd27f716aff189e9b28d  CVE-2023-0662-2.patch
 | |
| 81fe1bc37129c8902c572d63f9c4c266cabf61c1217d8b079b020dd60ad49e725426dc201b4c0d044d8a6793b15a2a58eac6595ceb1f8a91aa9b2ea9728adfd6  fix-fpm-tests.patch
 | |
| 5582cbf13dcc9c536c6a9881183fedd40d35497c527e20e9e8e3288ce6219d9218dd16d9f43cc4412fd471b84df786076141f8409f950578b50d1540244f29f2  fix-fpm-syntax.patch
 | |
| "
 |