Skip to content

Commit

Permalink
Merge pull request #444 from bgurney-rh/remove-vendor-mock-patch
Browse files Browse the repository at this point in the history
Revert stratisd.spec file 3.5.8 patch configuration
  • Loading branch information
bgurney-rh authored Aug 1, 2023
2 parents b32d10e + 3e1127a commit a049de6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 83 deletions.
37 changes: 5 additions & 32 deletions mockbuild_test/stratisd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ Summary: Daemon that manages block devices to create filesystems

License: MPL-2.0
URL: https://github.com/stratis-storage/stratisd
Source0: %{url}/archive/stratisd-v%{version}/%{name}-%{version}.tar.gz
Source1: %{url}/releases/download/stratisd-v%{version}/%{name}-%{version}-vendor.tar.gz
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: %{url}/releases/download/v%{version}/%{name}-%{version}-vendor.tar.gz
Source2: %{crates_source}

Patch0: vendor-serde_derive.patch

ExclusiveArch: %{rust_arches}
%if 0%{?rhel}
Expand Down Expand Up @@ -85,38 +84,12 @@ Requires: stratisd
%{summary}. This package should not be used in production.

%prep
# Rename SOURCE0's top-level directory because it starts with
# stratisd-stratisd-v. GitHub calculates the directory name from the repo name
# + the tag. Extract the upstream crate on top of the extracted GitHub release,
# overwriting changed files. The primary purpose of this step is to ensure that
# the Cargo.toml that is used in building is the one that is generated by
# cargo-publish and cargo-package, not the file with path dependencies that
# GitHub packs up. Tar the overwritten files back up again into a tar file
# with the format and top-level directory that %setup expects cleaning up the
# previously extracted directory and its contents at the same time. Move the
# newly created tar file to the SOURCE0 location.
tar --transform="s/^stratisd\-stratisd-v/stratisd-/" --extract --file %{SOURCE0}
tar --extract --overwrite --file %{SOURCE2}
tar --create --gzip --file %{SOURCE0}.newfile ./stratisd-%{version} --remove-files
mv %{SOURCE0}.newfile %{SOURCE0}

%setup -q

tar --strip-components=1 --extract --verbose --file %{SOURCE2}
# Patches must be applied after the upstream package is extracted.
%if 0%{?rhel}

# Untar the vendor tarfile.
tar --extract --file %{SOURCE1}

# Remove pre-compiled procedural macro, compile from source
rm ./vendor/serde_derive/serde_derive-x86_64-unknown-linux-gnu
%patch0 -p1

# Rezip the tarfile
tar --create --gzip --file %{SOURCE1}.newfile ./vendor --remove-files
mv %{SOURCE1}.newfile %{SOURCE1}

# Source1 is vendored dependencies
%cargo_prep -V 1

%else
%cargo_prep
%generate_buildrequires
Expand Down
51 changes: 0 additions & 51 deletions mockbuild_test/vendor-serde_derive.patch

This file was deleted.

0 comments on commit a049de6

Please sign in to comment.