From 481f3814f937b171cf096890b0c3c2d2c8e0650d Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 12 Apr 2021 20:04:58 +0200 Subject: [PATCH] initial import (#1948145) --- .gitignore | 4 + ...build-drop-unavailable-ECC-functions.patch | 25 ++++++ README.md | 3 - nettle-sys-fix-metadata.diff | 17 ++++ rust-nettle-sys.spec | 84 +++++++++++++++++++ sources | 1 + 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 0001-build-drop-unavailable-ECC-functions.patch delete mode 100644 README.md create mode 100644 nettle-sys-fix-metadata.diff create mode 100644 rust-nettle-sys.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0c4d9bd --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/results_*/ +/*.src.rpm + +/nettle-sys-2.0.6.crate diff --git a/0001-build-drop-unavailable-ECC-functions.patch b/0001-build-drop-unavailable-ECC-functions.patch new file mode 100644 index 0000000..d0fe898 --- /dev/null +++ b/0001-build-drop-unavailable-ECC-functions.patch @@ -0,0 +1,25 @@ +From 6510e5e27937114508925efcf22c5b6fadb2631e Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 7 Apr 2021 12:16:03 +0200 +Subject: [PATCH] build: drop unavailable ECC functions + +--- + build.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/build.rs b/build.rs +index 24e2d42..eee9eb1 100644 +--- a/build.rs ++++ b/build.rs +@@ -92,6 +92,8 @@ fn real_main() -> Result<()> { + .blacklist_function("qgcvt") + .blacklist_function("qecvt_r") + .blacklist_function("qfcvt_r") ++ .blacklist_function("nettle_get_secp_192r1") ++ .blacklist_function("nettle_get_secp_224r1") + .size_t_is_usize(true); + + for p in include_paths { +-- +2.30.2 + diff --git a/README.md b/README.md deleted file mode 100644 index f12aa1f..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-nettle-sys - -The rust-nettle-sys package diff --git a/nettle-sys-fix-metadata.diff b/nettle-sys-fix-metadata.diff new file mode 100644 index 0000000..749eb4a --- /dev/null +++ b/nettle-sys-fix-metadata.diff @@ -0,0 +1,17 @@ +--- nettle-sys-2.0.6/Cargo.toml 2021-03-08T12:53:23+00:00 ++++ nettle-sys-2.0.6/Cargo.toml 2021-03-31T10:08:35.544103+00:00 +@@ -30,14 +30,5 @@ + version = ">= 0.53.1, < 0.58.0" + default-features = false + +-[build-dependencies.nettle-src] +-version = "3.5.1-0" +-optional = true +- + [build-dependencies.pkg-config] + version = "0.3" +- +-[features] +-vendored = ["nettle-src"] +-[target."cfg(target_env = \"msvc\")".build-dependencies.vcpkg] +-version = "0.2.9" diff --git a/rust-nettle-sys.spec b/rust-nettle-sys.spec new file mode 100644 index 0000000..40a2df4 --- /dev/null +++ b/rust-nettle-sys.spec @@ -0,0 +1,84 @@ +# Generated by rust2rpm 16 +%bcond_without check +%global debug_package %{nil} + +%global crate nettle-sys + +Name: rust-%{crate} +Version: 2.0.6 +Release: 1%{?dist} +Summary: Low-level Rust bindings for the Nettle cryptographic library + +# Upstream license specification: LGPL-3.0/GPL-2.0/GPL-3.0 +License: LGPLv3 or GPLv2 or GPLv3 +URL: https://crates.io/crates/nettle-sys +Source: %{crates_source} +# Initial patched metadata +# * drop feature for using vendored nettle +Patch0: nettle-sys-fix-metadata.diff +# * drop two elliptic curves that are disabled in nettle in Fedora: +# - nettle_get_secp_192r1 +# - nettle_get_secp_224r1 +Patch1: 0001-build-drop-unavailable-ECC-functions.patch + +ExclusiveArch: %{rust_arches} +%if %{__cargo_skip_build} +BuildArch: noarch +%endif + +BuildRequires: rust-packaging + +%global _description %{expand: +Low-level Rust bindings for the Nettle cryptographic library.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch +Requires: pkgconfig(nettle) + +%description devel %{_description} + +This package contains library source intended for building other packages +which use "%{crate}" crate. + +%files devel +%license LICENSE-GPL2 LICENSE-GPL3 LICENSE-LGPL3 +%doc README.md +%{cargo_registry}/%{crate}-%{version_no_tilde}/ + +%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 "default" feature of "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires +echo 'pkgconfig(nettle)' + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Thu Apr 08 2021 Fabio Valentini - 2.0.6-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..2c7be45 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (nettle-sys-2.0.6.crate) = 6865d4d9a57bbad1701c21b1acc419ea52f0f2ef5cb4596a783e2a5e6e2206a233d87e5f6d79c8ee4afce826c639860a203066a6edeca959f94f8dfb46abcd9f