[perl-Mozilla-CA] Redirect to ca-certificates bundle

Petr Pisar ppisar at fedoraproject.org
Fri Sep 16 11:29:09 UTC 2011


commit df77aa9a2659c1d3fba630fc0f7ddd92a7fd1bc4
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Sep 16 11:39:39 2011 +0200

    Redirect to ca-certificates bundle

 ...110914-Redirect-to-ca-certificates-bundle.patch |   80 ++++++++++++++++++++
 perl-Mozilla-CA.spec                               |   21 +++--
 2 files changed, 93 insertions(+), 8 deletions(-)
---
diff --git a/perl-Mozilla-CA-20110914-Redirect-to-ca-certificates-bundle.patch b/perl-Mozilla-CA-20110914-Redirect-to-ca-certificates-bundle.patch
new file mode 100644
index 0000000..d2846ac
--- /dev/null
+++ b/perl-Mozilla-CA-20110914-Redirect-to-ca-certificates-bundle.patch
@@ -0,0 +1,80 @@
+From e6aa17c2d3aa33d164d215b7b4491b31deda73f8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Fri, 16 Sep 2011 10:33:54 +0200
+Subject: [PATCH] Redirect to ca-certificates bundle
+
+This patch replaces Mozilla-CA certificate bundle with bundle
+delivered by ca-certificates RPM package used as single source of
+Mozilla certificate bundle.
+
+See <https://bugzilla.redhat.com/show_bug.cgi?id=738383> for more
+details.
+---
+ MANIFEST          |    1 -
+ Makefile.PL       |    8 ++++++++
+ lib/Mozilla/CA.pm |    8 +-------
+ t/locate-file.t   |    2 +-
+ 4 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/MANIFEST b/MANIFEST
+index a6f0a9c..096dd68 100644
+--- a/MANIFEST
++++ b/MANIFEST
+@@ -1,5 +1,4 @@
+ lib/Mozilla/CA.pm
+-lib/Mozilla/CA/cacert.pem
+ Makefile.PL
+ MANIFEST			This list of files
+ README
+diff --git a/Makefile.PL b/Makefile.PL
+index 2b10474..57f2f07 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -40,3 +40,11 @@ BEGIN {
+         ExtUtils::MakeMaker::WriteMakefile(%arg);
+     };
+ }
++
++package MY;
++sub MY::libscan {
++    my $name = shift->SUPER::libscan(@_);
++    # Remove private certificate bundle
++    if ($name =~ /cacert.pem\z/) { $name = '' };
++    return $name;
++}
+diff --git a/lib/Mozilla/CA.pm b/lib/Mozilla/CA.pm
+index 71e4b8b..71ada3a 100644
+--- a/lib/Mozilla/CA.pm
++++ b/lib/Mozilla/CA.pm
+@@ -5,14 +5,8 @@ package Mozilla::CA;
+ 
+-use Cwd ();
+ use File::Spec ();
+-use File::Basename qw(dirname);
+ 
+ sub SSL_ca_file {
+-    my $file = File::Spec->catfile(dirname(__FILE__), "CA", "cacert.pem");
+-    if (!File::Spec->file_name_is_absolute($file)) {
+-	$file = File::Spec->catfile(Cwd::cwd(), $file);
+-    }
+-    return $file;
++    return File::Spec->catfile('/etc/pki/tls/certs/ca-bundle.crt');
+ }
+ 
+ 1;
+diff --git a/t/locate-file.t b/t/locate-file.t
+index a9acb34..b936059 100644
+--- a/t/locate-file.t
++++ b/t/locate-file.t
+@@ -11,7 +11,7 @@ print "# $ca_file\n";
+ ok($ca_file);
+ ok(open(my $fh, "<", $ca_file));
+ while (<$fh>) {
+-    if (/\*\* BEGIN LICENSE BLOCK \*\*/) {
++    if (/-----BEGIN CERTIFICATE-----/) {
+ 	ok(1);
+ 	last;
+     }
+-- 
+1.7.6.2
+
diff --git a/perl-Mozilla-CA.spec b/perl-Mozilla-CA.spec
index 4ad84f2..b954de0 100644
--- a/perl-Mozilla-CA.spec
+++ b/perl-Mozilla-CA.spec
@@ -1,28 +1,30 @@
 Name:           perl-Mozilla-CA
 Version:        20110914
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Mozilla's CA cert bundle in PEM format
 License:        MPLv1.1 or LGPLv2+ or GPLv2+
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Mozilla-CA/
 Source0:        http://www.cpan.org/authors/id/A/AB/ABH/Mozilla-CA-%{version}.tar.gz
+# Bug #738383
+Patch0:         %{name}-20110914-Redirect-to-ca-certificates-bundle.patch
 BuildArch:      noarch
 BuildRequires:  perl(ExtUtils::MakeMaker)
 # Tests:
-BuildRequires:  perl(Cwd)
+BuildRequires:  ca-certificates
 BuildRequires:  perl(File::Spec)
-BuildRequires:  perl(File::Basename)
 BuildRequires:  perl(Test)
 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
+Requires:       ca-certificates
 
 %description
-Mozilla::CA provides a copy of Mozilla's bundle of certificate authority
-certificates in a form that can be consumed by modules and libraries based
-on OpenSSL.
+Mozilla::CA provides a path to ca-certificates copy of Mozilla's bundle of
+certificate authority certificates in a form that can be consumed by modules
+and libraries based on OpenSSL.
 
 %prep
 %setup -q -n Mozilla-CA-%{version}
-chmod -x update-cacert-file
+%patch0 -p1
 
 %build
 %{__perl} Makefile.PL INSTALLDIRS=vendor
@@ -39,11 +41,14 @@ make test
 
 %files
 %defattr(-,root,root,-)
-%doc README update-cacert-file
+%doc README
 %{perl_vendorlib}/*
 %{_mandir}/man3/*
 
 %changelog
+* Fri Sep 16 2011 Petr Pisar <ppisar at redhat.com> - 20110914-2
+- Redirect to ca-certificates bundle (bug #738383)
+
 * Thu Sep 15 2011 Petr Pisar <ppisar at redhat.com> - 20110914-1
 - 20110914 bump
 


More information about the scm-commits mailing list