From ff4454a8d57e12613e0593d281b3586613ffe663 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Tue, 26 Jul 2016 15:11:04 +0200
Subject: Fix building without perl in the build root

After building extensions, Makefile builds documentation by executing
the new perl. Because we version libperl.so soname, we need to
precreate a symlink from the soname to ./libperl.so so that the new
perl can be executed. Otherwise this happens:

LD_LIBRARY_PATH=/builddir/build/BUILD/perl-5.24.0  ./perl -Ilib -f pod/buildtoc 
-q
./perl: error while loading shared libraries: libperl.so.5.24: cannot open 
shared object file: No such file or directory

This did not appear on upgrade from previous perl version because perl
build script sets LD_PRELOAD in addition if libperl.so exists in the system.
---
 perl.spec | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/perl.spec b/perl.spec
index 6b15998..5081327 100644
--- a/perl.spec
+++ b/perl.spec
@@ -28,7 +28,7 @@
 Name:           perl
 Version:        %{perl_version}
 # release number must be even higher, because dual-lived modules will be 
broken otherwise
-Release:        374%{?dist}
+Release:        375%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -2987,6 +2987,11 @@ BUILD_BZIP2=0
 BZIP2_LIB=%{_libdir}
 export BUILD_BZIP2 BZIP2_LIB
 
+# Prepapre a symlink from proper DSO name to libperl.so now so that new perl
+# can be executed from make.
+%global soname libperl.so.%(echo '%{perl_version}' | sed 
's/^\\([^.]*\\.[^.]*\\).*/\\1/')
+test -L %soname || ln -s libperl.so %soname
+
 %ifarch sparc64 %{arm}
 make
 %else
@@ -3005,7 +3010,6 @@ make install DESTDIR=$RPM_BUILD_ROOT
     %{build_bindir}/perl
 
 # Make proper DSO names, move libperl to standard path.
-%global soname libperl.so.%(echo '%{perl_version}' | sed 
's/^\\([^.]*\\.[^.]*\\).*/\\1/')
 mv "%{build_archlib}/CORE/libperl.so" \
     "$RPM_BUILD_ROOT%{_libdir}/libperl.so.%{perl_version}"
 ln -s "libperl.so.%{perl_version}" "$RPM_BUILD_ROOT%{_libdir}/%{soname}"
@@ -3013,6 +3017,10 @@ ln -s "libperl.so.%{perl_version}" 
"$RPM_BUILD_ROOT%{_libdir}/libperl.so"
 # XXX: Keep symlink from original location because various code glues
 # $archlib/CORE/$libperl to get the DSO.
 ln -s "../../libperl.so.%{perl_version}" "%{build_archlib}/CORE/libperl.so"
+# XXX: Remove the soname named file from CORE directory that was created as
+# a symlink in build section and installed as a regular file by perl build
+# system.
+rm -f "%{build_archlib}/CORE/%{soname}"
 
 install -p -m 755 utils/pl2pm %{build_bindir}/pl2pm
 
@@ -5118,6 +5126,9 @@ popd
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Tue Jul 26 2016 Petr Pisar <ppi...@redhat.com> - 4:5.24.0-375
+- Fix building without perl in the build root
+
 * Tue Jul 12 2016 Petr Pisar <ppi...@redhat.com> - 4:5.24.0-374
 - Fix a crash in lexical scope warnings (RT#128597)
 
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl.git/commit/?h=master&id=ff4454a8d57e12613e0593d281b3586613ffe663
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org

Reply via email to