File libguestfs.spec of Package libguestfs

#
# spec file for package libguestfs
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Michal Hrusecky <mhrusecky@novell.com>
#
# 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 http://bugs.opensuse.org/
#
# needsbinariesforbuild


Version:        1.32.4
Release:        0

%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%if !%opt
# get rid of /usr/lib/rpm/find-debuginfo.sh
# strip kills the bytecode part of ELF binaries
# see also NO_BRP_STRIP_DEBUG in install section
%undefine _build_create_debug
%endif

# disable certain features for a SLES11 build
# in Virtualization repo in OBS they're reenabled via prjconf
%if %suse_version == 1110
%bcond_with ocaml_bindings
%bcond_with lua_bindings
%bcond_with python_bindings
%bcond_with perl_bindings
%bcond_with hivex
%bcond_with zerofree
%bcond_without ext4_writeable
%else
%bcond_without ocaml_bindings
%bcond_without lua_bindings
%bcond_without python_bindings
%bcond_without perl_bindings
%bcond_without hivex
%bcond_without zerofree
%bcond_with    ext4_writeable
%endif

%bcond_without fuse

%if %suse_version > 1210
%bcond_without ruby_bindings
%else
%bcond_with ruby_bindings
%endif

%bcond_without p2v

%if %suse_version >= 1230
%bcond_without bash_completion
%else
%bcond_with bash_completion
%endif
# The following defines are overridden in the individual subpackages
%define _configure_fuse --disable-fuse
%define _configure_lua --disable-lua
%define _configure_ocaml --disable-ocaml
%define _configure_perl --disable-perl
%define _configure_python --disable-python
%define _configure_ruby --disable-ruby

%if %suse_version > 1310
%define use_included_mkinitrd 1
%else
%define use_included_mkinitrd 0
%endif
# /lib/udev is a symlink in 12.3+, package the full directory
%if %suse_version > 1220
%define udevrulesdir /usr/lib/udev/rules.d
%else
%define udevrulesdir /lib/udev/rules.d
%endif
#
%define kernel_binary %{nil}
%ifarch ia64 %ix86 x86_64
%define kernel_binary /boot/vmlinuz
%endif
%ifarch ppc ppc64 ppc64le sparc64
%define kernel_binary /boot/vmlinux
%endif
%ifarch s390 s390x
%define kernel_binary /boot/image
%endif
%ifarch %arm
%define kernel_binary /boot/uImage
%endif
%ifarch aarch64
%define kernel_binary /boot/Image
%endif
#
# use 'env LIBGUESTFS_HV=/path/to/kvm libguestfs-test-tool' to verify
%define kvm_binary /bin/false
%ifarch aarch64
%define kvm_binary /usr/bin/qemu-system-aarch64
%endif
%ifarch ppc64le
%define kvm_binary /usr/bin/qemu-system-ppc64
%endif
%ifarch ppc64
%define kvm_binary /usr/bin/qemu-system-ppc64
%endif
%ifarch s390x
%define kvm_binary /usr/bin/qemu-system-s390x
%endif
%ifarch x86_64
%define kvm_binary /usr/bin/qemu-system-x86_64
%endif
#
%define guestfs_docdir %{_defaultdocdir}/%{name}
#
Name:           libguestfs
%if "%{?_ignore_exclusive_arch}" == ""
ExclusiveArch:  x86_64 ppc64 ppc64le s390x aarch64
%endif
%{ocaml_preserve_bytecode}
BuildRequires:  aaa_base
BuildRequires:  attr-devel
BuildRequires:  augeas-devel >= 1.0.0
BuildRequires:  autoconf
BuildRequires:  automake
%if %{with bash_completion}
BuildRequires:  bash-completion >= 2.0
%if 0%{?suse_version} >= 1330
BuildRequires:  bash-completion-devel >= 2.0
%endif
%endif
BuildRequires:  bison
BuildRequires:  fdupes
BuildRequires:  file-devel
BuildRequires:  flex
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gperf
BuildRequires:  libacl-devel
BuildRequires:  libcap-devel
%if %suse_version >= 1220
BuildRequires:  libconfig-devel
%endif
BuildRequires:  libtool
BuildRequires:  libvirt-devel >= 0.10.2
BuildRequires:  libxml2-devel
BuildRequires:  ncurses-devel
%if %{with perl_bindings}
BuildRequires:  perl(Module::Build)
%if %suse_version < 1140
BuildRequires:  perl-macros
%endif
%endif
BuildRequires:  createrepo
BuildRequires:  db48-utils
BuildRequires:  dhcp-client
BuildRequires:  pcre-devel
BuildRequires:  pkg-config
BuildRequires:  qemu-tools
BuildRequires:  readline-devel
BuildRequires:  supermin >= 5.1.6
# Required to build tools, its independent from bindings
BuildRequires:  glib2-devel
BuildRequires:  ocaml
BuildRequires:  ocaml-findlib

