From: Marcin Krol Date: Sun, 30 Jun 2013 19:33:13 +0000 (+0000) Subject: - merged versioned cli from PLD, but do it proper way X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=bf6162fd9fae58ba3610f8985b37cc0e96ed2ea6;p=packages%2Fphp.git - merged versioned cli from PLD, but do it proper way - dropped program subpackage, obsoleted by cli --- diff --git a/php.spec b/php.spec index 0160c40..ee605fb 100644 --- a/php.spec +++ b/php.spec @@ -25,8 +25,9 @@ #+ereg # libxml # Reflection -# +# # Conditional build: +%bcond_with 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 @@ -110,10 +111,10 @@ ERROR: You need to select at least one Apache SAPI to build shared modules. %undefine with_filter %endif +%define rel 2 %define orgname php -%define php_suffix 53 - -%define rel 1 +%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 @@ -296,6 +297,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define jsonver 1.2.1 %define pharver 2.0.1 %define sqlitever 2.0-dev +%define sqlite3ver 0.7-dev %define zipver 1.11.0 %define zend_zts %{!?with_zts:0}%{?with_zts:1} @@ -433,6 +435,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. @@ -454,19 +457,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 @@ -1598,7 +1588,7 @@ Summary(pl.UTF-8): Moduł SQLite3 dla PHP Group: Libraries URL: http://php.net/manual/en/book.sqlite3.php Requires: %{name}-common = %{epoch}:%{version}-%{release} -Provides: php(sqlite3) +Provides: php(sqlite3) = %{sqlite3ver} %description sqlite3 SQLite is a C library that implements an embeddable SQL database @@ -2015,6 +2005,12 @@ if test "$ver" != "%{pharver}"; then : Update the pharver macro and rebuild. exit 1 fi +ver=$(sed -n '/#define PHP_SQLITE3_VERSION/{s/.* "//;s/".*$//;p}' ext/sqlite3/php_sqlite3.h) +if test "$ver" != "%{sqlite3ver}"; then + : Error: Upstream Sqlite3 version is now ${ver}, expecting %{sqlite3ver}. + : Update the sqlite3ver macro and rebuild. + exit 1 +fi ver=$(sed -n '/#define PHP_ZIP_VERSION_STRING /{s/.* "//;s/".*$//;p}' ext/zip/php_zip.h) if test "$ver" != "%{zipver}"; then : Error: Upstream ZIP version is now ${ver}, expecting %{zipver}. @@ -2433,16 +2429,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 @@ -2700,13 +2698,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 @@ -2784,6 +2782,7 @@ fi %files dba %defattr(644,root,root,755) +%doc ext/dba/{CREDITS,README} %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/dba.ini %attr(755,root,root) %{php_extensiondir}/dba.so