parent
62e75a00c7
commit
a64f80bcbb
@ -0,0 +1 @@
|
||||
/sha1-0.2.0.crate
|
@ -0,0 +1,36 @@
|
||||
From 04c65ea41ddd2fb20ae56517ed6ce9be2e5d3d8f Mon Sep 17 00:00:00 2001
|
||||
From: Casey Rodarmor <casey@rodarmor.com>
|
||||
Date: Fri, 24 Feb 2017 17:07:53 -0800
|
||||
Subject: [PATCH] Update openssl dependency from 0.7 to 0.9
|
||||
|
||||
---
|
||||
src/lib.rs | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/lib.rs b/src/lib.rs
|
||||
index 33f24d1..738f95c 100644
|
||||
--- a/src/lib.rs
|
||||
+++ b/src/lib.rs
|
||||
@@ -319,8 +319,8 @@ mod tests {
|
||||
let mut bytes = [0; 512];
|
||||
|
||||
for _ in 0..20 {
|
||||
- let ty = openssl::crypto::hash::Type::SHA1;
|
||||
- let mut r = openssl::crypto::hash::Hasher::new(ty);
|
||||
+ let ty = openssl::hash::MessageDigest::sha1();
|
||||
+ let mut r = openssl::hash::Hasher::new(ty).unwrap();
|
||||
m.reset();
|
||||
for _ in 0..50 {
|
||||
let len = rng.gen::<usize>() % bytes.len();
|
||||
@@ -328,7 +328,7 @@ mod tests {
|
||||
m.update(&bytes[..len]);
|
||||
r.write(&bytes[..len]).unwrap();
|
||||
}
|
||||
- assert_eq!(r.finish(), m.digest().bytes());
|
||||
+ assert_eq!(r.finish().unwrap(), m.digest().bytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
--
|
||||
2.15.0
|
||||
|
@ -0,0 +1,71 @@
|
||||
# Generated by rust2rpm
|
||||
%bcond_without check
|
||||
%global debug_package %{nil}
|
||||
|
||||
%global crate sha1
|
||||
|
||||
Name: rust-%{crate}
|
||||
Version: 0.2.0
|
||||
Release: 3%{?dist}
|
||||
Summary: Minimal implementation of SHA1 for Rust
|
||||
|
||||
License: BSD
|
||||
URL: https://crates.io/crates/sha1
|
||||
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
|
||||
# Initial patched metadata
|
||||
# * Bump openssl to 0.9, https://github.com/mitsuhiko/rust-sha1/pull/19
|
||||
Patch0: sha1-0.2.0-fix-metadata.diff
|
||||
# Make it work with new openssl
|
||||
Patch1: 0001-Update-openssl-dependency-from-0.7-to-0.9.patch
|
||||
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
BuildRequires: rust-packaging
|
||||
%if %{with check}
|
||||
# [dev-dependencies]
|
||||
BuildRequires: (crate(openssl) >= 0.9.0 with crate(openssl) < 0.10.0)
|
||||
BuildRequires: (crate(rand) >= 0.3.0 with crate(rand) < 0.4.0)
|
||||
%endif
|
||||
|
||||
%description
|
||||
%{summary}.
|
||||
|
||||
%package devel
|
||||
Summary: %{summary}
|
||||
BuildArch: noarch
|
||||
|
||||
%description devel
|
||||
Minimal implementation of SHA1 for Rust.
|
||||
|
||||
This package contains library source intended for building other packages
|
||||
which use %{crate} from crates.io.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{crate}-%{version} -p1
|
||||
%cargo_prep
|
||||
|
||||
%build
|
||||
%cargo_build
|
||||
|
||||
%install
|
||||
%cargo_install
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
%cargo_test
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{cargo_registry}/%{crate}-%{version}/
|
||||
|
||||
%changelog
|
||||
* Wed Nov 29 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.0-3
|
||||
- Update patch
|
||||
|
||||
* Wed Jun 14 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.0-2
|
||||
- Port to use rust-packaging
|
||||
|
||||
* Mon Apr 03 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.2.0-1
|
||||
- Initial package
|
@ -0,0 +1,9 @@
|
||||
--- sha1-0.2.0/Cargo.toml 2016-07-13T16:22:04+02:00
|
||||
+++ sha1-0.2.0/Cargo.toml 2017-11-29T18:04:05.810482+01:00
|
||||
@@ -8,5 +8,5 @@
|
||||
repository = "https://github.com/mitsuhiko/rust-sha1"
|
||||
|
||||
[dev-dependencies]
|
||||
-openssl = "0.7"
|
||||
+openssl = "0.9"
|
||||
rand = "0.3"
|
Loading…
Reference in new issue