# Reflection
#
# Conditional build:
+%bcond_without default_php # use this PHP as default PHP in distro
%bcond_with interbase_inst # use InterBase install., not Firebird (BR: proprietary libs)
%bcond_with oci8 # with Oracle oci8 extension module (BR: proprietary libs)
%bcond_with instantclient # build Oracle oci8 extension module against oracle-instantclient package
%undefine with_filter
%endif
-%define orgname php
-%define php_suffix %{nil}
-
%define rel 1
+%define orgname php
+%define ver_suffix 54
+%define php_suffix %{!?with_default_php:%{ver_suffix}}
Summary: PHP: Hypertext Preprocessor
Summary(fr.UTF-8): Le langage de script embarque-HTML PHP
Summary(pl.UTF-8): Język skryptowy PHP
Summary(pl.UTF-8): PHP jako interpreter działający z linii poleceń
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Obsoletes: php-program
%description cli
PHP as CLI interpreter.
Ten pakiet zawiera bibliotekę, którą można osadzać w aplikacjach w
celu obsługi PHP jako języka skryptowego.
-%package program
-Summary: /usr/bin/php symlink
-Summary(pl.UTF-8): Dowiązanie symboliczne /usr/bin/php
-Group: Development/Languages/PHP
-Requires: %{name}-cli = %{epoch}:%{version}-%{release}
-Obsoletes: /usr/bin/php
-
-%description program
-Package providing /usr/bin/php symlink to PHP CLI.
-
-%description program -l pl.UTF-8
-Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
-
%package fpm
Summary: PHP FastCGI Process Manager
Summary(pl.UTF-8): PHP FastCGI Process Manager - zarządca procesów FastCGI
%endif
# install CLI
-# without suffix, install as php.cli
-%if "%{?php_suffix}" == ""
-%define phpfn %{name}.cli
-%else
-%define phpfn %{name}
+# versioned suffix is always installed
+libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php%{ver_suffix}
+cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php%{ver_suffix}.1
+
+%if %{with default_php}
+# man for php
+echo ".so php%{ver_suffix}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+# link as /usr/bin/php
+ln -sf php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php
+# php.cli link for backward compatibility
+ln -sf php $RPM_BUILD_ROOT%{_bindir}/php.cli
%endif
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{phpfn}
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{phpfn}.1
-echo ".so %{phpfn}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
-ln -sf %{phpfn} $RPM_BUILD_ROOT%{_bindir}/php
cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
%defattr(644,root,root,755)
%dir %{_sysconfdir}/cli.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cli.ini
-%attr(755,root,root) %{_bindir}/%{phpfn}
-%{_mandir}/man1/%{phpfn}.1*
-
-%files program
-%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/php%{ver_suffix}
+%{_mandir}/man1/php%{ver_suffix}.1*
+%if %{with default_php}
%attr(755,root,root) %{_bindir}/php
+%attr(755,root,root) %{_bindir}/php.cli
%{_mandir}/man1/php.1*
+%endif
%if %{with fpm}
%files fpm
%if %{with oci8}
%files oci8
%defattr(644,root,root,755)
-%doc ext/ico8/{CREDITS,README}
+%doc ext/oci8/{CREDITS,README}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/oci8.ini
%attr(755,root,root) %{php_extensiondir}/oci8.so
%endif