From 724db304321bd3087b8fe468f7d9cd811c70d970 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Thu, 5 Jan 2023 15:08:52 -0600 Subject: [PATCH] Initial Fedora package Signed-off-by: Michel Alexandre Salim --- .gitignore | 1 + difftastic-fix-metadata.diff | 11 +++++++ rust-difftastic.spec | 61 ++++++++++++++++++++++++++++++++++++ sources | 1 + 4 files changed, 74 insertions(+) create mode 100644 .gitignore create mode 100644 difftastic-fix-metadata.diff create mode 100644 rust-difftastic.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cafbb02 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/difftastic-0.39.0.crate diff --git a/difftastic-fix-metadata.diff b/difftastic-fix-metadata.diff new file mode 100644 index 0000000..9c1c345 --- /dev/null +++ b/difftastic-fix-metadata.diff @@ -0,0 +1,11 @@ +--- difftastic-0.39.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ difftastic-0.39.0/Cargo.toml 2022-12-21T21:12:30.563928+00:00 +@@ -55,7 +55,7 @@ + version = "0.2.108" + + [dependencies.libmimalloc-sys] +-version = "=0.1.24" ++version = "0.1" + + [dependencies.log] + version = "0.4.14" diff --git a/rust-difftastic.spec b/rust-difftastic.spec new file mode 100644 index 0000000..b50ec2e --- /dev/null +++ b/rust-difftastic.spec @@ -0,0 +1,61 @@ +# Generated by rust2rpm 23 +%bcond_without check + +%global crate difftastic + +Name: rust-difftastic +Version: 0.39.0 +Release: %autorelease +Summary: Structural diff that understands syntax + +License: MIT +URL: https://crates.io/crates/difftastic +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +Patch: difftastic-fix-metadata.diff + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +Structural diff that understands syntax.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: (Apache-2.0 OR MIT) AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND MIT AND (MIT OR Unlicense) AND Zlib +# LICENSE.dependencies contains a full license breakdown + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%if 0%{?fedora} +%license LICENSE.dependencies +%endif +%doc README.md +%{_bindir}/difft + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build +%if 0%{?fedora} +%{cargo_license} > LICENSE.dependencies +%endif + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..5c1fe47 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (difftastic-0.39.0.crate) = 16acfa2d3b0002bf104dfcffa9c54294d22b2abd8748f3398004aa5b70a3995a5fd598a14ce287e3a1dd24f3d2790d77be7e909fabe4caa87cab8862a79e6da8