#
BuildRequires:  ocaml-rpm-macros >= 4.02.1
%if %{with ocaml_bindings}
%define _configure_ocaml --enable-ocaml
%endif
#
%if %{with fuse}
BuildRequires:  fuse-devel
%define _configure_fuse --enable-fuse
%endif
#
%if %{with hivex}
BuildRequires:  glibc-locale
BuildRequires:  hivex
BuildRequires:  hivex-devel
%endif
#
%if %{with p2v}
BuildRequires:  gtk2-devel
%endif
#
Url:            http://libguestfs.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Compatibility package for guestfs-tools
License:        GPL-2.0
Group:          System/Filesystems
Patch0:         0000-hotfix.patch

Source0:        %{name}-%{version}.tar.xz
Source1:        libguestfs.rpmlintrc
Source789653:   Pod-Simple-3.23.tar.xz
#
Source10001:    libguestfs.test.simple.run-libugestfs-test-tool.sh
Source10002:    libguestfs.test.simple.create-opensuse-guest.sh
Source10003:    libguestfs.test.simple.create-opensuse-guest-crypt-on-lvm.sh
Source10004:    libguestfs.test.simple.create-sles12-guest.sh
Source10005:    libguestfs.test.simple.create-sles12-guest-crypt-on-lvm.sh

#
Requires:       guestfs-tools
Requires:       virt-v2v

%description
libguestfs is a set of tools for accessing and modifying virtual machine (VM)
disk images. You can use this for viewing and editing files inside guests,
scripting changes to VMs, monitoring disk used/free statistics, P2V, V2V,
performing partial backups, cloning VMs, and much else besides.

libguestfs can access nearly any type of filesystem including: all known types
of Linux filesystem (ext2/3/4, XFS, btrfs etc), any Windows filesystem (VFAT
and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and
GPT disk partitions, raw disks, qcow2, VirtualBox VDI, VMWare VMDK, CD and DVD
ISOs, SD cards, and dozens more. libguestfs doesn't need root permissions.

All this functionality is available through a convenient shell called
guestfish, or use virt-rescue to get a rescue shell for fixing unbootable
virtual machines.

%package -n guestfs-tools
Summary:        Tools for accessing and modifying virtual machine disk images
License:        GPL-2.0
Group:          System/Filesystems
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}
Requires:       libguestfs0 = %{version}
Requires:       python-evtx
%if %{with bash_completion}
Recommends:     bash-completion >= 2.0
%endif
%if %{with perl_bindings}
Requires:       perl(Data::Dumper)
Requires:       perl(File::Basename)
Requires:       perl(File::Temp)
Requires:       perl(Getopt::Long)
Requires:       perl(Locale::TextDomain)
Requires:       perl(Pod::Usage)
Requires:       perl(String::ShellQuote)
Requires:       perl(Sys::Guestfs)
%{perl_requires}
%if %{with hivex}
Requires:       perl(Win::Hivex)
Requires:       perl(Win::Hivex::Regedit)
%endif
%endif
Recommends:     guestfs-data
Conflicts:      guestfs-data < %{version}
Conflicts:      libguestfs0 < %{version}

