From 7f9d77a7630a9fb2c29e4f89f6df33903fafda37 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Tue, 12 Apr 2022 15:47:32 -0700 Subject: [PATCH] Initial Fedora package Signed-off-by: Michel Alexandre Salim --- .gitignore | 1 + rust-sys-locale.spec | 75 ++++++++++++++++++++++++++++++++++++ sources | 1 + sys-locale-fix-metadata.diff | 19 +++++++++ 4 files changed, 96 insertions(+) create mode 100644 .gitignore create mode 100644 rust-sys-locale.spec create mode 100644 sources create mode 100644 sys-locale-fix-metadata.diff diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3562aa6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/sys-locale-0.2.0.crate diff --git a/rust-sys-locale.spec b/rust-sys-locale.spec new file mode 100644 index 0000000..590eb6c --- /dev/null +++ b/rust-sys-locale.spec @@ -0,0 +1,75 @@ +# Generated by rust2rpm 21 +%bcond_without check +%global debug_package %{nil} + +%global crate sys-locale + +Name: rust-%{crate} +Version: 0.2.0 +Release: %autorelease +Summary: Small and lightweight library to obtain the active system locale + +# Upstream license specification: MIT OR Apache-2.0 +License: MIT or ASL 2.0 +URL: https://crates.io/crates/sys-locale +Source: %{crates_source} +# Drop dependencies for non-Linux targets +Patch: sys-locale-fix-metadata.diff + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +Small and lightweight library to obtain the active system locale.} + +%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}/LICENSE-APACHE +%license %{crate_instdir}/LICENSE-MIT +%doc %{crate_instdir}/CHANGELOG.md +%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 + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..79da5e2 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (sys-locale-0.2.0.crate) = f3b7fad804090511e55d16fed6415894ce5e76a68196d2e7920a7567a00f0108127c2eb91e7a2fd992e2ae63516b39a4b3ae71f80226c4c60db7c32797e15886 diff --git a/sys-locale-fix-metadata.diff b/sys-locale-fix-metadata.diff new file mode 100644 index 0000000..96c95d7 --- /dev/null +++ b/sys-locale-fix-metadata.diff @@ -0,0 +1,19 @@ +--- sys-locale-0.2.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ sys-locale-0.2.0/Cargo.toml 2022-04-04T23:17:37.714971+00:00 +@@ -20,16 +20,4 @@ + repository = "https://github.com/1Password/sys-locale" + [build-dependencies.cc] + version = "1.0" +-[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.cstr_core] +-version = "0.2" + +-[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.libc] +-version = "0.2" +-[target."cfg(target_arch = \"wasm32\")".dependencies.web-sys] +-version = "0.3" +-features = ["Window", "Navigator"] +-[target."cfg(target_os = \"android\")".dependencies.libc] +-version = "0.2" +-[target."cfg(windows)".dependencies.winapi] +-version = "0.3" +-features = ["winnls"]