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

[Libvir] Re: Fedora spec file changes



On Mon, 2008-04-28 at 12:23 +0100, Mark McLoughlin wrote:

> 	Finally, here's some changes to how arch conditionals are handed in the
> spec file - what prompted this was the way we were enabling with_proxy
> even when with_xen was disabled, causing the proxy to be in the files
> section even when it wasn't built. Please give it a look over before I
> built in dist-f10.

	Bah, see below.

Cheers,
Mark.

Index: libvirt.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libvirt/devel/libvirt.spec,v
retrieving revision 1.84
diff -u -p -r1.84 libvirt.spec
--- libvirt.spec	28 Apr 2008 10:24:38 -0000	1.84
+++ libvirt.spec	28 Apr 2008 11:12:02 -0000
@@ -1,23 +1,30 @@
 # -*- rpm-spec -*-
 
-%if "%{fedora}" >= "8"
-%define with_polkit 1
-%define with_lokkit 1
-%define with_proxy no
-%else
-%define with_polkit 0
-%define with_lokkit 0
-%define with_proxy yes
+%define with_xen       1
+%define with_xen_proxy 1
+%define with_qemu      1
+%define with_polkit    0
+%define with_lokkit    0
+
+# Xen is available only on i386 x86_64 ia64
+%ifnarch i386 i686 x86_64 ia64
+%define with_xen 0
+%endif
+
+%if ! %{with_xen}
+%define with_xen_proxy 0
 %endif
 
 %if "%{fedora}"
 %ifarch ppc64
 %define with_qemu 0
-%else
-%define with_qemu 1
 %endif
-%else
-%define with_qemu 0
+%endif
+
+%if "%{fedora}" >= "8"
+%define with_polkit    1
+%define with_lokkit    1
+%define with_xen_proxy 0
 %endif
 
 Summary: Library providing a simple API virtualization
@@ -51,12 +58,11 @@ Requires: /usr/sbin/lokkit
 %endif
 # For mount/umount in FS driver
 BuildRequires: util-linux
-# PPC64 has no Xen nor QEmu, try to build anyway
-%ifnarch ppc64
 %if %{with_qemu}
 # From QEMU RPMs
 Requires: /usr/bin/qemu-img
 %else
+%if %{with_xen}
 # From Xen RPMs
 Requires: /usr/sbin/qcow-create
 %endif
@@ -67,7 +73,7 @@ Requires: lvm2
 Requires: iscsi-initiator-utils
 # For disk driver
 Requires: parted
-%ifarch i386 x86_64 ia64
+%if %{with_xen}
 BuildRequires: xen-devel
 %endif
 BuildRequires: libxml2-devel
@@ -91,12 +97,11 @@ BuildRequires: /usr/sbin/lokkit
 %endif
 # For mount/umount in FS driver
 BuildRequires: util-linux
-# PPC64 has no Xen nor QEmu, try to build anyway
-%ifnarch ppc64
 %if %{with_qemu}
 # From QEMU RPMs
 BuildRequires: /usr/bin/qemu-img
 %else
+%if %{with_xen}
 # From Xen RPMs
 BuildRequires: /usr/sbin/qcow-create
 %endif
@@ -121,7 +126,7 @@ Summary: Libraries, includes, etc. to co
 Group: Development/Libraries
 Requires: libvirt = %{version}
 Requires: pkgconfig
-%ifarch i386 x86_64 ia64
+%if %{with_xen}
 Requires: xen-devel
 %endif
 Obsoletes: libvir-devel
@@ -146,27 +151,19 @@ of recent versions of Linux (and other O
 %setup -q
 
 %build
-# Xen is available only on i386 x86_64 ia64
-%ifarch i386 i686 x86_64 ia64
-%configure --with-init-script=redhat \
-           --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
-           --with-remote-file=%{_localstatedir}/run/libvirtd.pid \
-           --with-xen-proxy=%{with_proxy}
-%else
-%ifnarch ppc64
-%configure --without-xen \
-           --with-init-script=redhat \
-           --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
-           --with-remote-file=%{_localstatedir}/run/libvirtd.pid
-%else
-%configure --without-xen \
-           --without-qemu \
-           --with-init-script=redhat \
-           --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
-           --with-remote-file=%{_localstatedir}/run/libvirtd.pid
+%if ! %{with_xen}
+%define _without_xen --without-xen
 %endif
+
+%if ! %{with_qemu}
+%define _without_qemu --without_qemu
 %endif
 
+%configure %{?_without_xen} \
+           %{?_without_qemu} \
+           --with-init-script=redhat \
+           --with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
+           --with-remote-file=%{_localstatedir}/run/libvirtd.pid
 make
 
 %install
@@ -251,11 +248,9 @@ fi
 %{_datadir}/PolicyKit/policy/libvirtd.policy
 %endif
 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
-%ifarch i386 i686 x86_64 ia64
-%if %{with_proxy} == "yes"
+%if %{with_xen_proxy}
 %attr(4755, root, root) %{_libexecdir}/libvirt_proxy
 %endif
-%endif
 %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
 %attr(0755, root, root) %{_sbindir}/libvirtd
 %doc docs/*.rng



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