diff --git a/Makefile b/Makefile index 37562b184..f2e1da56b 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ VENDOR_TARBALL=rpmbuild/SOURCES/fido-device-onboard-rs-$(COMMIT)-vendor-patched. $(RPM_SPECFILE): mkdir -p $(CURDIR)/rpmbuild/SPECS - sed "s/%{url}\/archive\/v%{version}\/%{name}-rs-%{version}.tar.gz/%{name}-rs-$(COMMIT).tar.gz/; s/%{name}-rs-%{version}-vendor-patched.tar.xz/%{name}-rs-$(COMMIT)-vendor-patched.tar.xz/; s/%autosetup -p1 -n %{name}-rs-%{version}/%autosetup -p1 -n %{name}-rs-$(COMMIT)/" fido-device-onboard.spec > $(RPM_SPECFILE) + sed -e "s/^Version:.*/Version: $(COMMIT)/;" fido-device-onboard.spec > $(RPM_SPECFILE) $(RPM_TARBALL): mkdir -p $(CURDIR)/rpmbuild/SOURCES diff --git a/fido-device-onboard.spec b/fido-device-onboard.spec index 5e0d1d4b6..88d430982 100644 --- a/fido-device-onboard.spec +++ b/fido-device-onboard.spec @@ -35,17 +35,19 @@ BuildRequires: tpm2-tss-devel %{summary}. %prep -%setup -q -n %{name}-rs-%{version} %if 0%{?rhel} -tar xf %{SOURCE1} +%autosetup -p1 -a1 -n %{name}-rs-%{version} +rm -f Cargo.lock %if 0%{?rhel} >= 10 %cargo_prep -v vendor %else %cargo_prep -V 1 %endif -%else -%patch -P1 -p1 +%endif + +%if 0%{?fedora} +%autosetup -p1 -n %{name}-rs-%{version} %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -a