perl INC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Good news everyone,
I found time to "fix" our @INC again. Maybe you have noticed, that they
contained duplicates and were terribly long. Duplicates were fixed by
the patch for reordering INC and few adjustments of Configure in perl.spec.

But there's more changes. I suppose many of you is using not only Fedora,
but also EPEL, RHEL or CentOS, so you might be interested in latest
change of
directories in RHEL-6. I've re-added back directory vendor_perl for
third party
RPMS (personal rpms or updates of packages which are not available
on mirrors). My question is if this directory should be re-added also
for Fedora?
If there will be no interest, I remove only duplicates in paths.

Best regards,
Marcela
From 88d8874174ec4fe2d9e57aa42bebe925684a00e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcela=20Ma=C5=A1l=C3=A1=C5=88ov=C3=A1?= <mmaslano@xxxxxxxxxx>
Date: Fri, 30 Jul 2010 11:58:11 +0200
Subject: [PATCH] Cut and clean INC

Duplicates in INC were removed in patch for reordering paths in INC.
Old INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/local/share/perl5
/usr/lib64/perl5
/usr/share/perl5
/usr/share/perl5
/usr/lib64/perl5
/usr/share/perl5
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.10.0
/usr/lib64/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/site_perl
.

New INC does contain vendor_perl again for 3rd party RPMS, but there
are only six paths:
/usr/local/lib64/perl5 CPAN or local install
/usr/local/share/perl5 CPAN or local install
/usr/lib64/perl5/vendor_perl 3rd party RPMS
/usr/share/perl5/vendor_perl 3rd party RPMS
/usr/lib64/perl5 Fedora RPMS
/usr/share/perl5 Fedora RPMS
.
---
 perl-5.10.1-reorderINC.patch |   79 ++++++++++++++++++++++++++++++++++++++++++
 perl.spec                    |   48 +++++++++++++++----------
 2 files changed, 108 insertions(+), 19 deletions(-)
 create mode 100644 perl-5.10.1-reorderINC.patch

