From e9706a7124731b603260d14383c4f64d0f7b93e9 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 8 Feb 2024 12:26:19 -0500 Subject: [PATCH] Update Rust macro usage The rust-toolset macros in RHEL 10 are now compatible with Fedora's in terms of handling vendoring and automatic generation of license information and bundled provides. --- device-mapper-persistent-data.spec | 61 +++++++----------------------- 1 file changed, 13 insertions(+), 48 deletions(-) diff --git a/device-mapper-persistent-data.spec b/device-mapper-persistent-data.spec index 13e1bca..c901155 100644 --- a/device-mapper-persistent-data.spec +++ b/device-mapper-persistent-data.spec @@ -10,7 +10,7 @@ Summary: Device-mapper Persistent Data Tools Name: device-mapper-persistent-data Version: 1.0.11 -Release: 1%{?dist}%{?release_suffix} +Release: 2%{?dist}%{?release_suffix} License: GPLv3+ #ExcludeArch: %%{ix86} URL: https://github.com/jthornber/thin-provisioning-tools @@ -37,52 +37,8 @@ are included and era check, dump, restore and invalidate to manage snapshot eras %prep -%autosetup -p1 -n thin-provisioning-tools-%{version}%{?version_suffix} -#%%cargo_prep -#%%cargo_generate_buildrequires -tar xf %{SOURCE1} -mkdir -p .cargo -( -# Part from %%cargo_prep: -set -euo pipefail -/usr/bin/mkdir -p target/rpm -/usr/bin/ln -s rpm target/release -/usr/bin/rm -rf .cargo/ -/usr/bin/mkdir -p .cargo -cat > .cargo/config << EOF -[build] -rustc = "/usr/bin/rustc" -rustdoc = "/usr/bin/rustdoc" - -[profile.rpm] -inherits = "release" -opt-level = 3 -codegen-units = 1 -debug = 2 -strip = "none" - -[env] -CFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " -CXXFLAGS = "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer " -LDFLAGS = "-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 " - -[install] -root = "/home/mcsontos/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr" - -[term] -verbose = true -EOF - -# Our own part: -cat >> .cargo/config < VERSION %generate_buildrequires @@ -90,6 +46,9 @@ echo %{version}-%{release} > VERSION %build #make %{?_smp_mflags} V= %cargo_build +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies +%cargo_vendor_manifest %if %{with check} %check @@ -102,7 +61,10 @@ echo %{version}-%{release} > VERSION %make_install MANDIR=%{_mandir} %files -%doc COPYING README.md +%doc README.md +%license COPYING +%license LICENSE.dependencies +%license cargo-vendor.txt %{_mandir}/man8/cache_check.8.gz %{_mandir}/man8/cache_dump.8.gz %{_mandir}/man8/cache_metadata_size.8.gz @@ -149,6 +111,9 @@ echo %{version}-%{release} > VERSION #% {_sbindir}/thin_show_duplicates %changelog +* Thu Feb 08 2024 Yaakov Selkowitz - 1.0.11-2 +- Update Rust macro usage + * Thu Feb 08 2024 Marian Csontos - 1.0.11-1 - Update to latest upstream release 1.0.11.