[packages/php] always name php cli as phpXY regardless of default_php bcond

glen glen at pld-linux.org
Fri Jun 21 13:13:21 CEST 2013


commit 6bbac1e61a832a103095b27febd111632d4a3bda
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Jun 21 14:12:52 2013 +0300

    always name php cli as phpXY regardless of default_php bcond

 php.spec | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/php.spec b/php.spec
index 7d52d03..aed0d01 100644
--- a/php.spec
+++ b/php.spec
@@ -121,7 +121,8 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 
 %define		rel	1
 %define		orgname	php
-%define		php_suffix %{!?with_default_php:53}
+%define		ver_suffix 53
+%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
@@ -2466,16 +2467,16 @@ 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
+echo ".so php%{ver_suffix}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+ln -sf php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php
+
+# .cli extension is installed only if default php.spec in distro for legacy purposes
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
+ln -s php%{ver_suffix} $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
 
@@ -2738,8 +2739,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*
+%attr(755,root,root) %{_bindir}/php%{ver_suffix}
+%{_mandir}/man1/php%{ver_suffix}.1*
+
+# legacy. do we really need it?
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
+%attr(755,root,root) %{_bindir}/php.cli
+%endif
 
 %files program
 %defattr(644,root,root,755)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/6bbac1e61a832a103095b27febd111632d4a3bda



More information about the pld-cvs-commit mailing list