From 079a2fb8fdcf187b271312fd9ed3046d2f1a9f8a Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 13 Jun 2023 17:21:42 +0200 Subject: [PATCH] Regenerate with rust2rpm v24 and add missing license file --- LICENCE | 21 +++++++++++++++++ README.md | 3 --- number_prefix-fix-metadata.diff | 11 +++++++++ rust-number_prefix.spec | 40 ++++++++++++++++----------------- 4 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 LICENCE delete mode 100644 README.md create mode 100644 number_prefix-fix-metadata.diff diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..c38fffa --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Benjamin Sago + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 559bf8d..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-number_prefix - -The rust-number_prefix package \ No newline at end of file diff --git a/number_prefix-fix-metadata.diff b/number_prefix-fix-metadata.diff new file mode 100644 index 0000000..44dbc80 --- /dev/null +++ b/number_prefix-fix-metadata.diff @@ -0,0 +1,11 @@ +--- number_prefix-0.4.0/Cargo.toml 2020-04-07T01:48:03+00:00 ++++ number_prefix-0.4.0/Cargo.toml 2023-06-07T21:02:59.522207+00:00 +@@ -14,7 +14,7 @@ + name = "number_prefix" + version = "0.4.0" + authors = ["Benjamin Sago "] +-exclude = ["/README.md", "/LICENCE", "/.rustfmt.toml", "/.travis.yml"] ++exclude = ["/README.md", "/.rustfmt.toml", "/.travis.yml"] + description = "Library for numeric prefixes (kilo, giga, kibi)." + documentation = "https://docs.rs/number_prefix" + readme = "README.md" diff --git a/rust-number_prefix.spec b/rust-number_prefix.spec index ab97ac3..db569ae 100644 --- a/rust-number_prefix.spec +++ b/rust-number_prefix.spec @@ -1,26 +1,24 @@ -# Generated by rust2rpm 18 +# Generated by rust2rpm 24 %bcond_without check %global debug_package %{nil} %global crate number_prefix -Name: rust-%{crate} +Name: rust-number_prefix Version: 0.4.0 Release: %autorelease Summary: Library for numeric prefixes (kilo, giga, kibi) -# Upstream license specification: MIT -# https://github.com/ogham/rust-number-prefix/pull/8 License: MIT URL: https://crates.io/crates/number_prefix -Source: %{crates_source} +Source0: %{crates_source} +Source1: https://github.com/ogham/rust-number-prefix/raw/v%{version}/LICENCE +# Manually created patch for downstream crate metadata changes +# * do not exclude license text from installed files +# https://github.com/ogham/rust-number-prefix/pull/8 +Patch: number_prefix-fix-metadata.diff -ExclusiveArch: %{rust_arches} -%if %{__cargo_skip_build} -BuildArch: noarch -%endif - -BuildRequires: rust-packaging +BuildRequires: rust-packaging >= 21 %global _description %{expand: Library for numeric prefixes (kilo, giga, kibi).} @@ -33,11 +31,12 @@ BuildArch: noarch %description devel %{_description} -This package contains library source intended for building other packages -which use "%{crate}" crate. +This package contains library source intended for building other packages which +use the "%{crate}" crate. %files devel -%{cargo_registry}/%{crate}-%{version_no_tilde}/ +%license %{crate_instdir}/LICENCE +%{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} @@ -45,11 +44,11 @@ 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. +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 %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml %package -n %{name}+std-devel Summary: %{summary} @@ -57,15 +56,16 @@ BuildArch: noarch %description -n %{name}+std-devel %{_description} -This package contains library source intended for building other packages -which use "std" feature of "%{crate}" crate. +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 %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml +%ghost %{crate_instdir}/Cargo.toml %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 %cargo_prep +cp -pav %{SOURCE1} . %generate_buildrequires %cargo_generate_buildrequires