diff --git a/nmstate.spec b/nmstate.spec index 9fedc11..9310b3a 100644 --- a/nmstate.spec +++ b/nmstate.spec @@ -78,12 +78,23 @@ This package contains the Python 3 library for Nmstate. %prep gpg2 --import --import-options import-export,import-minimal %{SOURCE2} > ./gpgkey-mantainers.gpg gpgv2 --keyring ./gpgkey-mantainers.gpg %{SOURCE1} %{SOURCE0} -%autosetup -p1 + +%autosetup -n %{name}-%{version_no_tilde} -p1 %{?rhel:-a3} + +# If we have a patch for a vendored dependency, cargo refuses to build, +# in order to prevent accidental manual changes to vendored crates. +# This is not needed in an rpm build. Clear the list of files for which +# to check the checksum. +find vendor -name .cargo-checksum.json \ + -exec sed -i.uncheck -e 's/"files":{[^}]*}/"files":{ }/' '{}' '+' pushd rust -# Source3 is vendored dependencies -%cargo_prep -V 3 - +%if 0%{?rhel} +mv ../vendor ./ +%cargo_prep -v vendor +%else +%cargo_prep +%endif popd %build @@ -92,6 +103,11 @@ pushd rust/src/python popd pushd rust %cargo_build +%cargo_license_summary +%{cargo_license} > ../LICENSE.dependencies +%if 0%{?rhel} +%cargo_vendor_manifest +%endif popd %install @@ -108,6 +124,10 @@ popd %files %doc README.md +%license LICENSE.dependencies +%if 0%{?rhel} +%license rust/cargo-vendor.txt +%endif %doc examples/ %{_mandir}/man8/nmstate.service.8* %{_mandir}/man8/nmstatectl.8*