From e9877fde6222c978c71843fc7c5b19fc13e7365a Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 20 Dec 2024 15:30:54 +0300 Subject: [PATCH] import rust-fiat-crypto-0.2.8-2.el10 --- .gitignore | 1 + .rust-fiat-crypto.metadata | 1 + ...es-to-code-related-to-the-p434-curve.patch | 24 ++++ SOURCES/fiat-crypto-fix-metadata.diff | 11 ++ SOURCES/gen_clean_tarball.sh | 43 ++++++ SPECS/rust-fiat-crypto.spec | 123 ++++++++++++++++++ 6 files changed, 203 insertions(+) create mode 100644 .gitignore create mode 100644 .rust-fiat-crypto.metadata create mode 100644 SOURCES/0001-remove-references-to-code-related-to-the-p434-curve.patch create mode 100644 SOURCES/fiat-crypto-fix-metadata.diff create mode 100755 SOURCES/gen_clean_tarball.sh create mode 100644 SPECS/rust-fiat-crypto.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abf7129 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/fiat-crypto-0.2.8-clean.crate diff --git a/.rust-fiat-crypto.metadata b/.rust-fiat-crypto.metadata new file mode 100644 index 0000000..f36e015 --- /dev/null +++ b/.rust-fiat-crypto.metadata @@ -0,0 +1 @@ +5b9ed60e2168ff95cd9795b767f55e9415813119 SOURCES/fiat-crypto-0.2.8-clean.crate diff --git a/SOURCES/0001-remove-references-to-code-related-to-the-p434-curve.patch b/SOURCES/0001-remove-references-to-code-related-to-the-p434-curve.patch new file mode 100644 index 0000000..2cd3ad0 --- /dev/null +++ b/SOURCES/0001-remove-references-to-code-related-to-the-p434-curve.patch @@ -0,0 +1,24 @@ +From cf64376e6c52aa7b0b764c6561c70e83947d9aa7 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Mon, 5 Feb 2024 14:52:47 +0100 +Subject: [PATCH] remove references to code related to the p434 curve + +--- + src/lib.rs | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/lib.rs b/src/lib.rs +index d6428f0..6dde59e 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -15,7 +15,6 @@ pub mod p384_32; + pub mod p384_64; + pub mod p384_scalar_32; + pub mod p384_scalar_64; +-pub mod p434_64; + pub mod p448_solinas_32; + pub mod p448_solinas_64; + pub mod p521_32; +-- +2.43.0 + diff --git a/SOURCES/fiat-crypto-fix-metadata.diff b/SOURCES/fiat-crypto-fix-metadata.diff new file mode 100644 index 0000000..072b945 --- /dev/null +++ b/SOURCES/fiat-crypto-fix-metadata.diff @@ -0,0 +1,11 @@ +--- fiat-crypto-0.2.8/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ fiat-crypto-0.2.8/Cargo.toml 2024-04-23T11:15:08.076884+00:00 +@@ -14,7 +14,7 @@ + name = "fiat-crypto" + version = "0.2.8" + authors = ["Fiat Crypto library authors "] +-description = "Fiat-crypto generated Rust" ++description = "Correct-by-Construction Code for Cryptographic Primitives" + homepage = "https://github.com/mit-plv/fiat-crypto" + readme = "README.md" + license = "MIT OR Apache-2.0 OR BSD-1-Clause" diff --git a/SOURCES/gen_clean_tarball.sh b/SOURCES/gen_clean_tarball.sh new file mode 100755 index 0000000..b08ba74 --- /dev/null +++ b/SOURCES/gen_clean_tarball.sh @@ -0,0 +1,43 @@ +#!/usr/bin/bash + +set -e + +CRATE="fiat-crypto" +NAME="rust-${CRATE}" + +VERSION=$(rpmspec -q $NAME.spec --srpm --qf "%{version}") +URL="https://crates.io/api/v1/crates/${CRATE}/${VERSION}/download" + +ROOTDIR="${CRATE}-${VERSION}" + +# download and extract published crate from crates.io +wget $URL -O ${ROOTDIR}.crate +tar -xzf ${ROOTDIR}.crate +rm ${ROOTDIR}.crate + +pushd ${ROOTDIR} + +# remove code related to the p434 curve which is not permitted in Fedora: +# https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/FBZU2X7ZKTK2BVZKBHFUCI44SMY4UQCE/ +rm src/p434_64.rs + +# clean up cargo files +rm .cargo_vcs_info.json +mv Cargo.toml.orig Cargo.toml + +# initialize git repo and remove references to code related to the p434 curve +git init +git add . +git apply ../0001-remove-references-to-code-related-to-the-p434-curve.patch +git commit -a -m "import" + +# repackage crate +cargo package + +# move clean crate +mv target/package/${ROOTDIR}.crate ../${ROOTDIR}-clean.crate +popd + +# remove temporary directory +rm -rf ${ROOTDIR} + diff --git a/SPECS/rust-fiat-crypto.spec b/SPECS/rust-fiat-crypto.spec new file mode 100644 index 0000000..71bd1b6 --- /dev/null +++ b/SPECS/rust-fiat-crypto.spec @@ -0,0 +1,123 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.7.2) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 2; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +# Generated by rust2rpm 26 +%bcond_without check +%global debug_package %{nil} + +%global crate fiat-crypto + +Name: rust-fiat-crypto +Version: 0.2.8 +Release: %autorelease +Summary: Correct-by-Construction Code for Cryptographic Primitives + +License: MIT OR Apache-2.0 OR BSD-1-Clause +URL: https://crates.io/crates/fiat-crypto +Source: %{crate}-%{version}-clean.crate +# script to create tarball with only permissible content: +# run "rust2rpm" and then "./gen_clean_tarball.sh" for new versions +Source: gen_clean_tarball.sh +Source: 0001-remove-references-to-code-related-to-the-p434-curve.patch +# Manually created patch for downstream crate metadata changes +# * change crate description to something more meaningful +Patch: fiat-crypto-fix-metadata.diff + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +Correct-by-Construction Code for Cryptographic Primitives.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/COPYRIGHT +%license %{crate_instdir}/LICENSE-APACHE +%license %{crate_instdir}/LICENSE-BSD-1 +%license %{crate_instdir}/LICENSE-MIT +%doc %{crate_instdir}/AUTHORS +%doc %{crate_instdir}/CONTRIBUTORS +%doc %{crate_instdir}/README.md +%{crate_instdir}/ + +%package -n %{name}+default-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+default-devel %{_description} + +This package contains library source intended for building other packages which +use the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+std-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+std-devel %{_description} + +This package contains library source intended for building other packages which +use the "std" feature of the "%{crate}" crate. + +%files -n %{name}+std-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Fri Dec 20 2024 MSVSphere Packaging Team - 0.2.8-2 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Fri Jul 19 2024 Fedora Release Engineering - 0.2.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Apr 23 2024 Fabio Valentini - 0.2.8-1 +- Update to version 0.2.8; Fixes RHBZ#2270380 + +* Mon Feb 05 2024 Fabio Valentini - 0.2.6-1 +- Update to version 0.2.6; Fixes RHBZ#2236364 + +* Fri Jan 26 2024 Fedora Release Engineering - 0.1.20-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 0.1.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jun 15 2023 Fabio Valentini - 0.1.20-1 +- Initial import (#2213270) +## END: Generated by rpmautospec