PKGBUILDs/extra/php-legacy/PKGBUILD

360 lines
11 KiB
Bash
Raw Normal View History

2023-01-14 19:37:24 +00:00
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 to CPPFLAGS
pkgbase=php-legacy
pkgname=('php-legacy'
'php-legacy-cgi'
'php-legacy-apache'
'php-legacy-fpm'
'php-legacy-embed'
'php-legacy-phpdbg'
'php-legacy-dblib'
'php-legacy-enchant'
'php-legacy-gd'
'php-legacy-sodium'
'php-legacy-odbc'
'php-legacy-pgsql'
'php-legacy-pspell'
'php-legacy-snmp'
'php-legacy-sqlite'
'php-legacy-tidy'
'php-legacy-xsl')
2024-06-04 23:57:59 +00:00
pkgver=8.2.20
2024-06-07 22:46:00 +00:00
pkgrel=2
2023-01-14 19:37:24 +00:00
arch=('x86_64')
2024-03-03 22:12:31 +00:00
license=('PHP-3.01')
2023-01-14 19:37:24 +00:00
url='https://www.php.net/'
makedepends=('apache' 'aspell' 'gdbm' 'enchant' 'gd' 'gmp' 'icu' 'libsodium' 'libxslt' 'libzip' 'net-snmp'
'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre2' 'libnsl'
2023-01-16 19:46:01 +00:00
'oniguruma' 'patchelf')
2023-01-14 19:37:24 +00:00
checkdepends=('procps-ng')
2023-11-24 01:00:25 +00:00
source=("https://php.net/distributions/php-${pkgver}.tar.xz"{,.asc}
2024-06-07 22:46:00 +00:00
'apache.conf' 'php-fpm.tmpfiles' 'apache.patch' 'php-fpm.patch' 'php.ini.patch' 'php-legacy.patch'
'https://github.com/php/php-src/commit/ee7d35cc4d234a2324e05d9eb0cc87e9fba2ae38.patch')
2023-11-24 01:00:25 +00:00
2024-06-04 23:57:59 +00:00
sha256sums=('4474cc430febef6de7be958f2c37253e5524d5c5331a7e1765cd2d2234881e50'
2023-01-14 19:37:24 +00:00
'SKIP'
'2173046ac22ac50c7a6721306d3f79b2086f66a7a6ff5d8af249a474763197a1'
'f3236ca866095d5e42e51e3fa600082ccd0afcfb7f1aecbeb286ef9d4f0dd564'
2023-01-16 19:46:01 +00:00
'702b163c66c65af92dcad8d79f41bda84bcd5d863235fcf1497c33a86db9e4ca'
2024-03-03 22:12:31 +00:00
'b23547fb1fcdd47a1dab1082c921485c7306af23734c66c7203d33a1d0cfaf41'
'770eb5232d24749f8399bf649998bb3adda51b49985c61db66f3af82f9d81805'
2024-06-07 22:46:00 +00:00
'a1859005c9fad835079470e6fb3c0721b9bd024c8f3ae1f34cb082ec41c63194'
'2be71fec71124e629d7b23143e30d97a7ff823f2f3f14f09d71edf6d273cc076')
2024-03-03 22:12:31 +00:00
validpgpkeys=('1198C0117593497A5EC5C199286AF1F9897469DC'
2023-06-10 13:17:32 +00:00
'39B641343D8C104B2B146DC3F9C39DC0B9698544'
2024-03-03 22:12:31 +00:00
'E60913E4DF209907D8E30D96659A97C9CF2A795A')
2023-01-14 19:37:24 +00:00
_interpreter=${pkgver%.*}
prepare() {
cd "${srcdir}/php-${pkgver}"
patch -p0 -i "${srcdir}/apache.patch"
patch -p0 -i "${srcdir}/php-fpm.patch"
patch -p0 -i "${srcdir}/php.ini.patch"
patch -p0 -i "${srcdir}/php-legacy.patch"
2024-06-07 22:46:00 +00:00
# Fix https://gitlab.archlinux.org/archlinux/packaging/packages/php-legacy/-/issues/3
patch -p1 -i "${srcdir}/ee7d35cc4d234a2324e05d9eb0cc87e9fba2ae38.patch"
2023-01-14 19:37:24 +00:00
autoconf
# Disable failing tests
rm tests/output/stream_isatty_*.phpt
rm Zend/tests/arginfo_zpp_mismatch*.phpt
}
build() {
CPPFLAGS+=' -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
local _phpconfig="--srcdir=../php-${pkgver} \
--config-cache \
--prefix=/usr \
--sbindir=/usr/bin \
--sysconfdir=/etc/php-legacy \
--localstatedir=/var \
--with-layout=GNU \
--with-config-file-path=/etc/php-legacy \
--with-config-file-scan-dir=/etc/php-legacy/conf.d \
--disable-rpath \
--mandir=/usr/share/man \
--libdir=/usr/lib/php-legacy \
--datarootdir=/usr/share/php-legacy \
--datadir=/usr/share/php-legacy \
--program-suffix=-legacy \
--includedir=/usr/include/php-legacy \
--disable-gcc-global-regs \
"
local _phpextensions="\
--enable-bcmath=shared \
--enable-calendar=shared \
--enable-dba=shared \
--enable-exif=shared \
--enable-ftp=shared \
--enable-gd=shared \
--enable-intl=shared \
--enable-mbstring \
--enable-pcntl \
--enable-shmop=shared \
--enable-soap=shared \
--enable-sockets=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--with-bz2=shared \
--with-curl=shared \
--with-enchant=shared \
--with-external-gd \
--with-external-pcre \
--with-ffi=shared \
--with-gdbm \
--with-gettext=shared \
--with-gmp=shared \
--with-iconv=shared \
--with-kerberos \
--with-ldap=shared \
--with-ldap-sasl \
--with-mhash \
--with-mysql-sock=/run/mysqld/mysqld.sock \
2024-03-03 22:12:31 +00:00
--with-mysqli=shared \
2023-01-14 19:37:24 +00:00
--with-openssl \
--with-password-argon2 \
--with-pdo-dblib=shared,/usr \
2024-03-03 22:12:31 +00:00
--with-pdo-mysql=shared \
2023-01-14 19:37:24 +00:00
--with-pdo-odbc=shared,unixODBC,/usr \
--with-pdo-pgsql=shared \
--with-pdo-sqlite=shared \
--with-pgsql=shared \
--with-pspell=shared \
--with-readline \
--with-snmp=shared \
--with-sodium=shared \
--with-sqlite3=shared \
--with-tidy=shared \
--with-unixODBC=shared \
--with-xsl=shared \
--with-zip=shared \
--with-zlib \
"
EXTENSION_DIR=/usr/lib/php-legacy/modules
export EXTENSION_DIR
mkdir "${srcdir}/build"
cd "${srcdir}/build"
ln -s "../php-${pkgver}/configure"
./configure ${_phpconfig} \
--enable-cgi \
--enable-fpm \
--with-fpm-systemd \
--with-fpm-acl \
--with-fpm-user=http \
--with-fpm-group=http \
--enable-embed=shared \
${_phpextensions}
make
# apache
# reuse the previous run; this will save us a lot of time
cp -a "${srcdir}/build" "${srcdir}/build-apache"
cd "${srcdir}/build-apache"
./configure ${_phpconfig} \
--with-apxs2 \
${_phpextensions}
make
# phpdbg
cp -a "${srcdir}/build" "${srcdir}/build-phpdbg"
cd "${srcdir}/build-phpdbg"
./configure ${_phpconfig} \
--enable-phpdbg \
${_phpextensions}
make
}
check() {
cd "${srcdir}/build"
# Check if sendmail was configured correctly (FS#47600)
sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
export REPORT_EXIT_STATUS=1
export NO_INTERACTION=1
export SKIP_ONLINE_TESTS=1
export SKIP_SLOW_TESTS=1
export TEST_PHP_ARGS="-j$(nproc)"
export TESTS='tests Zend'
make test
}
package_php-legacy() {
pkgdesc='A general-purpose scripting language that is especially suited to web development'
depends=('libxml2' 'curl' 'libzip' 'pcre2' 'argon2' 'oniguruma' 'gdbm')
provides=("php-interpreter=${_interpreter}" "php-legacy-intl=${pkgver}")
replaces=('php-legacy-intl')
conflicts=('php-legacy-intl')
backup=('etc/php-legacy/php.ini')
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-{modules,cli,build,headers,programs,pharcmd}
install -D -m644 "${srcdir}/php-${pkgver}/php.ini-production" "${pkgdir}/etc/php-legacy/php.ini"
install -d -m755 "${pkgdir}/etc/php-legacy/conf.d/"
# remove static modules
rm -f "${pkgdir}/usr/lib/php-legacy/modules/"*.a
# remove modules provided by sub packages
rm -f "${pkgdir}/usr/lib/php-legacy/modules/"{enchant,gd,sodium,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
# remove empty directory
rmdir "${pkgdir}/usr/include/php-legacy/php/include"
}
package_php-legacy-cgi() {
pkgdesc='CGI and FCGI SAPI for PHP'
depends=('php-legacy')
2023-04-03 02:50:50 +00:00
provides=("php-cgi-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-cgi
}
package_php-legacy-apache() {
pkgdesc='Apache SAPI for PHP'
2024-03-03 22:12:31 +00:00
depends=('php-legacy' 'apache')
2023-01-14 19:37:24 +00:00
backup=('etc/httpd/conf/extra/php-legacy_module.conf')
2023-04-03 02:50:50 +00:00
provides=("php-apache-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build-apache/libs/libphp.so" "${pkgdir}/usr/lib/httpd/modules/libphp-legacy.so"
2023-01-16 19:46:01 +00:00
patchelf --set-soname "libphp-legacy.so" "${pkgdir}/usr/lib/httpd/modules/libphp-legacy.so"
2023-01-14 19:37:24 +00:00
install -D -m644 "${srcdir}/apache.conf" "${pkgdir}/etc/httpd/conf/extra/php-legacy_module.conf"
}
package_php-legacy-fpm() {
pkgdesc='FastCGI Process Manager for PHP'
depends=('php-legacy' 'systemd')
backup=('etc/php-legacy/php-fpm.conf' 'etc/php-legacy/php-fpm.d/www.conf')
2023-04-03 02:50:50 +00:00
provides=("php-fpm-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
options=('!emptydirs')
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" install-fpm
2023-01-30 00:59:39 +00:00
install -D -m644 sapi/fpm/php-fpm.service "${pkgdir}/usr/lib/systemd/system/php-fpm-legacy.service"
ln -rs "${pkgdir}/usr/lib/systemd/system/php-fpm-legacy.service" "${pkgdir}/usr/lib/systemd/system/php-legacy-fpm.service"
install -D -m644 "${srcdir}/php-fpm.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/php-fpm-legacy.conf"
2023-01-14 19:37:24 +00:00
}
package_php-legacy-embed() {
pkgdesc='Embedded PHP SAPI library'
2024-03-03 22:12:31 +00:00
depends=('php-legacy' 'systemd-libs')
2023-04-03 02:50:50 +00:00
provides=("php-embed-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
options=('!emptydirs')
cd "${srcdir}/build"
make -j1 INSTALL_ROOT="${pkgdir}" PHP_SAPI=embed install-sapi
mv "${pkgdir}/usr/lib/libphp.so" "${pkgdir}/usr/lib/libphp-legacy.so"
2023-01-16 19:46:01 +00:00
patchelf --set-soname "libphp-legacy.so" "${pkgdir}/usr/lib/libphp-legacy.so"
2023-01-14 19:37:24 +00:00
}
package_php-legacy-phpdbg() {
pkgdesc='Interactive PHP debugger'
depends=('php-legacy')
2023-04-03 02:50:50 +00:00
provides=("php-phpdbg-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
options=('!emptydirs')
cd "${srcdir}/build-phpdbg"
make -j1 INSTALL_ROOT="${pkgdir}" install-phpdbg
}
package_php-legacy-dblib() {
pkgdesc='dblib module for PHP'
depends=('php-legacy' 'freetds')
2023-04-03 02:50:50 +00:00
provides=("php-dblib-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/pdo_dblib.so" "${pkgdir}/usr/lib/php-legacy/modules/pdo_dblib.so"
}
package_php-legacy-enchant() {
pkgdesc='enchant module for PHP'
depends=('php-legacy' 'enchant')
2023-04-03 02:50:50 +00:00
provides=("php-enchant-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/enchant.so" "${pkgdir}/usr/lib/php-legacy/modules/enchant.so"
}
package_php-legacy-gd() {
pkgdesc='gd module for PHP'
depends=('php-legacy' 'gd')
2023-04-03 02:50:50 +00:00
provides=("php-gd-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/gd.so" "${pkgdir}/usr/lib/php-legacy/modules/gd.so"
}
package_php-legacy-sodium() {
pkgdesc='sodium module for PHP'
depends=('php-legacy' 'libsodium')
2023-04-03 02:50:50 +00:00
provides=("php-sodium-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/sodium.so" "${pkgdir}/usr/lib/php-legacy/modules/sodium.so"
}
package_php-legacy-odbc() {
pkgdesc='ODBC modules for PHP'
depends=('php-legacy' 'unixodbc')
2023-04-03 02:50:50 +00:00
provides=("php-odbc-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/odbc.so" "${pkgdir}/usr/lib/php-legacy/modules/odbc.so"
install -D -m755 "${srcdir}/build/modules/pdo_odbc.so" "${pkgdir}/usr/lib/php-legacy/modules/pdo_odbc.so"
}
package_php-legacy-pgsql() {
pkgdesc='PostgreSQL modules for PHP'
depends=('php-legacy' 'postgresql-libs')
2023-04-03 02:50:50 +00:00
provides=("php-pgsql-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/pgsql.so" "${pkgdir}/usr/lib/php-legacy/modules/pgsql.so"
install -D -m755 "${srcdir}/build/modules/pdo_pgsql.so" "${pkgdir}/usr/lib/php-legacy/modules/pdo_pgsql.so"
}
package_php-legacy-pspell() {
pkgdesc='pspell module for PHP'
depends=('php-legacy' 'aspell')
2023-04-03 02:50:50 +00:00
provides=("php-pspell-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/pspell.so" "${pkgdir}/usr/lib/php-legacy/modules/pspell.so"
}
package_php-legacy-snmp() {
pkgdesc='snmp module for PHP'
depends=('php-legacy' 'net-snmp')
2023-04-03 02:50:50 +00:00
provides=("php-snmp-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/snmp.so" "${pkgdir}/usr/lib/php-legacy/modules/snmp.so"
}
package_php-legacy-sqlite() {
pkgdesc='sqlite module for PHP'
depends=('php-legacy' 'sqlite')
2023-04-03 02:50:50 +00:00
provides=("php-sqlite-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/sqlite3.so" "${pkgdir}/usr/lib/php-legacy/modules/sqlite3.so"
install -D -m755 "${srcdir}/build/modules/pdo_sqlite.so" "${pkgdir}/usr/lib/php-legacy/modules/pdo_sqlite.so"
}
package_php-legacy-tidy() {
pkgdesc='tidy module for PHP'
depends=('php-legacy' 'tidy')
2023-04-03 02:50:50 +00:00
provides=("php-tidy-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/tidy.so" "${pkgdir}/usr/lib/php-legacy/modules/tidy.so"
}
package_php-legacy-xsl() {
pkgdesc='xsl module for PHP'
depends=('php-legacy' 'libxslt')
2023-04-03 02:50:50 +00:00
provides=("php-xsl-interpreter=${_interpreter}")
2023-01-14 19:37:24 +00:00
install -D -m755 "${srcdir}/build/modules/xsl.so" "${pkgdir}/usr/lib/php-legacy/modules/xsl.so"
}