When a distribution tarball is created (python3 -m build -n -s) the
dist_name in the spec file included in that tarball must match the
actual tarball name. The tarball name depends on the setuptools version
used to create it rather than on the version of setuptools installed on
the system RPMs are built.
Fixes:
ed8ab5075d9190fdcd2894412d2127ac2a1d9535
Reported-by: Daniel P. Berrangé <[email protected]>
Signed-off-by: Jiri Denemark <[email protected]>
%define supported_platform 0
%endif
-%if 0%{?rhel} || 0%{?fedora} < 42
- %define dist_name %{name}
-%else
- %define dist_name libvirt_python
-%endif
+%define dist_name @DIST_NAME@
Summary: The libvirt virtualization API python3 binding
Name: libvirt-python
@@ -197,9 +197,13 @@ class my_sdist(sdist):
f_out.write(line)
def gen_rpm_spec(self):
+ full_name = self.distribution.get_fullname()
+ dist_name = full_name[:full_name.rfind("-")]
+
return self._gen_from_in("libvirt-python.spec.in",
"libvirt-python.spec",
- {"@VERSION@": getVersion()})
+ {"@VERSION@": getVersion(),
+ "@DIST_NAME@": dist_name})
def gen_authors(self):