File php73.spec of Package php73
#
# spec file for package php73
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define php_suffix 73
%define php_user wwwrun
%define php_group www
%define extension_dir %{_libdir}/%{name}/extensions
%define php_sysconf %{_sysconfdir}/%{name}
Name: php%{php_suffix}
Version: 7.3.33
Release: 0
Summary: Interpreter for the PHP scripting language version %{version}
License: PHP-3.01
Group: Development/Languages/Other
URL: https://www.php.net
Source0: https://www.php.net/distributions/php-%{version}.tar.xz
Source1: php-suse-addons.tar.bz2
Source2: php-fpm.service
## SUSE specific patches
Patch0: php-includedir.patch
Patch1: php-icu70.patch
Patch2: php-ini.patch
Patch3: php-fpm-conf.patch
Patch4: php-no-build-date.patch
Patch5: php-pts.patch
Patch6: php-openssl.patch
Patch7: php-systzdata-v18.patch
Patch8: php-systemd-unit.patch
Patch9: php-filter.patch
Patch10: php-embed.patch
Patch12: php-crypt-tests.patch
## Bugfix patches
Patch17: php-date-regenerate-lexers.patch
Patch18: php7-gd-removed-unused-constants.patch
# CVE-2022-31631 [bsc#1206958], Due to an integer overflow PDO:quote() may return unquoted string
Patch19: php7-CVE-2022-31631.patch
# fix "error: 'usmDESPrivProtocol' undeclared"
Patch20: php7-NETSNMP_DISABLE_DES.patch
BuildRequires: autoconf
BuildRequires: bison
BuildRequires: curl
BuildRequires: curl-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: db-devel
BuildRequires: fdupes
BuildRequires: freetds-devel
BuildRequires: freetype2-devel
BuildRequires: gcc13
BuildRequires: gcc13-c++
BuildRequires: gd-devel
BuildRequires: gmp-devel
BuildRequires: gpg2
BuildRequires: krb5-devel
BuildRequires: libacl-devel
BuildRequires: libapparmor-devel
BuildRequires: libbz2-devel
BuildRequires: libedit-devel
BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
BuildRequires: libopenssl-1_1-devel
BuildRequires: libpng-devel
BuildRequires: libsodium-devel
BuildRequires: libtidy-devel
BuildRequires: libtiff-devel
BuildRequires: libtool
BuildRequires: libxslt-devel
BuildRequires: libzip-devel
BuildRequires: lmdb-devel
BuildRequires: ncurses-devel
BuildRequires: net-snmp-devel
BuildRequires: openldap2-devel
BuildRequires: pcre2-devel
BuildRequires: pkgconfig
BuildRequires: postfix
BuildRequires: postgresql-devel
BuildRequires: re2c
BuildRequires: sqlite3-devel
BuildRequires: tcpd-devel
BuildRequires: unixODBC-devel
BuildRequires: update-alternatives
BuildRequires: xz
BuildRequires: pkgconfig(enchant)
BuildRequires: pkgconfig(libargon2)
BuildRequires: pkgconfig(xpm)
BuildRequires: pkgconfig(zlib)
Requires: timezone
Requires(pre): group(%{php_group})
Requires(pre): user(%{php_user})
Recommends: %{name}-ctype
Recommends: %{name}-dom
Recommends: %{name}-iconv
Recommends: %{name}-sqlite
Recommends: %{name}-tokenizer
Recommends: %{name}-xmlreader
Recommends: %{name}-xmlwriter
Recommends: smtp_daemon
Suggests: %{name}-gd
Suggests: %{name}-gettext
Suggests: %{name}-mbstring
Suggests: %{name}-mysql
Provides: %{name}-cli = %{version}
# builtin extensions
Provides: %{name}-date = %{version}
Provides: %{name}-filter = %{version}
Provides: %{name}-hash = %{version}
Provides: %{name}-json = %{version}
Provides: %{name}-pcre = %{version}
Provides: %{name}-reflection = %{version}
Provides: %{name}-session = %{version}
Provides: %{name}-simplexml = %{version}
Provides: %{name}-spl = %{version}
Provides: %{name}-xml = %{version}
%description
PHP is a server-side HTML embedded scripting language designed
primarily for web development but also used as a general-purpose
programming language.
This package contains the standard implementation of PHP, namely Zend
PHP. Included are the PHP command-line binary and the configuration
file (php.ini). This package must be installed in order to use PHP.
Additionally, extension modules and server modules may be installed.
%package devel
Summary: PHP development files for C/C++ extensions
# this is required by the installed development headers
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: autoconf
Requires: automake
Requires: glibc-devel
Requires: libtool
Requires: libxml2-devel
Requires: pcre2-devel
BuildArch: noarch
%description devel
PHP is a server-side HTML embedded scripting language designed
primarily for web development but also used as a general-purpose
programming language.
This package contains the C headers to build PHP extensions.
%package fastcgi
Summary: FastCGI PHP Module
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-cli = %{version}
Provides: %{name}-cgi = %{version}
Provides: %{name}-date = %{version}
Provides: %{name}-filter = %{version}
Provides: %{name}-pcre = %{version}
Provides: %{name}-reflection = %{version}
Provides: %{name}-session = %{version}
Provides: %{name}-simplexml = %{version}
Provides: %{name}-spl = %{version}
Provides: %{name}-xml = %{version}
%description fastcgi
PHP is a server-side, cross-platform HTML embedded scripting language.
If you are completely new to PHP and want to get some idea of how it
works, have a look at the Introductory tutorial. Once you get beyond
that have a look at the example archive sites and some of the other
resources available in the links section.
Please refer to %{_docdir}/%{name}/README.FastCGI for
information on how to use this module.
%package fpm
Summary: FastCGI Process Manager PHP Module
Group: Development/Libraries/PHP
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libsystemd)
Requires: %{name} = %{version}
Requires: %{name}-cli = %{version}
Provides: %{name}-date = %{version}
Provides: %{name}-filter = %{version}
Provides: %{name}-pcre = %{version}
Provides: %{name}-reflection = %{version}
Provides: %{name}-session = %{version}
Provides: %{name}-simplexml = %{version}
Provides: %{name}-spl = %{version}
Provides: %{name}-xml = %{version}
%systemd_requires
%description fpm
PHP is a server-side, cross-platform HTML embedded scripting language.
If you are completely new to PHP and want to get some idea of how it
works, have a look at the Introductory tutorial. Once you get beyond
that have a look at the example archive sites and some of the other
resources available in the links section.
Please refer to %{_docdir}/%{name}/README.FastCGI for
information on how to use this module.
%package bcmath
Summary: "Binary Calculator" extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description bcmath
Binary Calculator which supports numbers of any size and precision,
represented as strings.
%package bz2
Summary: Bzip2 codec support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description bz2
PHP functions to read and write bzip2 (.bz2) compressed files.
%package calendar
Summary: PHP Extension Module
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description calendar
PHP functions for converting between different calendar formats.
%package ctype
Summary: Character class extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description ctype
PHP functions for checking whether a character or string falls into a
certain character class according to the current locale.
%package curl
Summary: Libcurl integration for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description curl
PHP interface to libcurl that allows you to connect to and communicate
with servers of many different types, using protocols of many different
types.
%package dba
Summary: Database abstraction layer for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description dba
This is a general abstraction layer for several file-based databases.
As such, functionality is limited to a common subset of features
supported by modern databases such as Sleepycat Software's DB2. (This
is not to be confused with IBM's DB2 software, which is supported
through the ODBC functions.)
%package dom
Summary: Document Object Model extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description dom
This module adds Document Object Model (DOM) support.
%package enchant
Summary: Spell checking extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description enchant
Enchant is the PHP binding for the Enchant library. Enchant steps in
to provide uniformity and conformity on top of all spelling
libraries, and implements certain features that may be lacking in any
individual provider library. Everything should "just work" for any
and every definition of "just working."
%package exif
Summary: EXIF metadata extensions for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-mbstring = %{version}
%description exif
PHP functions for extracting EXIF (Exchangable Image File Format;
metadata from images) information stored in headers of JPEG and TIFF
images.
%package fileinfo
Summary: File identification extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description fileinfo
The functions in this module try to guess the content type and
encoding of a file by looking for certain magic byte sequences at
specific positions within the file. It uses (a bundled version of)
libmagic to heuristically determine this.
%package ftp
Summary: FTP protocol support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-openssl = %{version}
%description ftp
PHP functions for access to file servers speaking the File Transfer
Protocol (FTP) as defined in RFC 959.
%package gd
Summary: GD Graphics Library extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description gd
PHP functions to create and manipulate image files in a variety of
different image formats, including GIF, PNG, JPEG, WBMP, and XPM. Even
more convenient: PHP can output image streams directly to a browser.
%package gettext
Summary: Native language support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description gettext
PHP functions that implement a Native Language Support (NLS) API which
can be used to internationalize your PHP applications.
%package gmp
Summary: Bignum extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description gmp
PHP functions for work with arbitrary-length integers using the GNU MP
library.
%package iconv
Summary: Character set conversion functions for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description iconv
This module contains an interface to iconv character set conversion
facility. With this module, a string represented by a local character
set can be turned into another character set, which may be the
Unicode character set. Supported character sets depend on the iconv
implementation of your system.
%package intl
Summary: ICU integration for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description intl
The internationalization (intl) extension is a wrapper for the ICU
library, enabling PHP programmers to perform UCA (Unicode Collation
Algorithm) conformant collation as well as date, time, number and
currency formatting in their scripts.
%package ldap
Summary: LDAP protocol support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-openssl = %{version}
%description ldap
PHP interface to the Lightweight Directory Access Protocol (LDAP).
%package mbstring
Summary: Multibyte string functions for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description mbstring
mbstring provides multibyte specific string functions that help
dealing with multibyte encodings in PHP. mbstring handles character
encoding conversion between the possible encoding pairs. mbstring
handles Unicode-based encodings such as UTF-8 and UCS-2 and many
single-byte encodings for convenience.
%package mysql
Summary: MySQL database client for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-pdo = %{version}
Provides: %{name}_any_db = %{version}
%description mysql
PHP functions for access to MySQL database servers.
%package odbc
Summary: ODBC extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-pdo = %{version}
Provides: %{name}-pdo_odbc = %{version}
%description odbc
This module adds Open Database Connectivity (ODBC) support.
%package opcache
Summary: Opcode cache extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description opcache
OPcache improves PHP performance by storing precompiled script
bytecode in shared memory, thereby removing the need for PHP to load
and parse scripts on each request.
%package openssl
Summary: OpenSSL integration for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description openssl
This extension binds functions of OpenSSL library for symmetric and
asymmetric encryption and decryption, PBKDF2, PKCS#7, PKCS#12, X.509
and other crypto operations. It also provides an implementation of
TLS streams.
%package pcntl
Summary: Process Control extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description pcntl
Process Control support in PHP implements the Unix style of process
creation, program execution, signal handling and process termination
(fork, waitpid, signal, WIF flags, etc.)
%package phar
Summary: PHP Archive extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description phar
The phar extension provides a way to put entire PHP applications into
a single file called a "phar" (PHP Archive) for distribution and
installation.
In addition, the phar extension also provides a file-format
abstraction method for creating and manipulating tar and zip files
through the PharData class, much as PDO provides a unified interface
for accessing different databases. Phar also can convert between tar,
zip and phar file formats.
%package pdo
Summary: PHP Data Objects extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description pdo
The PHP Data Objects (PDO) extension defines an interface for
accessing databases in PHP. Each database driver that implements the
PDO interface can expose database-specific features as regular
extension functions. Note that you use a database-specific PDO driver
to access a database server.
PDO provides a data-access abstraction layer, which means that,
regardless of the database used, you use the same functions to issue
queries and fetch data. PDO does not provide a database abstraction;
it does not rewrite SQL or emulate missing features.
%package pgsql
Summary: PostgreSQL database client for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-pdo = %{version}
Provides: %{name}_any_db = %{version}
%description pgsql
PHP functions for access to PostgreSQL database servers. It includes
both traditional pgsql and pdo_pgsql drivers.
%package posix
Summary: POSIX functions for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description posix
This module contains an interface to those functions defined in the
IEEE 1003.1 (POSIX.1) standards document which are not accessible
through other means.
%package readline
Summary: PHP readline extension
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description readline
PHP interface to libedit, which provides editable command line as well
as PHP interactive mode (php -a).
%package shmop
Summary: Alternate, low-level shared memory implementation for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description shmop
An extension created as an alternative to the sysvmsg module.
%package snmp
Summary: SNMP extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description snmp
The SNMP extension provides a toolset for managing remote devices via
the Simple Network Management Protocol.
As it is a wrapper around the underlying Net-SNMP library, all basic
concepts are the same and the PHP functions change their behavior
depending on the Net-SNMP configuration files and environment
variables.
%package soap
Summary: SOAP/WSDL extension module for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description soap
This module provides SOAP support.
SOAP extension can be used to write SOAP Servers and Clients. It
supports subsets of SOAP 1.1, SOAP 1.2 and WSDL 1.1 specifications.
%package sockets
Summary: Berkeley sockets API for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description sockets
The socket extension implements a low-level interface to the socket
communication functions based on the BSD sockets API, providing the
possibility to act as a socket server as well as a client.
%package sodium
Summary: Cryptographic Extension Based on Libsodium
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description sodium
PHP binding to libsodium software library for encryption, decryption,
signatures, password hashing and more.
%package sqlite
Summary: SQLite database client for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-pdo = %{version}
%description sqlite
This is an extension for the SQLite Embeddable SQL Database Engine.
https://www.sqlite.org
SQLite is a C library that implements an embeddable SQL database
engine. Programs that link with the SQLite library can have SQL
database access without running a separate RDBMS process.
SQLite is not a client library used to connect to a big database
server. SQLite is the server. The SQLite library reads and writes
directly to and from the database files on disk.
This package includes sqlite and pdo_sqlite modules for sqlite version
2 and 3 respectively.
%package sysvmsg
Summary: SysV Message Queue support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description sysvmsg
This module provides System V Message Queue support.
%package sysvsem
Summary: SysV Semaphore support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description sysvsem
PHP interface for System V semaphores.
%package sysvshm
Summary: SysV Shared Memory support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description sysvshm
PHP interface for System V shared memory.
%package tidy
Summary: PHP binding for the Tidy HTML cleaner
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description tidy
Tidy is an extension based on Libtidy (http://tidy.sourceforge.net) and allows
a PHP developer to clean, repair, and traverse HTML, XHTML, and XML
documents -- including ones with embedded scripting languages such as
PHP or ASP within them using OO constructs.
%package tokenizer
Summary: Extension module to access Zend Engine's PHP tokenizer
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description tokenizer
The tokenizer functions provide an interface to the PHP tokenizer
embedded in the Zend Engine. Using these functions you may write your
own PHP source analyzing or modification tools without having to deal
with the language specification at the lexical level.
%package wddx
Summary: WDDX support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description wddx
PHP functions for working with WDDX - Web Distributed Data Exchange,
a programming language-, platform- and transport-neutral data
interchange mechanism designed to pass data between different
environments and different computers.
%package xmlrpc
Summary: XML RPC support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description xmlrpc
This module adds XMLRPC-EPI support.
%package xsl
Summary: PHP Extension Module
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-dom = %{version}
%description xsl
PHP's XSL extension implements the XSL (Extensible Stylesheet
Language) standard, performing XSLT transformations using the libxslt
library
%package xmlreader
Summary: Streaming XML reader extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
Requires: %{name}-dom = %{version}
%description xmlreader
The XMLReader extension is an XML Pull parser. The reader acts as a
cursor going forward on the document stream and stopping at each node
on the way.
%package xmlwriter
Summary: Streaming-based XML writer extension for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description xmlwriter
XMLWriter wraps the libxml xmlWriter API. Represents a writer that
provides a non-cached, forward-only means of generating streams or
files containing XML data.
%package zip
Summary: ZIP archive support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description zip
This extension allows to transparently read or write ZIP compressed
archives and the files inside them.
%package zlib
Summary: Zlib compression support for PHP
Group: Development/Libraries/PHP
Requires: %{name} = %{version}
%description zlib
This module enables to transparently read and write gzip (.gz)
compressed files, through versions of most of the filesystem
functions which work with gzip-compressed files (and uncompressed
files, too, but not with sockets).
%prep
%autosetup -p1 -n php-%{version} -a1
%build
# aclocal workaround - to be improved
cat `aclocal --print-ac-dir`/{libtool,ltoptions,ltsugar,ltversion,lt~obsolete}.m4 >>aclocal.m4
# force use of system libtool:
libtoolize --force --copy
cat `aclocal --print-ac-dir`/{libtool,ltoptions,ltsugar,ltversion,lt~obsolete}.m4 >build/libtool.m4
# build directories for individual SAPIs
mkdir -p build-cli
mkdir -p build-fastcgi
mkdir -p build-fpm
# get parsers regenerated
for parser in `find -type f -name "*.re"`;do
rm -v ${parser%.*}.c
done
rm -r ext/pcre/pcre2lib
# regenerate configure etc.
rm configure
./buildconf --force
# export flags
export CC=gcc-13
export CXX=g++-13
CFLAGS="%{optflags} -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -fpermissive"
CXXFLAGS="%{optflags} -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing -fpermissive"
export CFLAGS
export CXXFLAGS
export LDFLAGS="-pie"
export NO_INTERACTION=true
# where to install extensions
EXTENSION_DIR=%{extension_dir}
export EXTENSION_DIR
export PHP_MYSQLND_ENABLED=yes
export PHP_MYSQLND_COMPRESSION_SUPPORT=yes
# Fix build-cli for arm and aarch64
export LIBS=-ltinfo
# Some extensions are broken when linking with -z now
export SUSE_ZNOW=0
# build function
Build()
{
sapi=$1
pushd build-$1
shift
ln -s ../configure
%configure \
--program-suffix=%{php_suffix} \
--datadir=%{_datadir}/%{name} \
--with-libdir=%{_lib} \
--includedir=%{_includedir} \
--sysconfdir=%{php_sysconf}/$sapi \
--with-config-file-path=%{php_sysconf}/$sapi \
--with-config-file-scan-dir=%{php_sysconf}/conf.d \
--without-pear \
--enable-json \
--enable-libxml \
--enable-session \
--with-pcre-regex=%{_usr} \
--enable-xml \
--enable-simplexml \
--enable-filter \
--disable-debug \
--enable-inline-optimization \
--disable-rpath \
--disable-static \
--enable-shared \
--with-pic \
--with-gnu-ld \
--enable-re2c-cgoto \
--with-system-tzdata=%{_datadir}/zoneinfo \
--enable-hash \
--with-mhash \
--enable-phpdbg=no \
--with-sodium=shared \
--with-libzip \
--with-password-argon2=%{_usr} \
"$@" || { cat config.log; exit 1; }
%make_build
popd
}
Build cli \
--enable-cli \
--enable-bcmath=shared \
--enable-calendar=shared \
--enable-ctype=shared \
--enable-dom=shared \
--enable-exif=shared \
--enable-ftp=shared \
--enable-mbstring=shared \
--enable-mbregex \
--enable-pcntl=shared \
--enable-posix=shared \
--enable-shmop=shared \
--enable-soap=shared \
--enable-sockets=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
--enable-tokenizer=shared \
--enable-wddx=shared \
--enable-fileinfo=shared \
--with-zlib=shared \
--with-bz2=shared \
--with-curl=shared \
--with-gd=shared,%{_usr} \
--enable-gd-native-ttf \
--with-xpm-dir=%{_usr} \
--with-freetype-dir=%{_usr} \
--with-png-dir=%{_usr} \
--with-jpeg-dir=%{_usr} \
--with-zlib-dir=%{_usr} \
--with-gettext=shared \
--with-gmp=shared \
--with-iconv=shared \
--with-kerberos \
--with-ldap=shared \
--with-ldap-sasl=%{_usr} \
--with-libedit=shared,%{_usr} \
--with-mysql-sock=%{_localstatedir}/run/mysql/mysql.sock \
--with-mysqli=shared,mysqlnd \
--with-unixODBC=shared,%{_usr} \
--with-openssl=shared \
--with-pgsql=shared,%{_usr} \
--enable-phar=shared \
--with-enchant=shared,%{_usr} \
--with-snmp=shared \
--with-xmlrpc=shared \
--enable-xmlreader=shared \
--enable-xmlwriter=shared \
--with-xsl=shared \
--with-tidy=shared,%{_usr} \
--enable-dba=shared \
--with-db4=%{_usr} \
--with-lmdb=%{_usr} \
--without-gdbm \
--with-cdb \
--enable-pdo=shared \
--with-pdo_sqlite=shared,%{_usr} \
--with-sqlite3=shared,%{_usr} \
--with-pdo-mysql=shared,mysqlnd \
--with-pdo-pgsql=shared,%{_usr} \
--with-pdo-odbc=shared,unixODBC,%{_usr} \
--enable-zip=shared \
--enable-intl=shared,%{_usr} \
--disable-cgi
Build fastcgi \
--enable-force-cgi-redirect \
--disable-discard-path \
--enable-fastcgi \
--bindir=%{_bindir} \
--disable-cli \
--disable-all
Build fpm \
--enable-fpm \
--with-fpm-acl \
--with-fpm-systemd \
--with-fpm-user=%{php_user} \
--with-fpm-group=%{php_group} \
--bindir=%{_bindir} \
--disable-cli \
--disable-all \
--localstatedir=%{_localstatedir}
%install
# install function
Install()
{
pushd build-$1
%make_install INSTALL_ROOT=%{buildroot}
popd
}
# do the actual installation
Install cli
Install fastcgi
Install fpm
# generate php.ini from php.ini-production:
install -dpm0755 %{buildroot}%{php_sysconf}/conf.d
install -dpm0755 %{buildroot}%{php_sysconf}/cli
install -dpm0755 %{buildroot}%{php_sysconf}/fastcgi
install -dpm0755 %{buildroot}%{php_sysconf}/fpm
mv %{buildroot}%{php_sysconf}/fpm/php-fpm.conf.default %{buildroot}%{php_sysconf}/fpm/php-fpm.conf
mv %{buildroot}%{php_sysconf}/fpm/php-fpm.d/www.conf.default %{buildroot}%{php_sysconf}/fpm/php-fpm.d/www.conf
sed 's/http:/https:/g' php.ini-production | sed 's/php7/%{name}/g' > %{buildroot}%{php_sysconf}/cli/php.ini
pushd %{buildroot}%{php_sysconf}/fastcgi
ln -s ../cli/php.ini
popd
pushd %{buildroot}%{php_sysconf}/fpm
ln -s ../cli/php.ini
popd
# prepare configuration files for each extension
extern_modules=""
for f in %{buildroot}%{extension_dir}/*; do
if test ${f##*.} = a; then
rm $f
continue
fi
if test ${f##*.} = so; then
f=${f%.so}
fi
ext=${f##*/}
extern_modules="$extern_modules $ext"
echo "; comment out next line to disable $ext extension in php" > %{buildroot}%{php_sysconf}/conf.d/$ext.ini
zend_=''
if [ $ext == "opcache" ]; then
zend_='zend_'
fi
echo "${zend_}extension=$ext.so" >> %{buildroot}%{php_sysconf}/conf.d/$ext.ini
done
# list of builtin modules
builtin_modules=`./build-cli/sapi/cli/php -m | grep -E -v '^(\[.*)?$' | sort | tr '\n' ' '`
# update readme
sed "s=@EXTERN_MODULES@=$extern_modules=;s=@BUILTIN_MODULES@=$builtin_modules=" php-suse-addons/README.SUSE > README.SUSE
# directory for sessions
install -dpm0755 %{buildroot}%{_localstatedir}/lib/%{name}/sessions
# documentation
mv sapi/cli/README README.CLI
mv sapi/cgi/README.FastCGI README.FastCGI
#fix symlink
sed -i -e "s@%{_builddir}/php-%{rversion}/build-cli/sapi/cli/php@php@g" %{buildroot}%{_bindir}/phar.phar
rm %{buildroot}%{_bindir}/phar %{buildroot}%{_mandir}/man1/phar.phar.1
# bnc#734176
mv %{buildroot}%{_bindir}/phar.phar %{buildroot}%{_bindir}/phar%{php_suffix}
mv %{buildroot}%{_mandir}/man1/phar.1 %{buildroot}%{_mandir}/man1/phar%{php_suffix}.1
# install fpm init script.
install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/php-fpm%{php_suffix}.service
sed -i 's|%{_sbindir}/php-fpm|%{_sbindir}/php-fpm%{php_suffix}|' %{buildroot}%{_unitdir}/php-fpm%{php_suffix}.service
sed -i 's|%{_sysconfdir}/php|%{_sysconfdir}/%{name}|' %{buildroot}%{_unitdir}/php-fpm%{php_suffix}.service
%fdupes %{buildroot}%{_includedir}/%{name}
%pre fpm
%service_add_pre php-fpm%{php_suffix}.service
%postun fpm
%service_del_postun php-fpm%{php_suffix}.service
%preun fpm
%service_del_preun php-fpm%{php_suffix}.service
%post fpm
%service_add_post php-fpm%{php_suffix}.service
%files
%license LICENSE
%doc README* CODING_STANDARDS CREDITS EXTENSIONS NEWS UPGRADING
%config(noreplace) %{php_sysconf}/cli/php.ini
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{?ext_man}
%dir %{php_sysconf}
%dir %{php_sysconf}/conf.d
%dir %{php_sysconf}/cli
%dir %{_libdir}/%{name}
%dir %{extension_dir}
%dir %{_datadir}/%{name}
%attr(0755, %{php_user}, %{php_group}) %dir %{_localstatedir}/lib/%{name}
%attr(0755, %{php_user}, %{php_group}) %dir %{_localstatedir}/lib/%{name}/sessions
%files devel
%{_includedir}/%{name}
%{_bindir}/{php-config,phpize}%{php_suffix}
%{_mandir}/man1/{php-config,phpize}%{php_suffix}.1%{?ext_man}
%{_datadir}/%{name}/build
%files fastcgi
%{_bindir}/php-cgi%{php_suffix}
%{_mandir}/man1/php-cgi%{php_suffix}.1%{?ext_man}
%dir %{php_sysconf}/fastcgi
%config(noreplace) %{php_sysconf}/fastcgi/php.ini
%files fpm
%{_sbindir}/php-fpm%{php_suffix}
%dir %{php_sysconf}/fpm
%config(noreplace) %{php_sysconf}/fpm/php.ini
%config(noreplace) %{php_sysconf}/fpm/php-fpm.conf
%dir %{php_sysconf}/fpm/php-fpm.d
%config(noreplace) %{php_sysconf}/fpm/php-fpm.d/www.conf
%{_mandir}/man8/php-fpm%{php_suffix}.8%{?ext_man}
%dir %{_datadir}/%{name}/fpm
%{_datadir}/%{name}/fpm/status.html
%{_unitdir}/php-fpm%{php_suffix}.service
%files bcmath
%{extension_dir}/bcmath.so
%config(noreplace) %{php_sysconf}/conf.d/bcmath.ini
%files bz2
%{extension_dir}/bz2.so
%config(noreplace) %{php_sysconf}/conf.d/bz2.ini
%files calendar
%{extension_dir}/calendar.so
%config(noreplace) %{php_sysconf}/conf.d/calendar.ini
%files ctype
%{extension_dir}/ctype.so
%config(noreplace) %{php_sysconf}/conf.d/ctype.ini
%files curl
%{extension_dir}/curl.so
%config(noreplace) %{php_sysconf}/conf.d/curl.ini
%files dba
%{extension_dir}/dba.so
%config(noreplace) %{php_sysconf}/conf.d/dba.ini
%files dom
%{extension_dir}/dom.so
%config(noreplace) %{php_sysconf}/conf.d/dom.ini
%files enchant
%{extension_dir}/enchant.so
%config(noreplace) %{php_sysconf}/conf.d/enchant.ini
%files exif
%{extension_dir}/exif.so
%config(noreplace) %{php_sysconf}/conf.d/exif.ini
%files fileinfo
%{extension_dir}/fileinfo.so
%config(noreplace) %{php_sysconf}/conf.d/fileinfo.ini
%files ftp
%{extension_dir}/ftp.so
%config(noreplace) %{php_sysconf}/conf.d/ftp.ini
%files gd
%{extension_dir}/gd.so
%config(noreplace) %{php_sysconf}/conf.d/gd.ini
%files gettext
%{extension_dir}/gettext.so
%config(noreplace) %{php_sysconf}/conf.d/gettext.ini
%files gmp
%{extension_dir}/gmp.so
%config(noreplace) %{php_sysconf}/conf.d/gmp.ini
%files iconv
%{extension_dir}/iconv.so
%config(noreplace) %{php_sysconf}/conf.d/iconv.ini
%files intl
%{extension_dir}/intl.so
%config(noreplace) %{php_sysconf}/conf.d/intl.ini
%files ldap
%{extension_dir}/ldap.so
%config(noreplace) %{php_sysconf}/conf.d/ldap.ini
%files mbstring
%{extension_dir}/mbstring.so
%config(noreplace) %{php_sysconf}/conf.d/mbstring.ini
%files mysql
%{extension_dir}/mysqli.so
%config(noreplace) %{php_sysconf}/conf.d/mysqli.ini
%{extension_dir}/pdo_mysql.so
%config(noreplace) %{php_sysconf}/conf.d/pdo_mysql.ini
%files odbc
%{extension_dir}/odbc.so
%config(noreplace) %{php_sysconf}/conf.d/odbc.ini
%{extension_dir}/pdo_odbc.so
%config(noreplace) %{php_sysconf}/conf.d/pdo_odbc.ini
%files opcache
%{extension_dir}/opcache.so
%config(noreplace) %{php_sysconf}/conf.d/opcache.ini
%files openssl
%{extension_dir}/openssl.so
%config(noreplace) %{php_sysconf}/conf.d/openssl.ini
%files phar
%{extension_dir}/phar.so
%config(noreplace) %{php_sysconf}/conf.d/phar.ini
%{_bindir}/phar%{php_suffix}
%{_mandir}/man1/phar%{php_suffix}.1%{?ext_man}
%files pcntl
%{extension_dir}/pcntl.so
%config(noreplace) %{php_sysconf}/conf.d/pcntl.ini
%files pdo
%{extension_dir}/pdo.so
%config(noreplace) %{php_sysconf}/conf.d/pdo.ini
%files pgsql
%{extension_dir}/pgsql.so
%config(noreplace) %{php_sysconf}/conf.d/pgsql.ini
%{extension_dir}/pdo_pgsql.so
%config(noreplace) %{php_sysconf}/conf.d/pdo_pgsql.ini
%files posix
%{extension_dir}/posix.so
%config(noreplace) %{php_sysconf}/conf.d/posix.ini
%files readline
%{extension_dir}/readline.so
%config(noreplace) %{php_sysconf}/conf.d/readline.ini
%files shmop
%{extension_dir}/shmop.so
%config(noreplace) %{php_sysconf}/conf.d/shmop.ini
%files snmp
%{extension_dir}/snmp.so
%config(noreplace) %{php_sysconf}/conf.d/snmp.ini
%files soap
%{extension_dir}/soap.so
%config(noreplace) %{php_sysconf}/conf.d/soap.ini
%files sodium
%{extension_dir}/sodium.so
%config(noreplace) %{php_sysconf}/conf.d/sodium.ini
%files sockets
%{extension_dir}/sockets.so
%config(noreplace) %{php_sysconf}/conf.d/sockets.ini
%files sqlite
%{extension_dir}/pdo_sqlite.so
%config(noreplace) %{php_sysconf}/conf.d/pdo_sqlite.ini
%{extension_dir}/sqlite3.so
%config(noreplace) %{php_sysconf}/conf.d/sqlite3.ini
%files sysvmsg
%{extension_dir}/sysvmsg.so
%config(noreplace) %{php_sysconf}/conf.d/sysvmsg.ini
%files sysvsem
%{extension_dir}/sysvsem.so
%config(noreplace) %{php_sysconf}/conf.d/sysvsem.ini
%files sysvshm
%{extension_dir}/sysvshm.so
%config(noreplace) %{php_sysconf}/conf.d/sysvshm.ini
%files tidy
%{extension_dir}/tidy.so
%config(noreplace) %{php_sysconf}/conf.d/tidy.ini
%files tokenizer
%{extension_dir}/tokenizer.so
%config(noreplace) %{php_sysconf}/conf.d/tokenizer.ini
%files wddx
%{extension_dir}/wddx.so
%config(noreplace) %{php_sysconf}/conf.d/wddx.ini
%files xmlrpc
%{extension_dir}/xmlrpc.so
%config(noreplace) %{php_sysconf}/conf.d/xmlrpc.ini
%files xmlreader
%{extension_dir}/xmlreader.so
%config(noreplace) %{php_sysconf}/conf.d/xmlreader.ini
%files xmlwriter
%{extension_dir}/xmlwriter.so
%config(noreplace) %{php_sysconf}/conf.d/xmlwriter.ini
%files xsl
%{extension_dir}/xsl.so
%config(noreplace) %{php_sysconf}/conf.d/xsl.ini
%files zip
%{extension_dir}/zip.so
%config(noreplace) %{php_sysconf}/conf.d/zip.ini
%files zlib
%{extension_dir}/zlib.so
%config(noreplace) %{php_sysconf}/conf.d/zlib.ini
%changelog