%define with_python 1 %define with_perl 1 %define with_ruby 0 # Copyright (c) 2011 Michal Hrusecky # # 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. # norootforbuild Name: libguestfs ExclusiveArch: %ix86 x86_64 BuildRequires: gcc gcc-c++ libtool automake autoconf pkg-config gperf genisoimage qemu kvm pcre-devel libvirt-devel ncurses-devel readline-devel xz hivex-devel # %if %{with_perl} BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Getopt::Long) BuildRequires: perl(Data::Dumper) BuildRequires: perl(Locale::TextDomain) BuildRequires: perl(Pod::Usage) %if 0 BuildRequires: perl(Win::Hivex) BuildRequires: perl(Win::Hivex::Regedit) BuildRequires: perl(String::ShellQuote) %endif BuildRequires: perl(Sys::Virt) %{perl_requires} %define _configure_perl --enable-perl %else %define _configure_perl --disable-perl %endif # %if %{with_python} %define pyver %(python -c "import sys; print sys.version[:3]") BuildRequires: python python-devel %define _configure_python --enable-python %else %define _configure_python --disable-python %endif # %if %{with_ruby} BuildRequires: ruby ruby-devel rubygem-rake %define _configure_ruby --enable-ruby %else %define _configure_ruby --disable-ruby %endif # # libconfig-devel fuse-devel libulockmgr1 Url: http://libguestfs.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build License: LGPL-2.1 Summary: Tools for accessing and modifying virtual machine disk images Group: System/Filesystems Version: 1.19.30 Release: 1 Patch: libguestfs-1.19.30.patch Patch1: libguestfs-1.13.14-disable-erlang.patch Patch2: libguestfs-1.13.14-provided-appliance.patch Patch3: libguestfs-1.13.14-no-machine.patch Patch5: libguestfs-1.13.14-ruby.patch Source0: %{name}-%{version}.tar.gz Source1: guestfs.tar.xz Recommends: %{name}-data %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 doc Summary: Documentation for libguestfs %description doc Documentation 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. # %if %{with_perl} %package perl Summary: Allows Perl scripts to directly use libguestfs Requires: perl = %{perl_version} %description perl Provides Perl support for libguestfs. %endif # %if %{with_python} %package python Summary: Allows Python scripts to directly use libguestfs %description python Provides Python support for libguestfs. %endif # %if %{with_ruby} %package -n rubygem-libguestfs Summary: Ruby bindings for libguestfs %description -n rubygem-libguestfs Ruby bindings 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. %endif %package data Summary: Virtual machine needed for libguestfs Version: 15 Requires: %{name} %description data libguestfs needs for it's run virtual machine image. This package provides such an image. %package devel Summary: Development files for libguestfs %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: libguestfs library %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. %prep %setup -q %patch -p1 %build export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-unused" autoreconf -fi %configure \ --help || : %configure \ --disable-appliance \ --disable-haskell \ --disable-ocaml \ --disable-php \ %{_configure_perl} \ %{_configure_python} \ %{_configure_ruby} \ --disable-rpath \ --disable-static make %{?jobs:-j%jobs} %install %makeinstall find $RPM_BUILD_ROOT \( -name "*.pod" -o -name ".packlist" \) -print0 | xargs -0 --no-run-if-empty rm -fv rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{l,}a xz -cd %{S:1} | tar -C $RPM_BUILD_ROOT/%{_libdir} -xvf - touch %{name}.lang %find_lang %{name} # %clean rm -rf $RPM_BUILD_ROOT %post -n libguestfs0 -p /sbin/ldconfig %postun -n libguestfs0 -p /sbin/ldconfig %files doc %defattr(-,root,root) %{_datadir}/doc/libguestfs %files data %defattr(-,root,root) %{_libdir}/guestfs # %if %{with_perl} %post perl -p /sbin/ldconfig %postun perl -p /sbin/ldconfig %files perl -f %{name}.files %defattr(-,root,root) %perl_vendorarch/* %endif # %if %{with_python} %files python %defattr(-,root,root) %{_libdir}/python%{pyver}/site-packages/* %endif # %if %{with_ruby} %files -n rubygem-libguestfs %defattr(-,root,root) %{_libdir}/ruby %endif %files -n libguestfs0 %defattr(-,root,root) %{_libdir}/*.so.* %files devel %defattr(-,root,root) %{_libdir}/*.so %{_libdir}/pkgconfig/* %{_includedir}/guestfs.h %files -f %{name}.lang %defattr(-,root,root) %doc AUTHORS COPYING README %{_bindir}/* %config(noreplace) /etc/libguestfs-tools.conf %config(noreplace) /etc/bash_completion.d/guestfish-bash-completion.sh %{_mandir}/*/* %changelog