File virt-utils.spec of Package virt-utils.import5774

# spec file for package virt-utils
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# norootforbuild

%define qemu_utils 1
%define internal_utils 1
%define provide_duplicated_binaries 0

Name:           virt-utils
BuildRequires:  zlib-devel
Version:        1.1.5
Release:        1.<RELEASE4>
License:        GPLv2
Group:          System/Kernel
Summary:        Virtualization Utilities
Source0:        qemu-0.14.0.tar.bz2
Source1:        vm-snapshot-disk
Patch1:         qemu-img-vmdk-scsi.patch
Patch2:         qemu-img-git-vpc-fix.patch
Patch3:         qemu-img-vpc-fixed-disk.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Various virtualization solutions have a common need for ancillary
utilities which manage storage, snapshotting, monitoring, etc.

Both KVM and Xen derive their device and machine model from qemu and
inherit a lot from it's approach to emulation/virtualization.  This
package is hence a good place to have qemu related tools reside. 
Additionally, any other utilities which have use across the various
virtualization solutions available have a home here.

    Fabrice Bellard
    Ron Terry

%if %{?qemu_utils}0
%setup -q -n qemu-0.14.0
%patch1 -p1
%patch2 -p1
%patch3 -p1

%if %{?qemu_utils}0
./configure --prefix=%{_prefix} \
make qemu-img
make qemu-nbd
make qemu-img.1
make qemu-nbd.8

%if %{?qemu_utils}0
mkdir -p %{buildroot}%{_bindir}
install -s -m 755 qemu-img %{buildroot}%_bindir/qemu-img
install -s -m 755 qemu-nbd %{buildroot}%_bindir/qemu-nbd
%if %{provide_duplicated_binaries}0 
ln -s qemu-img %{buildroot}%_bindir/qemu-img-xen
ln -s qemu-img %{buildroot}%_bindir/qemu-img-kvm
ln -s qemu-nbd %{buildroot}%_bindir/qemu-nbd-xen
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_mandir}/man8
install -m644 qemu-img.1 %{buildroot}%_mandir/man1/qemu-img.1
install -m644 qemu-nbd.8 %{buildroot}%_mandir/man8/qemu-nbd.8
%if %{?internal_utils}0
install -m 755 %SOURCE1 $RPM_BUILD_ROOT/usr/bin

rm -rf ${RPM_BUILD_ROOT}

%defattr(-, root, root)
%if %{?qemu_utils}0
%if %{provide_duplicated_binaries}0 
%if %{?internal_utils}0

openSUSE Build Service is sponsored by