%description -n guestfs-tools
libguestfs is a set of tools for accessing and modifying virtual machine (VM)
disk images. You can use this for viewing and editing files inside guests,
scripting changes to VMs, monitoring disk used/free statistics, P2V, V2V,
performing partial backups, cloning VMs, and much else besides.

libguestfs can access nearly any type of filesystem including: all known types
of Linux filesystem (ext2/3/4, XFS, btrfs etc), any Windows filesystem (VFAT
and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and
GPT disk partitions, raw disks, qcow2, VirtualBox VDI, VMWare VMDK, CD and DVD
ISOs, SD cards, and dozens more. libguestfs doesn't need root permissions.

All this functionality is available through a convenient shell called
guestfish, or use virt-rescue to get a rescue shell for fixing unbootable
virtual machines.

%package -n guestfsd
Summary:        Daemon for the libguestfs appliance
License:        GPL-2.0
Group:          System/Filesystems
Conflicts:      libaugeas0 < 1.0.0

%description -n guestfsd
guestfsd runs within the libguestfs appliance. It receives commands from the host
and performs the requested action by calling the helper binaries.
This package is only required for building the appliance.

#
%if %{with ocaml_bindings}
%package -n ocaml-libguestfs
Summary:        Provides OCaml support for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
#

%description -n ocaml-libguestfs
Allows OCaml scripts to directly use libguestfs.

%package -n ocaml-libguestfs-devel
Summary:        Provides OCaml support for libguestfs
License:        GPL-2.0
Group:          Development/Libraries/Other

%description -n ocaml-libguestfs-devel
Allows OCaml scripts to directly use libguestfs.
%endif
#
%if %{with perl_bindings}
%package -n perl-Sys-Guestfs
Summary:        Provides Perl support for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
BuildRequires:  perl
BuildRequires:  perl(Data::Dumper)
BuildRequires:  perl(Getopt::Long)
BuildRequires:  perl(Locale::TextDomain)
BuildRequires:  perl(Pod::Usage)
BuildRequires:  perl(String::ShellQuote)
BuildRequires:  perl(Sys::Virt)
%if %{with hivex}
BuildRequires:  perl(Win::Hivex)
BuildRequires:  perl(Win::Hivex::Regedit)
%endif
%define _configure_perl --enable-perl
#
Provides:       libguestfs-perl = %{version}
Obsoletes:      libguestfs-perl < %{version}
Requires:       perl(File::Temp)
Requires:       perl(Locale::TextDomain)
%perl_requires

%description -n perl-Sys-Guestfs
Allows Perl scripts to directly use libguestfs.
%endif
#
%if %{with lua_bindings}
%package -n lua-libguestfs
Summary:        Provides Lua support for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
BuildRequires:  lua-devel
%define _configure_lua --enable-lua
#

%description -n lua-libguestfs
Allows lua scripts to directly use libguestfs.
%endif
#
%if %{with python_bindings}
%package -n python-libguestfs
Summary:        Provides Python support for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
%define pyver %(python -c "import sys; print sys.version[:3]")
BuildRequires:  python
BuildRequires:  python-devel
%define _configure_python --enable-python
#
Provides:       libguestfs-python = %{version}
Obsoletes:      libguestfs-python < %{version}

%description -n python-libguestfs
Allows Python scripts to directly use libguestfs.
%endif
#
%if %{with ruby_bindings}
%package -n rubygem-libguestfs
Summary:        Ruby bindings for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
BuildRequires:  ruby
BuildRequires:  ruby-devel
BuildRequires:  rubygem-rake
%define _configure_ruby --enable-ruby
#

%description -n rubygem-libguestfs
Allows Ruby scripts to directly use libguestfs.
%endif

%package test
Summary:        Testcases for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
Requires:       %{name}

%description test
This package contains testcases to verify libguestfs functionality.

%package -n guestfs-data
# kernel-default needs that
%if %{?sles_version}0 > 0
BuildRequires:  sles-release
%endif
BuildRequires:  augeas-lenses
BuildRequires:  bc
BuildRequires:  btrfsprogs
BuildRequires:  bzip2
BuildRequires:  cdrkit-cdrtools-compat
BuildRequires:  coreutils
BuildRequires:  cpio
BuildRequires:  cryptsetup
BuildRequires:  diffutils
BuildRequires:  dosfstools
BuildRequires:  e2fsprogs
# ext4 in the sles11 kernel-binary.rpm packages operates only in read-only mode.
# The generated initrd operates inside the temporary guest on image files.
# For that reason it needs to make modifications to any kind of filesystems.
%if %{with ext4_writeable}
BuildRequires:  ext4-writeable-kmp-default
%endif
BuildRequires:  file
BuildRequires:  findutils
BuildRequires:  gawk
BuildRequires:  genisoimage
BuildRequires:  glibc
BuildRequires:  grep
%if %suse_version > 1210
BuildRequires:  gptfdisk
%endif
BuildRequires:  gzip
BuildRequires:  iproute2
BuildRequires:  jfsutils
BuildRequires:  kernel-default
BuildRequires:  lvm2
BuildRequires:  mdadm
%if !%{use_included_mkinitrd}
BuildRequires:  mkinitrd
%endif
BuildRequires:  module-init-tools
BuildRequires:  ncurses-utils
BuildRequires:  nfs-client
BuildRequires:  ntfs-3g
BuildRequires:  ntfsprogs
BuildRequires:  pam-config
BuildRequires:  parted
BuildRequires:  pciutils
BuildRequires:  pciutils-ids
BuildRequires:  psmisc
BuildRequires:  reiserfs
BuildRequires:  rsync
BuildRequires:  sg3_utils
BuildRequires:  strace
%ifarch %ix86 x86_64
BuildRequires:  syslinux
%endif
%if %suse_version >= 1210
BuildRequires:  systemd
BuildRequires:  systemd-sysvinit
%else
BuildRequires:  sysvinit
%endif
BuildRequires:  tar
BuildRequires:  terminfo-base
BuildRequires:  tunctl
BuildRequires:  udev
BuildRequires:  util-linux
BuildRequires:  util-linux-lang
BuildRequires:  xfsprogs
BuildRequires:  xz
%if %{with zerofree}
BuildRequires:  zerofree
%endif
Summary:        Virtual machine needed for libguestfs
License:        GPL-2.0
Group:          System/Filesystems
Provides:       libguestfs-data = %{version}
Obsoletes:      libguestfs-data < %{version}

%description -n guestfs-data
libguestfs needs for it's run a virtual machine image.
This package provides such an image, an initrd and a kernel.


%package devel
Summary:        Development files for libguestfs
License:        GPL-2.0
Group:          Development/Libraries/Other
Requires:       libguestfs0 = %{version}

%description devel
Development files for libguestfs.

libguestfs is a set of tools for accessing and modifying virtual machine (VM)
disk images. You can use this for viewing and editing files inside guests,
scripting changes to VMs, monitoring disk used/free statistics, P2V, V2V,
performing partial backups, cloning VMs, and much else besides.

libguestfs can access nearly any type of filesystem including: all known types
of Linux filesystem (ext2/3/4, XFS, btrfs etc), any Windows filesystem (VFAT
and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and
GPT disk partitions, raw disks, qcow2, VirtualBox VDI, VMWare VMDK, CD and DVD
ISOs, SD cards, and dozens more. libguestfs doesn't need root permissions.

All this functionality is available through a convenient shell called
guestfish, or use virt-rescue to get a rescue shell for fixing unbootable
virtual machines.

%package -n libguestfs0
Summary:        Runtime library of libguestfs
License:        LGPL-2.1
Group:          System/Filesystems
Requires:       %{kvm_binary}
Requires:       qemu >= 2.0
Requires:       supermin >= 5.1.6
%if %suse_version == 1315
%if 0%{?is_opensuse} == 0
Recommends:     guestfs-winsupport
%endif
%endif

%description -n libguestfs0
Library for libguestfs.

libguestfs is a set of tools for accessing and modifying virtual machine (VM)
disk images. You can use this for viewing and editing files inside guests,
scripting changes to VMs, monitoring disk used/free statistics, P2V, V2V,
performing partial backups, cloning VMs, and much else besides.

libguestfs can access nearly any type of filesystem including: all known types
of Linux filesystem (ext2/3/4, XFS, btrfs etc), any Windows filesystem (VFAT
and NTFS), any Mac OS X and BSD filesystems, LVM2 volume management, MBR and
GPT disk partitions, raw disks, qcow2, VirtualBox VDI, VMWare VMDK, CD and DVD
ISOs, SD cards, and dozens more. libguestfs doesn't need root permissions.

All this functionality is available through a convenient shell called
guestfish, or use virt-rescue to get a rescue shell for fixing unbootable
virtual machines.


%package -n virt-v2v
Summary:        Convert a virtual machine to run on KVM
License:        GPL-2.0
Group:          System/Management
Requires:       libguestfs0 = %{version}
Requires:       qemu-block-ssh

%description -n virt-v2v
virt-v2v is a tool for converting and importing virtual machines to
libvirt-managed KVM. It can import a variety of guest operating systems 
from libvirt-managed hosts.

%if %{with p2v}
%package -n virt-p2v
Summary:        Convert a physical machine to run on KVM
License:        GPL-2.0
Group:          System/Management
Requires:       virt-v2v = %{version}

%description -n virt-p2v
virt-p2v is a tool for converting physical machines into libvirt-managed KVM machines.
It can import a variety of guest operating systems from libvirt-managed hosts.
%endif

%prep
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
%setup -q -a 789653
%patch0 -p1

%build
bison --version
# [Bug 789653] sles11 perl obsoletes perl-Pod-Simple unconditionally
export PERLLIB=`echo $PWD/Pod-Simple-*/lib`
# disable qemu test.
# If the package is built within kvm the configure test will fail because it starts kvm within kvm
# With QEMU in environment qemu and kvm packages are not needed at build time.
# With SUPERMIN and SUPERMIN_HELPER in environment, supermin package is not needed at build time.
export vmchannel_test=no
export QEMU="%{kvm_binary}"
export SUPERMIN=supermin
export SUPERMIN_HELPER=supermin-helper
# for configure macro below
CFLAGS="$RPM_OPT_FLAGS -Wno-unused"
CXXFLAGS="$RPM_OPT_FLAGS -Wno-unused"
# If the kernel happens to have no virtio-scsi force virtio-blk usage in the tools
# This is true for kernel.rpm included in 12.1 and older
ls -laR /boot/ || :
if /sbin/modinfo -k "`env PATH=/sbin:/usr/sbin:$PATH get_kernel_version '%{kernel_binary}'`" virtio-scsi
then
	: use virtio-scsi, which is the default in libguestfs
else
	CFLAGS="$CFLAGS -DGUESTFS_QEMU_NO_VIRTIO_BLK"
	CXXFLAGS="$CXXFLAGS -DGUESTFS_QEMU_NO_VIRTIO_BLK"
fi
autoreconf -fi

#
%configure \
	--help || :

if python --version && ! pkg-config python
then
	export PYTHON_LIBS="-lpython`python -c 'import distutils.sysconfig; print (distutils.sysconfig.get_python_version ());'`"
	export PYTHON_CFLAGS="-I`python -c 'import distutils.sysconfig; print (distutils.sysconfig.get_python_inc ());'`"
	export PYTHON_EXT_SUFFIX=.so
fi

#sed -i '1 s@^.*@#!/bin/sh -x@' configure
%configure \
	--docdir=%{guestfs_docdir} \
	--enable-daemon \
	--enable-install-daemon \
	--with-qemu=$QEMU \
	--without-java \
	--with-supermin-packager-config="$PWD/zypper.priv.conf --use-installed --verbose" \
	--disable-haskell \
	--disable-php \
	%{_configure_fuse} \
	%{_configure_lua} \
	%{_configure_ocaml} \
	%{_configure_perl} \
	%{_configure_python} \
	%{_configure_ruby} \
	--disable-rpath \
	--disable-static 
#Workaround an autotools bug
make -j1 -C builder index-parse.c
# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir instead of the site dir
make \
	INSTALLDIRS=vendor \
	LD_RUN_PATH= \
	%{?_smp_mflags}

%install
%if !%opt
# get rid of /usr/lib/rpm/brp-strip-debug 
# strip kills the bytecode part of ELF binaries
export NO_BRP_STRIP_DEBUG=true
%endif
%makeinstall \
	INSTALLDIRS=vendor \
	udevrulesdir=%{udevrulesdir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/guestfs
cp -avLt $RPM_BUILD_ROOT%{_datadir}/guestfs \
	%{S:10005} \
	%{S:10004} \
	%{S:10003} \
	%{S:10002} \
	%{S:10001}
chmod 0755 $RPM_BUILD_ROOT%{_datadir}/guestfs/*
#remove ocaml bindings files if they are disable via rpm macro
%if !%{with ocaml_bindings}
rm -rfv $RPM_BUILD_ROOT%{_libdir}/ocaml
%endif
rm -rfv $RPM_BUILD_ROOT%{guestfs_docdir}
find $RPM_BUILD_ROOT -type f \( \
	-name "virt-list-filesystems" -o -name "virt-list-filesystems.*" -o \
	-name "virt-list-partitions" -o -name "virt-list-partitions.*" -o \
	-name "virt-tar" -o -name "virt-tar.*" \
	\) -print -delete
%if %{with perl_bindings}
# Delete empty perl bootstrap files
find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete
%perl_process_packlist
%perl_gen_filelist
# the macro above packages everything, here only the perl files are desrired
grep "%perl_vendorarch/" %{name}.files | tee t
mv t %{name}.files
%endif
#
find $RPM_BUILD_ROOT -name "*.la" -print -delete
rm -fv $RPM_BUILD_ROOT/%{_libdir}/*.a
#
touch %{name}.lang
%find_lang %{name}
%fdupes -s $RPM_BUILD_ROOT

# SLES has a different way to provide ntfs-3g feature.
%if %suse_version == 1315
%if 0%{?is_opensuse} == 1
mkdir -p $RPM_BUILD_ROOT/tmp/etc/alternatives
pushd $RPM_BUILD_ROOT/tmp/etc/alternatives
ln -s /sbin/mount.ntfs-3g mount.ntfs
popd
pushd $RPM_BUILD_ROOT/tmp
tar czf $RPM_BUILD_ROOT/%{_libdir}/guestfs/supermin.d/zz-ntfs-symlink.tar.gz etc
popd
rm -rf $RPM_BUILD_ROOT/tmp
%endif
%endif

%if %{with p2v}
# Remove the kickstart files from p2v package
rm $RPM_BUILD_ROOT/%{_datadir}/virt-p2v/p2v.ks.in
%endif

%clean
rm -rf $RPM_BUILD_ROOT

%post -n libguestfs0 -p /sbin/ldconfig
%postun -n libguestfs0 -p /sbin/ldconfig

%files test
%defattr(-,root,root)
%{_datadir}/guestfs

%files -n guestfs-data
%defattr(-,root,root)
%{_libdir}/guestfs
%exclude %{_libdir}/guestfs/supermin.d/zz-packages-*

%if %{with ocaml_bindings}
%files -n ocaml-libguestfs
%defattr(-,root,root)
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/guestfs
%{_libdir}/ocaml/guestfs/META
%{_libdir}/ocaml/guestfs/*.cmi
%{_libdir}/ocaml/guestfs/*.cma
%{_libdir}/ocaml/stublibs

%files -n ocaml-libguestfs-devel
%defattr(-,root,root)
%dir %{_libdir}/ocaml
%dir %{_libdir}/ocaml/guestfs
%{_libdir}/ocaml/guestfs/*.a
%if %opt
%{_libdir}/ocaml/guestfs/*.cmx
%{_libdir}/ocaml/guestfs/*.cmxa
%endif
%{_libdir}/ocaml/guestfs/*.mli
%endif
#
%if %{with lua_bindings}
%files -n lua-libguestfs
%defattr(-,root,root)
%{_libdir}/lua
%endif
#
%if %{with perl_bindings}
%post -n perl-Sys-Guestfs -p /sbin/ldconfig

%postun -n perl-Sys-Guestfs -p /sbin/ldconfig

%files -n perl-Sys-Guestfs -f %{name}.files
%defattr(-,root,root)
%endif
#
%if %{with python_bindings}
%files -n python-libguestfs
%defattr(-,root,root)
%{_libdir}/python%{pyver}/site-packages/*
%endif
#
%if %{with ruby_bindings}
%files -n rubygem-libguestfs
%defattr(-,root,root)
%{_libdir}/ruby
%endif

%files -n libguestfs0
%defattr(-,root,root)
%doc COPYING.LIB
%{_libdir}/*.so.*

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%{_includedir}/guestfs.h
%{_includedir}/guestfs-gobject
%{_includedir}/guestfs-gobject.h
%{_datadir}/gtk-doc/html/guestfs
%{_mandir}/man3/*

%files -n guestfsd
%defattr(-,root,root)
%{udevrulesdir}
%{_sbindir}/guestfsd
%{_mandir}/man8/*

%files -n guestfs-tools -f %{name}.lang
%defattr(-,root,root)
%doc COPYING
%{_sbindir}/libguestfs-make-fixed-appliance
%{_bindir}/*
%exclude %{_bindir}/virt-v2v
%exclude %{_bindir}/virt-p2v-*
%config(noreplace) /etc/libguestfs-tools.conf
/etc/virt-builder
%dir /etc/xdg/virt-builder
%dir /etc/xdg/virt-builder/repos.d
%config /etc/xdg/virt-builder/repos.d/*
%if %{with bash_completion}
%{_datadir}/bash-completion
%exclude %{_datadir}/bash-completion/*/virt-v2v
%endif
%{_mandir}/man1/*
%exclude %{_mandir}/man1/virt-v2v.*
%exclude %{_mandir}/man1/virt-p2v*
%{_mandir}/man5/*

%files -n virt-v2v
%defattr(-,root,root)
%{_bindir}/virt-v2v
%{_datadir}/bash-completion/*/virt-v2v
%{_mandir}/man1/virt-v2v.*

%if %{with p2v}
%files -n virt-p2v
%defattr(-,root,root)
%{_prefix}/lib/virt-p2v
%{_datadir}/virt-p2v
%attr(0555,-,-) %{_datadir}/virt-p2v/launch-virt-p2v
%{_bindir}/virt-p2v-make-kiwi
%{_bindir}/virt-p2v-make-disk
%{_mandir}/man1/virt-p2v-make-kiwi*
%{_mandir}/man1/virt-p2v-make-disk*
%endif

%changelog
openSUSE Build Service is sponsored by