Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stratisd.spec: Update Rust macro usage #515

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions mockbuild_test/stratisd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ Requires: stratisd
%{summary}. This package should not be used in production.

%prep
%autosetup -n stratisd-stratisd-v%{version}
%autosetup -n stratisd-stratisd-v%{version} %{?rhel:-a1}

%if 0%{?rhel}
%if 0%{?rhel} >= 10
%cargo_prep -v vendor
%elif 0%{?rhel} && 0%{?rhel} < 10
%cargo_prep -V 1
%else
%cargo_prep
Expand All @@ -94,7 +96,7 @@ Requires: stratisd
%endif

%build
%if 0%{?rhel}
%if 0%{?rhel} && 0%{?rhel} < 10
%{__cargo} build %{?_smp_mflags} --release --bin=stratisd
%{__cargo} build %{?_smp_mflags} --release --bin=stratis-min --bin=stratisd-min --bin=stratis-utils --no-default-features --features engine,min,systemd_compat
%{__cargo} rustc %{?_smp_mflags} --release --bin=stratis-str-cmp --no-default-features --features udev_scripts -- -Ctarget-feature=+crt-static
Expand All @@ -110,13 +112,16 @@ Requires: stratisd
%endif
a2x -f manpage docs/stratisd.txt
a2x -f manpage docs/stratis-dumpmetadata.txt
%if 0%{?rhel} >= 10
%{cargo_vendor_manifest}
%endif

%install
%make_install DRACUTDIR=%{dracutdir} PROFILEDIR=release

%if %{with check}
%check
%if 0%{?rhel}
%if 0%{?rhel} && 0%{?rhel} < 10
%cargo_test --no-run
%else
%cargo_test -- --no-run
Expand All @@ -134,10 +139,12 @@ a2x -f manpage docs/stratis-dumpmetadata.txt

%files
%license LICENSE
%if 0%{?rhel}
%else
%if !(0%{?rhel} && 0%{?rhel} < 10)
%license LICENSE.dependencies
%endif
%if 0%{?rhel} >= 10
%license cargo-vendor.txt
%endif
%doc README.md
%{_libexecdir}/stratisd
%dir %{_datadir}/dbus-1
Expand Down