ppisar pushed to perl-Crypt-OpenSSL-EC (master). "Import"
notifications at fedoraproject.org
notifications at fedoraproject.org
Tue Apr 28 13:32:32 UTC 2015
>From 5b177f11f46218d677d9f89fe6e6aa36b6e07c85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Tue, 28 Apr 2015 15:31:43 +0200
Subject: Import
diff --git a/.gitignore b/.gitignore
index e69de29..6131d4a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/Crypt-OpenSSL-EC-1.01.tar.gz
diff --git a/Crypt-OpenSSL-EC-1.01-Skip-prime-field-tests-if-OpenSSL-does-not-suppport-.patch b/Crypt-OpenSSL-EC-1.01-Skip-prime-field-tests-if-OpenSSL-does-not-suppport-.patch
new file mode 100644
index 0000000..d18955f
--- /dev/null
+++ b/Crypt-OpenSSL-EC-1.01-Skip-prime-field-tests-if-OpenSSL-does-not-suppport-.patch
@@ -0,0 +1,74 @@
+From 89a1e4be8bccf793478fc07aac7003121de73dc3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Mon, 27 Apr 2015 16:01:52 +0200
+Subject: [PATCH] Skip prime-field tests if OpenSSL does not suppport EC2M
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+prime-field.t exhibits many function calls with arguments that are not
+support by OpenSSL if it was built without EC2M support.
+
+It's easier to skip all the tests instead of skipping almost all of
+them. This patch does that if <openssl/opensslconf.h> defines
+OPENSSL_NO_EC2M.
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+
+diff --git a/Makefile.PL b/Makefile.PL
+index edacc74..4290278 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -10,6 +10,9 @@ WriteMakefile(
+ NAME => 'Crypt::OpenSSL::EC',
+ VERSION_FROM => 'lib/Crypt/OpenSSL/EC.pm',
+ PREREQ_PM => { 'Crypt::OpenSSL::Bignum' => 0.04,
++ 'ExtUtils::CBuilder' => 0,
++ 'File::Spec' => 0,
++ 'File::Temp' => 0,
+ },
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'lib/Crypt/OpenSSL/EC.pm', # retrieve abstract from module
+diff --git a/t/prime-field.t b/t/prime-field.t
+index 0a9a2d9..033c0bf 100644
+--- a/t/prime-field.t
++++ b/t/prime-field.t
+@@ -7,7 +7,34 @@ use Crypt::OpenSSL::Bignum::CTX;
+
+ BEGIN { use_ok('Crypt::OpenSSL::EC') };
+
+-&prime_field_tests();
++
++# Check OpenSSL supports EC2M
++my $no_ec2m = 1;
++{
++ use File::Spec;
++ use File::Temp;
++ use ExtUtils::CBuilder;
++ my $dir = File::Temp::tempdir(CLEANUP => 1);
++ my $file = File::Spec->catfile($dir, 'test.c');
++ open my $fh, '>', $file or die;
++ print $fh <<TEST;
++#include <openssl/opensslconf.h>
++#ifdef OPENSSL_NO_EC2M
++#error EC2M disabled
++#endif
++TEST
++ close $fh or die;
++ my $object;
++ eval { $object = ExtUtils::CBuilder->new->compile(source => $file) };
++ if (defined $object) {
++ $no_ec2m = 0;
++ }
++}
++
++SKIP: {
++ skip('OpenSSL does not support EC2M', 262) if $no_ec2m;
++ &prime_field_tests();
++};
+
+ sub prime_field_tests()
+ {
+--
+2.1.0
+
diff --git a/perl-Crypt-OpenSSL-EC.spec b/perl-Crypt-OpenSSL-EC.spec
new file mode 100644
index 0000000..6e91f92
--- /dev/null
+++ b/perl-Crypt-OpenSSL-EC.spec
@@ -0,0 +1,62 @@
+Name: perl-Crypt-OpenSSL-EC
+Version: 1.01
+Release: 1%{?dist}
+Summary: Perl extension for OpenSSL EC (Elliptic Curves) library
+License: GPL+ or Artistic
+Group: Development/Libraries
+URL: http://search.cpan.org/dist/Crypt-OpenSSL-EC/
+Source0: http://www.cpan.org/authors/id/M/MI/MIKEM/Crypt-OpenSSL-EC-%{version}.tar.gz
+# Skip tests exercising disabled EC2M OpenSSL feature, CPAN RT#104000
+Patch0: Crypt-OpenSSL-EC-1.01-Skip-prime-field-tests-if-OpenSSL-does-not-suppport-.patch
+BuildRequires: openssl-devel
+BuildRequires: perl
+# Use ExtUtils::Constant to regenerated XS code
+BuildRequires: perl(ExtUtils::Constant)
+BuildRequires: perl(ExtUtils::MakeMaker)
+BuildRequires: perl(File::Copy)
+BuildRequires: perl(File::Spec)
+# Run-time:
+BuildRequires: perl(AutoLoader)
+BuildRequires: perl(Carp)
+BuildRequires: perl(Exporter)
+BuildRequires: perl(strict)
+BuildRequires: perl(warnings)
+BuildRequires: perl(XSLoader)
+# Tests:
+BuildRequires: perl(Crypt::OpenSSL::Bignum) >= 0.04
+BuildRequires: perl(Crypt::OpenSSL::Bignum::CTX)
+BuildRequires: perl(ExtUtils::CBuilder)
+BuildRequires: perl(File::Temp)
+BuildRequires: perl(Test::More)
+Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+
+%description
+This package provides a Perl standard (non-object-oriented) interface to the
+OpenSSL Elliptic Curve library. Some object-oriented calls are supported.
+
+%prep
+%setup -q -n Crypt-OpenSSL-EC-%{version}
+%patch0 -p1
+
+%build
+perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
+make %{?_smp_mflags}
+
+%install
+make pure_install DESTDIR=$RPM_BUILD_ROOT
+find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
+find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
+%{_fixperms} $RPM_BUILD_ROOT/*
+
+%check
+make test
+
+%files
+%doc Changes README
+%{perl_vendorarch}/auto/*
+%{perl_vendorarch}/Crypt*
+%{_mandir}/man3/*
+
+%changelog
+* Mon Apr 27 2015 Petr Pisar <ppisar at redhat.com> 1.01-1
+- Specfile autogenerated by cpanspec 1.78.
diff --git a/sources b/sources
index e69de29..51c8a3e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+742f192f26bcac2249017cdd9e8bac35 Crypt-OpenSSL-EC-1.01.tar.gz
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/perl-Crypt-OpenSSL-EC.git/commit/?h=master&id=5b177f11f46218d677d9f89fe6e6aa36b6e07c85
More information about the perl-devel
mailing list