[PATCH] spec: Guess rhel/fedora macros from dist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
If anyone knows how to make rpm to evaluate %(...) immediately and not
at every appearance of rhel/fedora, that would be really cool.

 libvirt.spec.in |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 02be928..bfc9206 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1,5 +1,11 @@
 # -*- rpm-spec -*-
 
+# if neither fedora nor rhel was defined, try to guess them from %{dist}
+%if !0%{?rhel} && !0%{?fedora}
+%define rhel %(echo "%{?dist}" | sed -ne 's/^\\.el\\([0-9]\\+\\).*/\\1/p')
+%define fedora %(echo "%{?dist}" | sed -ne 's/^\\.fc\\?\\([0-9]\\+\\).*/\\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
-- 
1.7.4.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]