forked from pool/libguestfs
Olaf Hering
b08a9b83f7
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=25
374 lines
11 KiB
RPMSpec
374 lines
11 KiB
RPMSpec
#
|
|
# spec file for package libguestfs
|
|
#
|
|
# Copyright (c) 2012 SUSE LINUX Products 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/
|
|
#
|
|
|
|
|
|
%define with_ocaml 1
|
|
%define with_python 1
|
|
%define with_perl 1
|
|
%define with_ruby 0
|
|
%define with_fuse 1
|
|
#
|
|
# 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.
|
|
|
|
Name: libguestfs
|
|
ExclusiveArch: %ix86 x86_64
|
|
Requires: kvm >= 1.1
|
|
%if %suse_version >= 1140
|
|
BuildRequires: augeas-devel
|
|
%endif
|
|
BuildRequires: attr-devel
|
|
BuildRequires: autoconf
|
|
BuildRequires: automake
|
|
BuildRequires: file-devel
|
|
BuildRequires: gcc
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: genisoimage
|
|
BuildRequires: gperf
|
|
BuildRequires: hivex-devel
|
|
BuildRequires: kvm >= 1.1
|
|
%if %suse_version >= 1220
|
|
BuildRequires: libconfig-devel
|
|
%endif
|
|
BuildRequires: libtool
|
|
BuildRequires: libvirt-devel
|
|
BuildRequires: ncurses-devel
|
|
BuildRequires: pcre-devel
|
|
BuildRequires: pkg-config
|
|
BuildRequires: qemu
|
|
BuildRequires: readline-devel
|
|
BuildRequires: xz
|
|
%if %suse_version < 1210
|
|
# perl as included in openSuSE 11.4 has this, but an older version without html_charset
|
|
# Without the version the requires is ignored for some reason
|
|
BuildRequires: perl(Pod::Simple::XHTML) = 3.23
|
|
%endif
|
|
#
|
|
%if %{with_fuse}
|
|
BuildRequires: fuse-devel
|
|
%define _configure_fuse --enable-fuse
|
|
%else
|
|
%define _configure_fuse --disable-fuse
|
|
%endif
|
|
#
|
|
%if %{with_ocaml}
|
|
BuildRequires: ocaml
|
|
BuildRequires: ocaml-findlib
|
|
%define _configure_ocaml --enable-ocaml
|
|
%else
|
|
%define _configure_ocaml --disable-ocaml
|
|
%endif
|
|
#
|
|
%if %{with_perl}
|
|
BuildRequires: perl
|
|
BuildRequires: perl-macros
|
|
BuildRequires: perl(Data::Dumper)
|
|
BuildRequires: perl(Getopt::Long)
|
|
BuildRequires: perl(Locale::TextDomain)
|
|
BuildRequires: perl(Pod::Usage)
|
|
%if 0
|
|
BuildRequires: perl(String::ShellQuote)
|
|
BuildRequires: perl(Win::Hivex)
|
|
BuildRequires: perl(Win::Hivex::Regedit)
|
|
%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
|
|
BuildRequires: python-devel
|
|
%define _configure_python --enable-python
|
|
%else
|
|
%define _configure_python --disable-python
|
|
%endif
|
|
#
|
|
%if %{with_ruby}
|
|
BuildRequires: ruby
|
|
BuildRequires: ruby-devel
|
|
BuildRequires: rubygem-rake
|
|
%define _configure_ruby --enable-ruby
|
|
%else
|
|
%define _configure_ruby --disable-ruby
|
|
%endif
|
|
#
|
|
Url: http://libguestfs.org/
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
Summary: Tools for accessing and modifying virtual machine disk images
|
|
License: LGPL-2.1
|
|
Group: System/Filesystems
|
|
Version: 1.19.34
|
|
Release: 0
|
|
Patch34: libguestfs-1.19.34.patch
|
|
Patch5: libguestfs-1.13.14-ruby.patch
|
|
Patch100: libguestfs.perl.install_vendor.patch
|
|
Patch101: libguestfs.perl.no-rpath.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
|
|
Group: Documentation
|
|
|
|
%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
|
|
Group: System/Filesystems
|
|
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
|
|
Group: System/Filesystems
|
|
|
|
%description python
|
|
Provides Python support for libguestfs.
|
|
%endif
|
|
#
|
|
%if %{with_ruby}
|
|
%package -n rubygem-libguestfs
|
|
Summary: Ruby bindings for libguestfs
|
|
Group: System/Filesystems
|
|
|
|
%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
|
|
Group: System/Filesystems
|
|
Version: 15
|
|
Release: 0
|
|
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
|
|
Group: Development/System
|
|
|
|
%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
|
|
Group: System/Filesystems
|
|
|
|
%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
|
|
%patch34 -p1
|
|
%patch100 -p1
|
|
%patch101 -p1
|
|
|
|
%build
|
|
# disable qemu test.
|
|
# If the package is built within kvm the configure test will fail because it starts kvm within kvm
|
|
export vmchannel_test=no
|
|
# for configure macro below
|
|
CFLAGS="$RPM_OPT_FLAGS -Wno-unused"
|
|
CXXFLAGS="$RPM_OPT_FLAGS -Wno-unused"
|
|
autoreconf -fi
|
|
%configure \
|
|
--help || :
|
|
%configure \
|
|
--disable-appliance \
|
|
--disable-haskell \
|
|
--disable-php \
|
|
%{_configure_fuse} \
|
|
%{_configure_ocaml} \
|
|
%{_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
|
|
%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
|
|
%{_mandir}/man3/*
|
|
|
|
%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}/man1/*
|
|
%if %{with_ocaml}
|
|
%{_libdir}/ocaml
|
|
%endif
|
|
|
|
%changelog
|