2012-08-16 17:55:36 +02:00
|
|
|
#
|
|
|
|
# spec file for package libguestfs
|
|
|
|
#
|
2015-09-07 20:30:32 +02:00
|
|
|
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-10-02 20:45:11 +02:00
|
|
|
# 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.
|
|
|
|
|
2012-08-16 17:55:36 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2011-10-02 20:45:11 +02:00
|
|
|
|
2013-08-19 23:24:42 +02:00
|
|
|
|
2015-02-24 11:08:29 +01:00
|
|
|
Version: 1.26.10
|
2013-08-19 23:24:42 +02:00
|
|
|
Release: 0
|
2013-03-25 15:22:09 +01:00
|
|
|
|
2013-01-16 18:04:26 +01:00
|
|
|
%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
|
2011-10-02 20:45:11 +02:00
|
|
|
|
2012-10-08 14:40:37 +02:00
|
|
|
# disable certain features for a SLES11 build
|
2013-03-25 15:22:09 +01:00
|
|
|
# in Virtualization repo in OBS they're reenabled via prjconf
|
2012-10-08 14:40:37 +02:00
|
|
|
%if %suse_version == 1110
|
2013-03-25 15:22:09 +01:00
|
|
|
%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
|
2012-10-08 14:40:37 +02:00
|
|
|
%else
|
2013-03-25 15:22:09 +01:00
|
|
|
%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
|
2012-10-08 14:40:37 +02:00
|
|
|
%endif
|
2013-03-25 15:22:09 +01:00
|
|
|
|
|
|
|
%bcond_without fuse
|
|
|
|
|
|
|
|
%if %suse_version > 1210
|
|
|
|
%bcond_without ruby_bindings
|
|
|
|
%else
|
|
|
|
%bcond_with ruby_bindings
|
2012-10-08 14:40:37 +02:00
|
|
|
%endif
|
2013-03-25 15:22:09 +01:00
|
|
|
|
2013-08-20 14:43:18 +02:00
|
|
|
%if %suse_version >= 1230
|
|
|
|
%bcond_without bash_completion
|
|
|
|
%else
|
|
|
|
%bcond_with bash_completion
|
|
|
|
%endif
|
2012-09-24 20:22:22 +02:00
|
|
|
# The following defines are overridden in the individual subpackages
|
2012-09-13 20:22:57 +02:00
|
|
|
%define _configure_fuse --disable-fuse
|
2012-11-19 17:25:26 +01:00
|
|
|
%define _configure_lua --disable-lua
|
2012-09-13 20:22:57 +02:00
|
|
|
%define _configure_ocaml --disable-ocaml
|
|
|
|
%define _configure_perl --disable-perl
|
|
|
|
%define _configure_python --disable-python
|
|
|
|
%define _configure_ruby --disable-ruby
|
2012-08-16 17:55:36 +02:00
|
|
|
|
2014-01-16 22:11:35 +01:00
|
|
|
%if %suse_version > 1310
|
|
|
|
%define use_included_mkinitrd 1
|
|
|
|
%else
|
|
|
|
%define use_included_mkinitrd 0
|
|
|
|
%endif
|
2013-08-05 17:48:49 +02:00
|
|
|
# /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
|
2013-01-03 14:02:54 +01:00
|
|
|
#
|
|
|
|
%define kernel_binary %{nil}
|
|
|
|
%ifarch ia64 %ix86 x86_64
|
|
|
|
%define kernel_binary /boot/vmlinuz
|
|
|
|
%endif
|
2014-02-27 13:41:42 +01:00
|
|
|
%ifarch ppc ppc64 ppc64le sparc64
|
2013-01-03 14:02:54 +01:00
|
|
|
%define kernel_binary /boot/vmlinux
|
|
|
|
%endif
|
|
|
|
%ifarch s390 s390x
|
|
|
|
%define kernel_binary /boot/image
|
|
|
|
%endif
|
|
|
|
%ifarch %arm
|
2014-07-31 15:06:46 +02:00
|
|
|
%define kernel_binary /boot/uImage
|
|
|
|
%endif
|
|
|
|
%ifarch aarch64
|
2014-07-31 14:57:18 +02:00
|
|
|
%define kernel_binary /boot/Image
|
2013-01-03 14:02:54 +01:00
|
|
|
%endif
|
2012-11-14 17:31:29 +01:00
|
|
|
#
|
2014-07-07 10:21:47 +02:00
|
|
|
# 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
|
2014-07-08 12:54:55 +02:00
|
|
|
%ifarch ppc64le
|
|
|
|
%define kvm_binary /usr/bin/qemu-system-ppc64
|
|
|
|
%endif
|
2014-07-07 10:21:47 +02:00
|
|
|
%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
|
|
|
|
#
|
2012-11-14 17:31:29 +01:00
|
|
|
%define guestfs_docdir %{_defaultdocdir}/%{name}
|
|
|
|
#
|
2011-10-02 20:45:11 +02:00
|
|
|
Name: libguestfs
|
2013-01-03 16:53:24 +01:00
|
|
|
%if "%{?_ignore_exclusive_arch}" == ""
|
2014-02-27 13:41:42 +01:00
|
|
|
ExclusiveArch: x86_64 ppc64 ppc64le s390x
|
2013-01-02 19:34:59 +01:00
|
|
|
%endif
|
2012-10-29 09:06:34 +01:00
|
|
|
BuildRequires: aaa_base
|
2012-08-29 16:48:35 +02:00
|
|
|
BuildRequires: attr-devel
|
2013-11-26 11:30:37 +01:00
|
|
|
BuildRequires: augeas-devel >= 1.0.0
|
2012-08-16 17:55:36 +02:00
|
|
|
BuildRequires: autoconf
|
|
|
|
BuildRequires: automake
|
2013-08-20 14:43:18 +02:00
|
|
|
%if %{with bash_completion}
|
|
|
|
BuildRequires: bash-completion >= 2.0
|
|
|
|
%endif
|
2014-03-28 15:19:16 +01:00
|
|
|
BuildRequires: bison
|
2012-08-29 16:36:23 +02:00
|
|
|
BuildRequires: file-devel
|
2014-03-28 15:19:16 +01:00
|
|
|
BuildRequires: flex
|
2012-08-16 17:55:36 +02:00
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: gperf
|
2013-03-25 15:22:09 +01:00
|
|
|
BuildRequires: libacl-devel
|
2012-11-23 20:21:05 +01:00
|
|
|
BuildRequires: libcap-devel
|
2012-08-29 16:17:14 +02:00
|
|
|
%if %suse_version >= 1220
|
|
|
|
BuildRequires: libconfig-devel
|
|
|
|
%endif
|
2012-08-16 17:55:36 +02:00
|
|
|
BuildRequires: libtool
|
2012-10-10 16:55:01 +02:00
|
|
|
BuildRequires: libvirt-devel >= 0.10.2
|
2013-08-19 23:51:11 +02:00
|
|
|
BuildRequires: libxml2-devel
|
2012-08-16 17:55:36 +02:00
|
|
|
BuildRequires: ncurses-devel
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with perl_bindings}
|
2013-02-24 18:14:05 +01:00
|
|
|
%if %suse_version < 1140
|
2012-11-29 20:17:06 +01:00
|
|
|
BuildRequires: perl-macros
|
2013-02-24 18:14:05 +01:00
|
|
|
%endif
|
2013-03-25 15:22:09 +01:00
|
|
|
%endif
|
2012-08-16 17:55:36 +02:00
|
|
|
BuildRequires: pcre-devel
|
|
|
|
BuildRequires: pkg-config
|
|
|
|
BuildRequires: readline-devel
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ocaml_bindings}
|
2012-11-13 15:45:14 +01:00
|
|
|
# Required to build tools, its independent from bindings
|
|
|
|
BuildRequires: ocaml
|
|
|
|
BuildRequires: ocaml-findlib
|
2012-11-13 16:26:04 +01:00
|
|
|
%define _configure_ocaml --enable-ocaml
|
2012-11-13 15:45:14 +01:00
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with fuse}
|
2012-08-29 14:41:50 +02:00
|
|
|
BuildRequires: fuse-devel
|
|
|
|
%define _configure_fuse --enable-fuse
|
2012-08-15 20:06:38 +02:00
|
|
|
%endif
|
2012-11-13 15:45:14 +01:00
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with hivex}
|
2014-10-14 10:35:35 +02:00
|
|
|
BuildRequires: glibc-locale
|
2012-09-24 15:08:21 +02:00
|
|
|
BuildRequires: hivex-devel
|
|
|
|
%endif
|
2012-08-15 20:06:38 +02:00
|
|
|
#
|
2011-10-02 20:45:11 +02:00
|
|
|
Url: http://libguestfs.org/
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2012-09-13 20:07:18 +02:00
|
|
|
Summary: Compatibility package for guestfs-tools
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2011-10-02 20:45:11 +02:00
|
|
|
Group: System/Filesystems
|
2014-03-28 15:19:16 +01:00
|
|
|
Patch0: 0000-hotfix.patch
|
2012-09-23 21:26:17 +02:00
|
|
|
Patch1000: 1000-force-virtio_blk-in-old-guest-kernel.patch
|
2013-06-04 14:02:49 +02:00
|
|
|
Source0: %{name}-%{version}.tar.xz
|
2015-07-31 09:45:51 +02:00
|
|
|
Source1: libguestfs.rpmlintrc
|
2014-01-16 22:11:35 +01:00
|
|
|
Source42: libguestfs.mkinitrd.tar.bz2
|
2013-06-04 14:02:49 +02:00
|
|
|
Source789653: Pod-Simple-3.23.tar.xz
|
2012-08-29 19:43:39 +02:00
|
|
|
Source10: libguestfs.mkinitrd.boot.sh
|
|
|
|
Source11: libguestfs.mkinitrd.setup.sh
|
2014-07-02 11:31:23 +02:00
|
|
|
#
|
|
|
|
Source12: libguestfs.mkinitrd.boot-dm.sh
|
|
|
|
Source13: libguestfs.mkinitrd.setup-dm.sh
|
|
|
|
Source14: libguestfs.mkinitrd.boot-lvm2.sh
|
|
|
|
Source15: libguestfs.mkinitrd.setup-lvm2.sh
|
|
|
|
Source16: libguestfs.mkinitrd.boot-md.sh
|
|
|
|
Source17: libguestfs.mkinitrd.setup-md.sh
|
|
|
|
Source18: libguestfs.mkinitrd.boot-nfs.sh
|
|
|
|
Source19: libguestfs.mkinitrd.setup-nfs.sh
|
2014-07-04 09:42:33 +02:00
|
|
|
Source20: libguestfs.mkinitrd.boot-btrfs.sh
|
2014-07-03 18:14:53 +02:00
|
|
|
Source21: libguestfs.mkinitrd.setup-btrfs.sh
|
2014-07-02 11:31:23 +02:00
|
|
|
#
|
2014-11-24 17:56:06 +01:00
|
|
|
Source1310: libguestfs.mkinitrd.1310.patch
|
2014-11-26 13:33:58 +01:00
|
|
|
Source1230: libguestfs.mkinitrd.1230.patch
|
2012-09-28 07:41:58 +02:00
|
|
|
Source1220: libguestfs.mkinitrd.1220.patch
|
|
|
|
Source1210: libguestfs.mkinitrd.1210.patch
|
2014-11-26 13:33:58 +01:00
|
|
|
Source1140: libguestfs.mkinitrd.1140.patch
|
|
|
|
Source1115: libguestfs.mkinitrd.1115.patch
|
2012-09-28 07:41:58 +02:00
|
|
|
Source1110: libguestfs.mkinitrd.1110.patch
|
2014-01-22 11:15:09 +01:00
|
|
|
#
|
|
|
|
Source10001: libguestfs.test.simple.run-libugestfs-test-tool.sh
|
|
|
|
Source10002: libguestfs.test.simple.create-opensuse-guest.sh
|
2014-01-22 17:49:58 +01:00
|
|
|
Source10003: libguestfs.test.simple.create-opensuse-guest-crypt-on-lvm.sh
|
2014-02-04 22:58:08 +01:00
|
|
|
Source10004: libguestfs.test.simple.create-sles12-guest.sh
|
|
|
|
Source10005: libguestfs.test.simple.create-sles12-guest-crypt-on-lvm.sh
|
|
|
|
|
2014-01-22 11:15:09 +01:00
|
|
|
#
|
2012-09-13 20:07:18 +02:00
|
|
|
Requires: guestfs-tools
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%package -n guestfs-tools
|
|
|
|
Summary: Tools for accessing and modifying virtual machine disk images
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-09-13 20:07:18 +02:00
|
|
|
Group: System/Filesystems
|
|
|
|
Provides: %{name} = %{version}
|
|
|
|
Obsoletes: %{name} < %{version}
|
2014-07-08 17:30:01 +02:00
|
|
|
Requires: %{kvm_binary}
|
2014-07-08 17:34:31 +02:00
|
|
|
Requires: qemu >= 2.0
|
2013-11-26 11:30:37 +01:00
|
|
|
%if %{with bash_completion}
|
|
|
|
Recommends: bash-completion >= 2.0
|
|
|
|
%endif
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with perl_bindings}
|
2012-09-13 20:12:48 +02:00
|
|
|
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)
|
2013-03-25 15:22:09 +01:00
|
|
|
%{perl_requires}
|
|
|
|
%if %{with hivex}
|
2012-09-13 20:12:48 +02:00
|
|
|
Requires: perl(Win::Hivex)
|
|
|
|
Requires: perl(Win::Hivex::Regedit)
|
2012-09-24 15:30:42 +02:00
|
|
|
%endif
|
2012-11-29 20:17:06 +01:00
|
|
|
%endif
|
2012-09-13 20:07:18 +02:00
|
|
|
Recommends: guestfs-data
|
2012-12-11 17:56:12 +01:00
|
|
|
Conflicts: guestfs-data < %{version}
|
|
|
|
Conflicts: libguestfs0 < %{version}
|
2012-09-13 20:07:18 +02:00
|
|
|
|
|
|
|
%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
|
2012-11-14 17:36:27 +01:00
|
|
|
Summary: Daemon for the libguestfs appliance
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-09-01 20:53:34 +02:00
|
|
|
Group: System/Filesystems
|
2013-11-26 11:30:37 +01:00
|
|
|
Conflicts: libaugeas0 < 1.0.0
|
2012-09-01 20:53:34 +02:00
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%description -n guestfsd
|
|
|
|
guestfsd runs within the libguestfs appliance. It receives commands from the host
|
2012-09-01 20:53:34 +02:00
|
|
|
and performs the requested action by calling the helper binaries.
|
|
|
|
This package is only required for building the appliance.
|
|
|
|
|
2012-09-01 20:26:42 +02:00
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ocaml_bindings}
|
2012-09-01 20:26:42 +02:00
|
|
|
%package -n ocaml-libguestfs
|
|
|
|
Summary: Provides OCaml support for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-09-01 20:26:42 +02:00
|
|
|
Group: System/Filesystems
|
2012-09-13 20:22:57 +02:00
|
|
|
#
|
2012-09-01 20:26:42 +02:00
|
|
|
|
|
|
|
%description -n ocaml-libguestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Allows OCaml scripts to directly use libguestfs.
|
2012-09-01 20:26:42 +02:00
|
|
|
|
|
|
|
%package -n ocaml-libguestfs-devel
|
|
|
|
Summary: Provides OCaml support for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-09-03 19:21:14 +02:00
|
|
|
Group: Development/Libraries/Other
|
2012-09-01 20:26:42 +02:00
|
|
|
|
|
|
|
%description -n ocaml-libguestfs-devel
|
2012-09-03 09:47:14 +02:00
|
|
|
Allows OCaml scripts to directly use libguestfs.
|
2012-09-01 20:26:42 +02:00
|
|
|
%endif
|
2012-08-15 20:06:38 +02:00
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with perl_bindings}
|
2012-09-01 14:15:10 +02:00
|
|
|
%package -n perl-Sys-Guestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Summary: Provides Perl support for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-08-16 15:03:20 +02:00
|
|
|
Group: System/Filesystems
|
2012-09-13 20:22:57 +02:00
|
|
|
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)
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with hivex}
|
2012-09-13 20:22:57 +02:00
|
|
|
BuildRequires: perl(Win::Hivex)
|
|
|
|
BuildRequires: perl(Win::Hivex::Regedit)
|
2012-09-24 15:30:42 +02:00
|
|
|
%endif
|
2012-09-13 20:22:57 +02:00
|
|
|
%define _configure_perl --enable-perl
|
|
|
|
#
|
2012-09-01 21:01:16 +02:00
|
|
|
Provides: libguestfs-perl = %{version}
|
|
|
|
Obsoletes: libguestfs-perl < %{version}
|
2012-11-29 20:17:06 +01:00
|
|
|
Requires: perl(File::Temp)
|
|
|
|
Requires: perl(Locale::TextDomain)
|
2012-09-13 20:11:21 +02:00
|
|
|
%perl_requires
|
2012-08-15 20:06:38 +02:00
|
|
|
|
2012-09-01 14:15:10 +02:00
|
|
|
%description -n perl-Sys-Guestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Allows Perl scripts to directly use libguestfs.
|
2012-08-15 20:06:38 +02:00
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with lua_bindings}
|
2012-11-19 17:25:26 +01:00
|
|
|
%package -n lua-libguestfs
|
|
|
|
Summary: Provides Lua support for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-11-19 17:25:26 +01:00
|
|
|
Group: System/Filesystems
|
|
|
|
BuildRequires: lua-devel
|
|
|
|
%define _configure_lua --enable-lua
|
|
|
|
#
|
|
|
|
|
|
|
|
%description -n lua-libguestfs
|
|
|
|
Allows lua scripts to directly use libguestfs.
|
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with python_bindings}
|
2012-09-01 15:41:10 +02:00
|
|
|
%package -n python-libguestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Summary: Provides Python support for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-08-16 15:03:20 +02:00
|
|
|
Group: System/Filesystems
|
2012-09-13 20:22:57 +02:00
|
|
|
%define pyver %(python -c "import sys; print sys.version[:3]")
|
|
|
|
BuildRequires: python
|
|
|
|
BuildRequires: python-devel
|
|
|
|
%define _configure_python --enable-python
|
|
|
|
#
|
2012-09-01 21:01:16 +02:00
|
|
|
Provides: libguestfs-python = %{version}
|
|
|
|
Obsoletes: libguestfs-python < %{version}
|
2012-08-15 20:06:38 +02:00
|
|
|
|
2012-09-01 15:41:10 +02:00
|
|
|
%description -n python-libguestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Allows Python scripts to directly use libguestfs.
|
2012-08-15 20:06:38 +02:00
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ruby_bindings}
|
2011-10-02 20:45:11 +02:00
|
|
|
%package -n rubygem-libguestfs
|
|
|
|
Summary: Ruby bindings for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-08-16 15:03:20 +02:00
|
|
|
Group: System/Filesystems
|
2012-09-13 20:22:57 +02:00
|
|
|
BuildRequires: ruby
|
|
|
|
BuildRequires: ruby-devel
|
|
|
|
BuildRequires: rubygem-rake
|
|
|
|
%define _configure_ruby --enable-ruby
|
|
|
|
#
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%description -n rubygem-libguestfs
|
2012-09-03 09:47:14 +02:00
|
|
|
Allows Ruby scripts to directly use libguestfs.
|
2012-08-15 20:06:38 +02:00
|
|
|
%endif
|
2011-10-02 20:45:11 +02:00
|
|
|
|
2014-01-22 11:15:09 +01:00
|
|
|
%package test
|
|
|
|
Summary: Testcases for libguestfs
|
|
|
|
License: GPL-2.0
|
|
|
|
Group: System/Filesystems
|
2014-01-22 18:33:16 +01:00
|
|
|
Requires: %{name}
|
2014-01-22 11:15:09 +01:00
|
|
|
|
|
|
|
%description test
|
|
|
|
This package contains testcases to verify libguestfs functionality.
|
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%package -n guestfs-data
|
2012-09-03 20:08:08 +02:00
|
|
|
# kernel-default needs that
|
|
|
|
%if %{?sles_version}0 > 0
|
|
|
|
BuildRequires: sles-release
|
|
|
|
%endif
|
2012-09-19 17:53:43 +02:00
|
|
|
BuildRequires: augeas-lenses
|
2014-07-09 10:04:24 +02:00
|
|
|
BuildRequires: bc
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: btrfsprogs
|
|
|
|
BuildRequires: bzip2
|
2014-07-04 09:52:15 +02:00
|
|
|
BuildRequires: cdrkit-cdrtools-compat
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: coreutils
|
|
|
|
BuildRequires: cpio
|
|
|
|
BuildRequires: cryptsetup
|
|
|
|
BuildRequires: diffutils
|
2012-09-03 20:10:43 +02:00
|
|
|
BuildRequires: dosfstools
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: e2fsprogs
|
2012-11-29 20:27:20 +01:00
|
|
|
# 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.
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ext4_writeable}
|
2012-10-12 17:08:44 +02:00
|
|
|
BuildRequires: ext4-writeable-kmp-default
|
|
|
|
%endif
|
2014-10-14 10:35:35 +02:00
|
|
|
BuildRequires: fdupes
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: file
|
|
|
|
BuildRequires: findutils
|
|
|
|
BuildRequires: gawk
|
|
|
|
BuildRequires: genisoimage
|
|
|
|
BuildRequires: glibc
|
|
|
|
BuildRequires: grep
|
2014-07-04 10:10:46 +02:00
|
|
|
%if %suse_version > 1210
|
2014-07-04 09:52:15 +02:00
|
|
|
BuildRequires: gptfdisk
|
2014-07-04 10:10:46 +02:00
|
|
|
%endif
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: gzip
|
|
|
|
BuildRequires: iproute2
|
2012-09-13 07:10:10 +02:00
|
|
|
BuildRequires: jfsutils
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: kernel-default
|
|
|
|
BuildRequires: lvm2
|
|
|
|
BuildRequires: mdadm
|
2014-01-16 22:11:35 +01:00
|
|
|
%if !%{use_included_mkinitrd}
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: mkinitrd
|
2014-01-16 22:11:35 +01:00
|
|
|
%endif
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: module-init-tools
|
2014-01-20 17:32:24 +01:00
|
|
|
BuildRequires: nfs-client
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: ntfs-3g
|
|
|
|
BuildRequires: ntfsprogs
|
|
|
|
BuildRequires: parted
|
2014-07-04 09:54:14 +02:00
|
|
|
BuildRequires: psmisc
|
2012-09-13 07:10:10 +02:00
|
|
|
BuildRequires: reiserfs
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: rsync
|
|
|
|
BuildRequires: strace
|
2014-07-04 09:52:15 +02:00
|
|
|
%ifarch %ix86 x86_64
|
|
|
|
BuildRequires: syslinux
|
|
|
|
%endif
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: tar
|
2012-09-07 17:03:24 +02:00
|
|
|
BuildRequires: terminfo-base
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: udev
|
|
|
|
BuildRequires: util-linux
|
|
|
|
BuildRequires: xfsprogs
|
|
|
|
BuildRequires: xz
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with zerofree}
|
2012-09-03 20:08:08 +02:00
|
|
|
BuildRequires: zerofree
|
2012-10-03 18:01:46 +02:00
|
|
|
%endif
|
2011-10-02 20:45:11 +02:00
|
|
|
Summary: Virtual machine needed for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-08-16 15:03:20 +02:00
|
|
|
Group: System/Filesystems
|
2012-09-13 22:33:27 +02:00
|
|
|
Provides: libguestfs-data = %{version}
|
|
|
|
Obsoletes: libguestfs-data < %{version}
|
2011-10-02 20:45:11 +02:00
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%description -n guestfs-data
|
2012-11-14 17:36:27 +01:00
|
|
|
libguestfs needs for it's run a virtual machine image.
|
|
|
|
This package provides such an image, an initrd and a kernel.
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: GPL-2.0
|
2012-09-03 09:47:14 +02:00
|
|
|
Group: Development/Libraries/Other
|
2012-09-13 20:07:18 +02:00
|
|
|
Requires: libguestfs0 = %{version}
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%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
|
2013-03-22 19:51:52 +01:00
|
|
|
Summary: Runtime library of libguestfs
|
2013-03-25 15:22:09 +01:00
|
|
|
License: LGPL-2.1
|
2012-08-16 15:03:20 +02:00
|
|
|
Group: System/Filesystems
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%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
|
2013-01-03 14:17:53 +01:00
|
|
|
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
|
2014-01-16 22:11:35 +01:00
|
|
|
%setup -q -a 789653 -a 42
|
2014-03-28 15:19:16 +01:00
|
|
|
%patch0 -p1
|
2013-08-20 20:43:14 +02:00
|
|
|
%patch1000 -p1
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%build
|
2012-11-23 17:48:22 +01:00
|
|
|
# [Bug 789653] sles11 perl obsoletes perl-Pod-Simple unconditionally
|
|
|
|
export PERLLIB=`echo $PWD/Pod-Simple-*/lib`
|
2012-08-16 17:44:26 +02:00
|
|
|
# disable qemu test.
|
|
|
|
# If the package is built within kvm the configure test will fail because it starts kvm within kvm
|
2012-08-30 10:27:21 +02:00
|
|
|
# With QEMU in environment qemu and kvm packages are not needed at build time.
|
2013-04-08 20:55:30 +02:00
|
|
|
# With SUPERMIN and SUPERMIN_HELPER in environment, supermin package is not needed at build time.
|
2012-08-16 17:44:26 +02:00
|
|
|
export vmchannel_test=no
|
2014-07-07 10:21:47 +02:00
|
|
|
export QEMU="%{kvm_binary}"
|
2013-04-08 20:55:30 +02:00
|
|
|
export SUPERMIN=supermin
|
|
|
|
export SUPERMIN_HELPER=supermin-helper
|
2012-08-16 11:24:11 +02:00
|
|
|
# for configure macro below
|
2012-09-13 14:54:57 +02:00
|
|
|
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
|
2013-01-03 18:13:23 +01:00
|
|
|
ls -laR /boot/ || :
|
2013-01-03 14:02:54 +01:00
|
|
|
if /sbin/modinfo -k "`env PATH=/sbin:/usr/sbin:$PATH get_kernel_version '%{kernel_binary}'`" virtio-scsi
|
2012-09-13 14:54:57 +02:00
|
|
|
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
|
2012-11-19 18:28:37 +01:00
|
|
|
am_version="`automake --version | awk '/^automake \(GNU automake\) / { print $4 }'`"
|
|
|
|
if test -n "${am_version}"
|
|
|
|
then
|
|
|
|
case "${am_version}" in
|
|
|
|
1.10) ;;
|
|
|
|
1.10.*) ;;
|
|
|
|
*) autoreconf -fi ;;
|
|
|
|
esac
|
|
|
|
fi
|
2012-09-13 14:54:57 +02:00
|
|
|
#
|
2012-08-15 20:06:38 +02:00
|
|
|
%configure \
|
|
|
|
--help || :
|
2013-06-29 18:59:15 +02:00
|
|
|
|
2013-06-29 19:34:19 +02:00
|
|
|
if python --version && ! pkg-config python
|
2013-06-29 18:59:15 +02:00
|
|
|
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 ());'`"
|
2013-07-02 11:28:20 +02:00
|
|
|
export PYTHON_EXT_SUFFIX=.so
|
2013-06-29 18:59:15 +02:00
|
|
|
fi
|
|
|
|
|
2012-08-30 10:27:21 +02:00
|
|
|
#sed -i '1 s@^.*@#!/bin/sh -x@' configure
|
2012-08-15 20:06:38 +02:00
|
|
|
%configure \
|
2012-11-14 17:31:29 +01:00
|
|
|
--docdir=%{guestfs_docdir} \
|
2012-08-29 17:27:00 +02:00
|
|
|
--enable-daemon \
|
|
|
|
--enable-install-daemon \
|
2012-08-30 10:27:21 +02:00
|
|
|
--with-qemu=$QEMU \
|
|
|
|
--without-java \
|
2012-08-15 20:06:38 +02:00
|
|
|
--disable-appliance \
|
|
|
|
--disable-haskell \
|
|
|
|
--disable-php \
|
2012-08-29 14:41:50 +02:00
|
|
|
%{_configure_fuse} \
|
2012-11-19 17:25:26 +01:00
|
|
|
%{_configure_lua} \
|
2012-08-20 10:58:04 +02:00
|
|
|
%{_configure_ocaml} \
|
2012-08-15 20:06:38 +02:00
|
|
|
%{_configure_perl} \
|
|
|
|
%{_configure_python} \
|
|
|
|
%{_configure_ruby} \
|
|
|
|
--disable-rpath \
|
|
|
|
--disable-static
|
2012-08-31 20:20:22 +02:00
|
|
|
# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir instead of the site dir
|
|
|
|
make \
|
|
|
|
INSTALLDIRS=vendor \
|
2012-09-03 11:19:09 +02:00
|
|
|
LD_RUN_PATH= \
|
2013-11-26 11:30:37 +01:00
|
|
|
%{?_smp_mflags}
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%install
|
2013-01-16 18:04:26 +01:00
|
|
|
%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
|
2013-08-05 17:48:49 +02:00
|
|
|
%makeinstall udevrulesdir=%{udevrulesdir}
|
2013-08-22 09:48:54 +02:00
|
|
|
rm -rfv $RPM_BUILD_ROOT%{_libdir}/guestfs/supermin.d
|
2014-01-22 11:15:09 +01:00
|
|
|
#
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/guestfs
|
|
|
|
cp -avLt $RPM_BUILD_ROOT%{_datadir}/guestfs \
|
2014-02-04 22:58:08 +01:00
|
|
|
%{S:10005} \
|
|
|
|
%{S:10004} \
|
2014-01-22 17:49:58 +01:00
|
|
|
%{S:10003} \
|
2014-01-22 11:15:09 +01:00
|
|
|
%{S:10002} \
|
|
|
|
%{S:10001}
|
|
|
|
chmod 0755 $RPM_BUILD_ROOT%{_datadir}/guestfs/*
|
2012-11-13 16:35:37 +01:00
|
|
|
#remove ocaml bindings files if they are disable via rpm macro
|
2013-03-25 15:22:09 +01:00
|
|
|
%if !%{with ocaml_bindings}
|
2012-11-13 16:35:37 +01:00
|
|
|
rm -rfv $RPM_BUILD_ROOT%{_libdir}/ocaml
|
|
|
|
%endif
|
2012-11-14 17:31:29 +01:00
|
|
|
rm -rfv $RPM_BUILD_ROOT%{guestfs_docdir}
|
2012-10-03 17:01:35 +02:00
|
|
|
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
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with perl_bindings}
|
2012-09-13 10:18:28 +02:00
|
|
|
# Delete empty perl bootstrap files
|
|
|
|
find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete
|
2012-09-13 10:40:16 +02:00
|
|
|
# Delete unused perl script without executable permissions
|
|
|
|
find $RPM_BUILD_ROOT%perl_vendorarch/ -name bindtests.pl -print -delete
|
2012-09-03 10:27:00 +02:00
|
|
|
%perl_process_packlist
|
2012-09-05 11:29:37 +02:00
|
|
|
%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
|
2012-09-24 17:29:28 +02:00
|
|
|
%endif
|
2012-09-05 11:29:37 +02:00
|
|
|
#
|
2012-11-19 18:28:37 +01:00
|
|
|
find $RPM_BUILD_ROOT -name "*.la" -print -delete
|
|
|
|
rm -fv $RPM_BUILD_ROOT/%{_libdir}/*.a
|
|
|
|
#
|
2012-08-16 10:35:01 +02:00
|
|
|
touch %{name}.lang
|
2011-10-02 20:45:11 +02:00
|
|
|
%find_lang %{name}
|
2012-08-15 20:06:38 +02:00
|
|
|
#
|
2012-08-31 15:32:43 +02:00
|
|
|
ext_cmds="`
|
2012-08-31 12:10:06 +02:00
|
|
|
objcopy -j .guestfsd_ext_cmds -O binary $RPM_BUILD_ROOT/usr/sbin/guestfsd /dev/stdout |
|
|
|
|
tr '\0' '\n' |
|
2012-08-30 20:40:11 +02:00
|
|
|
sort -u
|
|
|
|
`"
|
2012-08-31 15:32:43 +02:00
|
|
|
test -n "$ext_cmds"
|
|
|
|
#
|
|
|
|
> ext_cmds.txt
|
2012-08-31 12:10:06 +02:00
|
|
|
> missing_cmds.txt
|
2012-09-03 18:05:00 +02:00
|
|
|
# guestfs may call mkfs, but it cant tell in advance which filesystems
|
|
|
|
# it must support. Collect a manual list of possible filesystems so that
|
|
|
|
# the commands get included in the initrd.
|
2012-09-04 08:02:36 +02:00
|
|
|
ext_cmds="$ext_cmds
|
2012-09-05 11:30:26 +02:00
|
|
|
sparsify
|
|
|
|
strace
|
2012-09-04 08:02:36 +02:00
|
|
|
` for fs in \
|
2012-09-03 18:05:00 +02:00
|
|
|
ext2 \
|
|
|
|
ext3 \
|
|
|
|
ext4 \
|
2012-09-25 16:42:26 +02:00
|
|
|
fuse \
|
2012-09-03 18:05:00 +02:00
|
|
|
ntfs \
|
2012-09-25 16:42:26 +02:00
|
|
|
ntfs-3g \
|
2012-09-03 18:05:00 +02:00
|
|
|
reiserfs \
|
|
|
|
jfs \
|
|
|
|
gfs \
|
|
|
|
gfs2 \
|
|
|
|
vfat \
|
|
|
|
msdos \
|
|
|
|
ufs \
|
|
|
|
; do
|
2012-09-25 16:42:26 +02:00
|
|
|
if test -x /sbin/mount.$fs || test -x /usr/sbin/mount.$fs
|
|
|
|
then
|
|
|
|
echo mount.$fs
|
|
|
|
fi
|
2012-09-03 18:05:00 +02:00
|
|
|
echo mkfs.$fs
|
2012-09-03 20:12:05 +02:00
|
|
|
echo fsck.$fs
|
2012-09-04 08:02:36 +02:00
|
|
|
done
|
|
|
|
` "
|
2012-09-03 18:05:00 +02:00
|
|
|
#
|
2012-08-31 15:32:43 +02:00
|
|
|
for cmd in ls $ext_cmds
|
2012-08-30 20:40:11 +02:00
|
|
|
do
|
|
|
|
if test -n "` PATH=$PATH:/sbin:/usr/sbin type -p $cmd `"
|
|
|
|
then
|
2012-08-31 15:32:43 +02:00
|
|
|
echo "#%%programs: $cmd" >> ext_cmds.txt
|
2012-08-30 20:40:11 +02:00
|
|
|
else
|
2012-08-31 15:32:43 +02:00
|
|
|
echo "# missing: $cmd" >> ext_cmds.txt
|
2012-08-31 12:10:06 +02:00
|
|
|
echo "$cmd" >> missing_cmds.txt
|
2012-08-30 20:40:11 +02:00
|
|
|
fi
|
|
|
|
done
|
2012-08-31 15:32:43 +02:00
|
|
|
head -n 1234 ext_cmds.txt missing_cmds.txt
|
2014-01-16 22:11:35 +01:00
|
|
|
%if %{use_included_mkinitrd}
|
|
|
|
ln -sfvbn mkinitrd-2.8.1 mkinitrd
|
|
|
|
ln -sfvbn mkinitrd/sbin/mkinitrd_setup mkinitrd_setup.sh
|
|
|
|
ln -sfvbn mkinitrd/sbin/mkinitrd mkinitrd.sh
|
2014-07-02 11:31:23 +02:00
|
|
|
cp -avL %{S:12} mkinitrd/scripts/boot-dm.sh
|
|
|
|
cp -avL %{S:13} mkinitrd/scripts/setup-dm.sh
|
|
|
|
cp -avL %{S:14} mkinitrd/scripts/boot-lvm2.sh
|
|
|
|
cp -avL %{S:15} mkinitrd/scripts/setup-lvm2.sh
|
|
|
|
cp -avL %{S:16} mkinitrd/scripts/boot-md.sh
|
|
|
|
cp -avL %{S:17} mkinitrd/scripts/setup-md.sh
|
|
|
|
cp -avL %{S:18} mkinitrd/scripts/boot-nfs.sh
|
|
|
|
cp -avL %{S:19} mkinitrd/scripts/setup-nfs.sh
|
2014-07-03 18:14:53 +02:00
|
|
|
cp -avL %{S:20} mkinitrd/scripts/setup-btrfs.sh
|
|
|
|
cp -avL %{S:21} mkinitrd/scripts/setup-btrfs.sh
|
2014-07-08 12:53:33 +02:00
|
|
|
for i in /lib/mkinitrd/scripts/*
|
|
|
|
do
|
|
|
|
if test -f "$i"
|
|
|
|
then
|
|
|
|
cp -avbt mkinitrd/scripts "$i"
|
|
|
|
fi
|
|
|
|
done
|
2014-01-16 22:11:35 +01:00
|
|
|
mkdir -vp mkinitrd/setup mkinitrd/boot
|
|
|
|
ln -sfvbn lib/mkinitrd/bin mkinitrd/bin
|
|
|
|
sed -i~ "s@^INITRD_PATH=/lib/mkinitrd@INITRD_PATH=$PWD/mkinitrd@" mkinitrd/sbin/mkinitrd
|
|
|
|
%else
|
2012-08-29 19:43:39 +02:00
|
|
|
rm -rf mkinitrd
|
|
|
|
cp -av /lib/mkinitrd .
|
2014-01-16 22:11:35 +01:00
|
|
|
ln -sfvbn /sbin/mkinitrd_setup mkinitrd_setup.sh
|
|
|
|
ln -sfvbn /sbin/mkinitrd mkinitrd.sh
|
|
|
|
%endif
|
2012-08-29 19:43:39 +02:00
|
|
|
for bad in \
|
2012-08-31 18:14:04 +02:00
|
|
|
setup-storage.sh \
|
|
|
|
boot-storage.sh \
|
|
|
|
;
|
2012-08-29 19:43:39 +02:00
|
|
|
do
|
|
|
|
rm mkinitrd/scripts/${bad}
|
|
|
|
done
|
|
|
|
cp -avL %{S:10} mkinitrd/scripts/boot-guestfs.sh
|
|
|
|
cp -avL %{S:11} mkinitrd/scripts/setup-guestfs.sh
|
|
|
|
chmod 755 mkinitrd/scripts/*guestfs.sh
|
2012-08-30 20:40:11 +02:00
|
|
|
sed -i~ '
|
|
|
|
/^#@GUESTFS_EXT_CMDS@/ {
|
|
|
|
s@^.*@@
|
2012-08-31 15:32:43 +02:00
|
|
|
r ext_cmds.txt
|
2012-08-30 20:40:11 +02:00
|
|
|
}
|
2012-08-31 12:10:06 +02:00
|
|
|
/@GUESTFS_MISSING_CMDS@/ {
|
|
|
|
s@^.*@missing_commands="@
|
|
|
|
r missing_cmds.txt
|
|
|
|
a \
|
|
|
|
"
|
|
|
|
}
|
2012-08-30 20:40:11 +02:00
|
|
|
' mkinitrd/scripts/boot-guestfs.sh
|
|
|
|
diff -u mkinitrd/scripts/boot-guestfs.sh~ mkinitrd/scripts/boot-guestfs.sh || :
|
2012-08-31 15:32:43 +02:00
|
|
|
#
|
2015-03-09 14:59:16 +01:00
|
|
|
pushd mkinitrd
|
2012-09-28 07:41:58 +02:00
|
|
|
patched=
|
|
|
|
for p in \
|
2014-11-24 17:56:06 +01:00
|
|
|
%{S:1310} \
|
2014-11-26 13:33:58 +01:00
|
|
|
%{S:1230} \
|
2012-09-28 07:41:58 +02:00
|
|
|
%{S:1220} \
|
|
|
|
%{S:1210} \
|
2014-11-26 13:33:58 +01:00
|
|
|
%{S:1140} \
|
|
|
|
%{S:1115} \
|
2012-09-28 07:41:58 +02:00
|
|
|
%{S:1110} \
|
|
|
|
;
|
|
|
|
do
|
2015-03-09 14:59:16 +01:00
|
|
|
if patch --dry-run -p2 < $p
|
2012-09-28 07:41:58 +02:00
|
|
|
then
|
2015-03-09 14:59:16 +01:00
|
|
|
patch -p2 < $p
|
2012-09-28 07:41:58 +02:00
|
|
|
patched=$p
|
|
|
|
break
|
2015-03-09 14:59:16 +01:00
|
|
|
elif patch --dry-run -R -p2 < $p
|
2012-09-28 07:41:58 +02:00
|
|
|
then
|
|
|
|
patched=$p
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2015-03-09 14:59:16 +01:00
|
|
|
popd
|
2012-09-28 07:41:58 +02:00
|
|
|
test -n "$patched"
|
|
|
|
|
2014-01-16 22:11:35 +01:00
|
|
|
./mkinitrd_setup.sh \
|
2012-08-29 19:43:39 +02:00
|
|
|
-s $PWD/mkinitrd/scripts \
|
|
|
|
-i $PWD/mkinitrd
|
|
|
|
mkdir mkinitrd/boot_tmp
|
2013-01-03 14:02:54 +01:00
|
|
|
kver=`env PATH=/sbin:/usr/sbin:$PATH get_kernel_version '%{kernel_binary}'`
|
|
|
|
test -n "${kver}"
|
2012-08-30 10:45:15 +02:00
|
|
|
arch=`arch`
|
|
|
|
%ifarch %ix86
|
2012-12-17 23:49:06 +01:00
|
|
|
arch=i586
|
2012-08-30 10:45:15 +02:00
|
|
|
%endif
|
2013-01-03 17:13:21 +01:00
|
|
|
cp -avL '%{kernel_binary}' mkinitrd/boot_tmp/vmlinuz.${arch}
|
2012-08-30 10:45:15 +02:00
|
|
|
cp -avL /boot/System.map-${kver} mkinitrd/boot_tmp
|
2012-09-28 07:41:58 +02:00
|
|
|
%if 0
|
2012-08-31 15:32:43 +02:00
|
|
|
# [Bug 778149] mkinitrd does not copy links correctly
|
|
|
|
mkdir mkinitrd/bin_tmp
|
2012-09-03 10:27:44 +02:00
|
|
|
for cmd in ` awk '/^#%%programs:/ { print $2 }' mkinitrd/scripts/boot-guestfs.sh | sort -u `
|
2012-08-31 15:32:43 +02:00
|
|
|
do
|
|
|
|
cp -v ` PATH=${RPM_BUILD_ROOT}/usr/bin:${RPM_BUILD_ROOT}/usr/sbin:${PATH}:/sbin:/usr/sbin type -p $cmd ` mkinitrd/bin_tmp/ || :
|
|
|
|
done
|
|
|
|
chmod -v 755 mkinitrd/bin_tmp/*
|
2012-09-28 07:41:58 +02:00
|
|
|
%endif
|
2012-08-31 15:32:43 +02:00
|
|
|
#
|
2012-09-04 21:14:31 +02:00
|
|
|
additional_modules="
|
|
|
|
"
|
2012-09-28 07:41:58 +02:00
|
|
|
env PATH=${RPM_BUILD_ROOT}/usr/bin:${RPM_BUILD_ROOT}/usr/sbin:${PATH} \
|
2014-12-09 16:46:21 +01:00
|
|
|
LIBGUESTFS_SRC_APPLIANCE_DIR=`cd $PWD/appliance ; pwd -P` \
|
2012-08-31 14:12:40 +02:00
|
|
|
bash -x \
|
2014-01-16 22:11:35 +01:00
|
|
|
./mkinitrd.sh \
|
2012-08-29 19:43:39 +02:00
|
|
|
-l $PWD/mkinitrd \
|
2012-08-30 10:45:15 +02:00
|
|
|
-k vmlinuz.${arch} \
|
|
|
|
-i initramfs.${arch}.img \
|
2012-08-29 19:43:39 +02:00
|
|
|
-b $PWD/mkinitrd/boot_tmp \
|
2012-09-04 21:14:31 +02:00
|
|
|
-m "$additional_modules" \
|
2015-03-09 15:15:20 +01:00
|
|
|
-f "lvm2 dm md network nfs btrfs usb" \
|
2012-08-29 19:43:39 +02:00
|
|
|
-B
|
|
|
|
#
|
|
|
|
mkdir -vp $RPM_BUILD_ROOT%{_libdir}/guestfs
|
2012-08-30 10:45:15 +02:00
|
|
|
cp -avLt $RPM_BUILD_ROOT%{_libdir}/guestfs/ \
|
|
|
|
mkinitrd/boot_tmp/initramfs.${arch}.img \
|
|
|
|
mkinitrd/boot_tmp/vmlinuz.${arch}
|
2014-06-06 14:35:32 +02:00
|
|
|
chmod 644 $RPM_BUILD_ROOT%{_libdir}/guestfs/initramfs.${arch}.img
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%post -n libguestfs0 -p /sbin/ldconfig
|
|
|
|
%postun -n libguestfs0 -p /sbin/ldconfig
|
|
|
|
|
2014-01-22 11:15:09 +01:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_datadir}/guestfs
|
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%files -n guestfs-data
|
2011-10-02 20:45:11 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/guestfs
|
|
|
|
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ocaml_bindings}
|
2012-09-01 20:26:42 +02:00
|
|
|
%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
|
2013-01-16 18:04:26 +01:00
|
|
|
%if %opt
|
2012-09-01 20:26:42 +02:00
|
|
|
%{_libdir}/ocaml/guestfs/*.cmx
|
|
|
|
%{_libdir}/ocaml/guestfs/*.cmxa
|
2013-01-16 18:04:26 +01:00
|
|
|
%endif
|
2012-09-01 20:26:42 +02:00
|
|
|
%{_libdir}/ocaml/guestfs/*.mli
|
|
|
|
%endif
|
2012-08-15 20:06:38 +02:00
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with lua_bindings}
|
2012-11-19 17:25:26 +01:00
|
|
|
%files -n lua-libguestfs
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/lua
|
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with perl_bindings}
|
2012-09-01 14:15:10 +02:00
|
|
|
%post -n perl-Sys-Guestfs -p /sbin/ldconfig
|
2012-08-15 20:06:38 +02:00
|
|
|
|
2012-09-01 14:15:10 +02:00
|
|
|
%postun -n perl-Sys-Guestfs -p /sbin/ldconfig
|
2012-08-15 20:06:38 +02:00
|
|
|
|
2012-09-05 11:29:37 +02:00
|
|
|
%files -n perl-Sys-Guestfs -f %{name}.files
|
2012-08-15 20:06:38 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with python_bindings}
|
2012-09-01 15:41:10 +02:00
|
|
|
%files -n python-libguestfs
|
2012-08-15 20:06:38 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/python%{pyver}/site-packages/*
|
|
|
|
%endif
|
|
|
|
#
|
2013-03-25 15:22:09 +01:00
|
|
|
%if %{with ruby_bindings}
|
2011-10-02 20:45:11 +02:00
|
|
|
%files -n rubygem-libguestfs
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/ruby
|
2012-08-15 20:06:38 +02:00
|
|
|
%endif
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%files -n libguestfs0
|
|
|
|
%defattr(-,root,root)
|
2012-11-14 17:53:23 +01:00
|
|
|
%doc COPYING.LIB
|
2011-10-02 20:45:11 +02:00
|
|
|
%{_libdir}/*.so.*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/*.so
|
2012-07-02 19:58:52 +02:00
|
|
|
%{_libdir}/pkgconfig/*
|
2011-10-02 20:45:11 +02:00
|
|
|
%{_includedir}/guestfs.h
|
2012-08-18 16:38:57 +02:00
|
|
|
%{_mandir}/man3/*
|
2011-10-02 20:45:11 +02:00
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%files -n guestfsd
|
2012-09-01 20:53:34 +02:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_sbindir}/guestfsd
|
2012-10-08 12:07:43 +02:00
|
|
|
%{_mandir}/man8/*
|
2012-09-01 20:53:34 +02:00
|
|
|
|
2012-09-13 20:07:18 +02:00
|
|
|
%files -n guestfs-tools -f %{name}.lang
|
2011-10-02 20:45:11 +02:00
|
|
|
%defattr(-,root,root)
|
2012-11-14 17:53:23 +01:00
|
|
|
%doc COPYING
|
2011-10-02 20:45:11 +02:00
|
|
|
%{_bindir}/*
|
|
|
|
%config(noreplace) /etc/libguestfs-tools.conf
|
2014-07-31 15:54:21 +02:00
|
|
|
%if %{with ocaml_bindings}
|
2014-03-28 15:19:16 +01:00
|
|
|
/etc/virt-builder
|
|
|
|
%dir /etc/xdg/virt-builder
|
|
|
|
%dir /etc/xdg/virt-builder/repos.d
|
|
|
|
%config /etc/xdg/virt-builder/repos.d/*
|
2014-07-31 15:54:21 +02:00
|
|
|
%endif
|
2013-08-20 16:50:12 +02:00
|
|
|
%if %{with bash_completion}
|
|
|
|
%{_datadir}/bash-completion
|
|
|
|
%endif
|
2012-08-18 16:38:57 +02:00
|
|
|
%{_mandir}/man1/*
|
2013-11-26 11:30:37 +01:00
|
|
|
%{_mandir}/man5/*
|
2011-10-02 20:45:11 +02:00
|
|
|
|
|
|
|
%changelog
|