diff --git a/libvirt.spec.in b/libvirt.spec.in index 45a8fe0e32..1946a153a1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1,5 +1,13 @@ # -*- rpm-spec -*- +# If neither fedora nor rhel was defined, try to guess them from %{dist} +%if !0%{?rhel} && !0%{?fedora} +%{expand:%(echo "%{?dist}" | \ + sed -ne 's/^\.el\([0-9]\+\).*/%%define rhel \1/p')} +%{expand:%(echo "%{?dist}" | \ + sed -ne 's/^\.fc\?\([0-9]\+\).*/%%define fedora \1/p')} +%endif + # A client only build will create a libvirt.so only containing # the generic RPC driver, and test driver and no libvirtd # Default to a full server + client build