diff --git a/perl-5.10.1-reorderINC.patch b/perl-5.10.1-reorderINC.patch
new file mode 100644
index 0000000..b7ec2a9
--- /dev/null
+++ b/perl-5.10.1-reorderINC.patch
@@ -0,0 +1,79 @@
+diff -up perl-5.10.1/perl.c.INC perl-5.10.1/perl.c
+--- perl-5.10.1/perl.c.INC	2009-04-22 20:07:41.000000000 +0200
++++ perl-5.10.1/perl.c	2010-06-11 14:28:32.784465168 +0200
+@@ -4879,9 +4879,6 @@ S_init_perllib(pTHX)
+     incpush(APPLLIB_EXP, TRUE, TRUE, TRUE, TRUE);
+ #endif
+ 
+-#ifdef ARCHLIB_EXP
+-    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
+-#endif
+ #ifdef MACOS_TRADITIONAL
+     {
+ 	Stat_t tmpstatbuf;
+@@ -4890,6 +4887,10 @@ S_init_perllib(pTHX)
+ 	
+ 	if (!macperl)
+ 	    macperl = "";
++
++#ifdef ARCHLIB_EXP
++        incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
++#endif
+ 	
+ 	Perl_sv_setpvf(aTHX_ privdir, "%slib:", macperl);
+ 	if (PerlLIO_stat(SvPVX(privdir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode))
+@@ -4903,14 +4904,6 @@ S_init_perllib(pTHX)
+     if (!PL_tainting)
+ 	incpush(":", FALSE, FALSE, TRUE, FALSE);
+ #else
+-#ifndef PRIVLIB_EXP
+-#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
+-#endif
+-#if defined(WIN32)
+-    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
+-#else
+-    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
+-#endif
+ 
+ #ifdef SITEARCH_EXP
+     /* sitearch is always relative to sitelib on Windows for
+@@ -4929,10 +4922,11 @@ S_init_perllib(pTHX)
+ #  endif
+ #endif
+ 
+-#if defined(SITELIB_STEM) && defined(PERL_INC_VERSION_LIST)
++/* This duplicates path     /usr/local/share/perl5
++ * #if defined(SITELIB_STEM) && defined(PERL_INC_VERSION_LIST)*/
+     /* Search for version-specific dirs below here */
+-    incpush(SITELIB_STEM, FALSE, TRUE, TRUE, TRUE);
+-#endif
++/*    incpush(SITELIB_STEM, FALSE, TRUE, TRUE, TRUE);
++#endif*/
+ 
+ #ifdef PERL_VENDORARCH_EXP
+     /* vendorarch is always relative to vendorlib on Windows for
+@@ -4950,8 +4944,22 @@ S_init_perllib(pTHX)
+ #  endif
+ #endif
+ 
+-#ifdef PERL_VENDORLIB_STEM /* Search for version-specific dirs below here */
+-    incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
++/* This duplicates path     /usr/share/perl5
++#ifdef PERL_VENDORLIB_STEM */ /* Search for version-specific dirs below here */
++/*    incpush(PERL_VENDORLIB_STEM, FALSE, TRUE, TRUE, TRUE);
++#endif*/
++
++#ifdef ARCHLIB_EXP
++    incpush(ARCHLIB_EXP, FALSE, FALSE, TRUE, TRUE);
++#endif
++
++#ifndef PRIVLIB_EXP
++#  define PRIVLIB_EXP "/usr/local/lib/perl5:/usr/local/lib/perl"
++#endif
++#if defined(WIN32)
++    incpush(PRIVLIB_EXP, TRUE, FALSE, TRUE, TRUE);
++#else
++    incpush(PRIVLIB_EXP, FALSE, FALSE, TRUE, TRUE);
+ #endif
+ 
+ #ifdef PERL_OTHERLIBDIRS
diff --git a/perl.spec b/perl.spec
index 1630b88..a778b14 100644
--- a/perl.spec
+++ b/perl.spec
@@ -60,7 +60,7 @@ Patch7:         perl-5.10.0-disable_test_hosts.patch
 Patch8:         perl-5.10.0-x86_64-io-test-failure.patch
 
 # Reorder @INC: Based on: http://github.com/rafl/perl/commit/b9ba2fadb18b54e35e5de54f945111a56cbcb249
-Patch9:         perl-5.10.0-reorderINC.patch
+Patch9:         perl-5.10.1-reorderINC.patch
 
 # http://rt.perl.org/rt3/Ticket/Display.html?id=39060 (#221113)
 Patch10:        perl-perlio-incorrect-errno.patch
@@ -978,16 +978,16 @@ echo "RPM Build arch: %{_arch}"
 # use "lib", not %{_lib}, for privlib, sitelib, and vendorlib
 # To build production version, we would need -DDEBUGGING=-g
 
-# transition period:
-%define old_sitearch	%{_prefix}/local/%{_lib}/perl5/site_perl/5.10.0/%{perl_archname}
-%define old_sitelib	%{_prefix}/local/lib/perl5/site_perl/5.10.0
-%define old_vendorarch	%{_libdir}/perl5/vendor_perl/5.10.0/%{perl_archname}
-# for a reason that is not clear, the version component got stripped here:
-%define old_vendorlib	%{_prefix}/lib/perl5/vendor_perl
-# No need to add old privdir and archdir to otherlibdirs.
+# Perl INC path (perl -V) in search order:
+# - /usr/local/share/perl5            -- for CPAN     (site lib)
+# - /usr/local/lib[64]/perl5          -- for CPAN     (site arch)
+# - /usr/share/perl5/vendor_perl      -- 3rd party    (vendor lib)
+# - /usr/lib[64]/perl5/vendor_perl    -- 3rd party    (vendor arch)
+# - /usr/share/perl5                  -- Fedora       (priv lib)
+# - /usr/lib[64]/perl5                -- Fedora       (arch lib)
 
-%define privlib		%{_prefix}/share/perl5
-%define archlib		%{_libdir}/perl5
+%define privlib         %{_prefix}/share/perl5
+%define archlib         %{_libdir}/perl5
 
 /bin/sh Configure -des -Doptimize="$RPM_OPT_FLAGS" \
         -DDEBUGGING=-g \
@@ -1002,9 +1002,9 @@ echo "RPM Build arch: %{_arch}"
         -Dsitelib="%{_prefix}/local/share/perl5" \
         -Dsitearch="%{_prefix}/local/%{_lib}/perl5" \
         -Dprivlib="%{privlib}" \
-        -Dvendorlib="%{privlib}" \
         -Darchlib="%{archlib}" \
-        -Dvendorarch="%{archlib}" \
+        -Dvendorlib="%{privlib}/vendor_perl" \
+        -Dvendorarch="%{archlib}/vendor_perl" \
         -Dinc_version_list="5.10.0" \
         -Darchname=%{perl_archname} \
 %ifarch %{multilib_64_archs}
@@ -1033,11 +1033,7 @@ echo "RPM Build arch: %{_arch}"
         -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
         -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
         -Ud_endservent_r_proto -Ud_setservent_r_proto \
-        -Dscriptdir='%{_bindir}' \
-        -Dotherlibdirs="%{old_sitearch}:%{old_sitelib}:%{old_vendorarch}:%{old_vendorlib}:/usr/lib/perl5/site_perl"
-
-# this is promised to stay forever:
-#        -Dotherlibdirs=%{prefix}/lib/perl5/site_perl
+        -Dscriptdir='%{_bindir}'
 
 
 %ifarch sparc64
@@ -1070,6 +1066,10 @@ do
   %{new_perl} %{build_bindir}/h2ph -a -d %{build_archlib} $i || true
 done
 
+# vendor directories (in this case for third party rpms)
+mkdir -p $RPM_BUILD_ROOT%{archlib}/vendor_perl
+mkdir -p $RPM_BUILD_ROOT%{privlib}/vendor_perl
+
 #
 # libnet configuration file
 #
@@ -1150,7 +1150,7 @@ pushd %{build_archlib}/CORE/
 rm patchlevel.bak
 popd
 
-#FIXME: temporary compatibility hack: for perl(:MODULE_COMPAT_5.10.0)
+# compatibility directory: for perl(:MODULE_COMPAT_5.10.0)
 mkdir -p $RPM_BUILD_ROOT%{_libdir}/perl5/5.10.0/%{perl_archname}/CORE
 ln -s ../../../CORE/libperl.so $RPM_BUILD_ROOT%{_libdir}/perl5/5.10.0/%{perl_archname}/CORE/libperl.so
 
@@ -1185,7 +1185,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man3/*.3*
 %{_bindir}/*
 %{privlib}
-%{archlib}
+%{archlib}/*
+%{privlib}/vendor_perl
+%exclude %{archlib}/vendor_perl
+%{_prefix}/local/share/perl5
 
 # libs
 %exclude %{archlib}/CORE/libperl.so
@@ -1477,6 +1480,9 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 %{archlib}/CORE/libperl.so
 %{_libdir}/perl5/5.10.0/%{perl_archname}/CORE/libperl.so
+%dir %{archlib}
+%dir %{archlib}/vendor_perl
+%dir %{_prefix}/local/%{_lib}/perl5
 
 %files devel
 %defattr(-,root,root,-)
@@ -1807,6 +1813,10 @@ rm -rf $RPM_BUILD_ROOT
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Thu Jul 29 2010 Marcela MaÅ¡láÅ?ová <mmaslano@xxxxxxxxxx> - 4:5.10.1-117
+- fix installation paths. Remove duplicates from paths
+- re-add vendor-path for 3rd party RPMS
+
 * Mon Jul 26 2010 Petr Pisar <ppisar@xxxxxxxxxx> - 4:5.10.1-117
 - Enable parallel testing in IO module
 - Run tests in C locale to pass t/op/stat.t test in localized environment
-- 
1.7.2

--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel

[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux