From b8468741b77b89e4761dd23995adb9b1b530ec6f Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 30 Jun 2013 14:12:14 +0000 Subject: [PATCH] - merged versioned cli from PLD, but do it proper way - dropped program subpackage, obsoleted by cli --- php.spec | 53 ++++++++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/php.spec b/php.spec index 9724413..ef16134 100644 --- a/php.spec +++ b/php.spec @@ -39,6 +39,7 @@ # 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 @@ -123,10 +124,10 @@ ERROR: You need to select at least one Apache SAPI to build shared modules. %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 @@ -454,6 +455,7 @@ Summary: PHP as CLI interpreter 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. @@ -475,19 +477,6 @@ applications to provide PHP scripting language support. 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 @@ -2457,16 +2446,18 @@ cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/sapi/embed %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 @@ -2728,13 +2719,13 @@ fi %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 @@ -2967,7 +2958,7 @@ fi %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 -- 2.46.0