Skip to content

Commit

Permalink
fix: use %autosetup instead of %setup
Browse files Browse the repository at this point in the history
Use %autosetup macro to uncompress all the sources
and apply patches automatically when needed.

Signed-off-by: Miguel Martín <[email protected]>
  • Loading branch information
mmartinv committed Mar 12, 2024
1 parent 7111aa7 commit 475fb1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions fido-device-onboard.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 475fb1b

Please sign in to comment.