From: Marcin Krol Date: Mon, 20 Nov 2017 09:28:10 +0000 (+0000) Subject: - versioned libphp and libphp_common X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=41a74309ca032e8d4ac0116f64d6b710375ea476;p=packages%2Fphp.git - versioned libphp and libphp_common --- diff --git a/php.spec b/php.spec index 676d38d..eba6e41 100644 --- a/php.spec +++ b/php.spec @@ -2508,9 +2508,12 @@ v=$(echo %{version} | cut -d. -f1-2) # install Apache2 DSO module %if %{with apache2} +# versioned libphp libtool --mode=install install -p sapi/apache2handler/libphp7.la $RPM_BUILD_ROOT%{_libdir}/apache -%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7{,-$v}.so -ln -s libphp7-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so +%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.la $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la +%{__mv} $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.so +sed -i -e "s|libphp7|libphp%{php_suffix}|g" $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la +ln -s libphp%{php_suffix}.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so %endif # install litespeed sapi @@ -2535,7 +2538,13 @@ touch $RPM_BUILD_ROOT%{_mandir}/man1/php-config.1 INSTALL_ROOT=$RPM_BUILD_ROOT %endif +# versioned libphp_common libtool --mode=install install -p libphp_common.la $RPM_BUILD_ROOT%{_libdir} +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libphp_common.la $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la +%{__mv} $RPM_BUILD_ROOT%{_libdir}/libphp_common-%{version}.so $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}-%{version}.so +%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/libphp_common.so +ln -s libphp_common%{php_suffix}-%{version}.so $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.so +sed -i -e "s|libphp_common|libphp_common%{php_suffix}|g" $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la # install CGI/FCGI %if %{with cgi} @@ -2572,7 +2581,7 @@ touch $RPM_BUILD_ROOT%{_sbindir}/php-fpm # we could use install-headers from Makefile.embed, but that would reinstall all headers # install-sapi installs to wrong dir, so just do it all manually install -d $RPM_BUILD_ROOT%{_includedir}/php/php%{php_suffix}/sapi/embed -install -p libs/libphp7.so $RPM_BUILD_ROOT%{_libdir} +install -p libs/libphp7.so $RPM_BUILD_ROOT%{_libdir}/libphp%{php_suffix}.so cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/php%{php_suffix}/sapi/embed %endif @@ -2587,7 +2596,7 @@ cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini %if %{with apache2} cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini -%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp7.la +%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp%{php_suffix}.la %endif # ensure that paths are correct for current php version and arch @@ -2632,9 +2641,9 @@ install -p run-tests.php $RPM_BUILD_ROOT%{php_datadir}/tests/php/run-tests.php cp -a tests/* $RPM_BUILD_ROOT%{php_datadir}/tests/php # fix install paths, avoid evil rpaths -sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_common.la +sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_common%{php_suffix}.la # better solution? -sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4 +sed -i -e 's|libphp_common.la|$(libdir)/libphp_common%{php_suffix}.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4 %clean rm -rf $RPM_BUILD_ROOT @@ -2858,7 +2867,7 @@ fi %dir %{_sysconfdir}/apache2handler.d %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache2handler.ini %attr(755,root,root) %{_libdir}/apache/mod_php.so -%attr(755,root,root) %{_libdir}/apache/libphp7-*.*.so +%attr(755,root,root) %{_libdir}/apache/libphp%{php_suffix}.so %endif %if %{with litespeed} @@ -2879,7 +2888,7 @@ fi %if %{with embed} %files embedded %defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/libphp7.so +%attr(755,root,root) %{_libdir}/libphp%{php_suffix}.so %endif %files cli @@ -2924,7 +2933,7 @@ fi %dir %{_sysconfdir} %dir %{_sysconfdir}/conf.d %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini -%attr(755,root,root) %{_libdir}/libphp_common-*.so +%attr(755,root,root) %{_libdir}/libphp_common%{php_suffix}-*.so %dir %{php_datadir} %dir %{php_extensiondir} @@ -2937,8 +2946,8 @@ fi %attr(755,root,root) %{_bindir}/php-config%{php_suffix} %ghost %{_bindir}/phpize %ghost %{_bindir}/php-config -%attr(755,root,root) %{_libdir}/libphp_common.so -%{_libdir}/libphp_common.la +%attr(755,root,root) %{_libdir}/libphp_common%{php_suffix}.so +%{_libdir}/libphp_common%{php_suffix}.la %{_includedir}/php/php%{php_suffix} %{_libdir}/%{name}/build %{_mandir}/man1/php-config%{php_suffix}.1*