psss / rpms / libguestfs

Forked from rpms/libguestfs 5 years ago
Clone
10e7d8d
# Enable to build w/o network.
10e7d8d
%global buildnonet 1
10e7d8d
10e7d8d
Summary:     Access and modify virtual machine disk images
10e7d8d
Name:        libguestfs
10e7d8d
Version:     1.0.21
b8edfb0
Release:     4%{?dist}
10e7d8d
License:     LGPLv2+
10e7d8d
Group:       Development/Libraries
10e7d8d
URL:         http://et.redhat.com/~rjones/libguestfs/
10e7d8d
Source0:     http://et.redhat.com/~rjones/libguestfs/files/%{name}-%{version}.tar.gz
10e7d8d
BuildRoot:   %{_tmppath}/%{name}-%{version}-%{release}-root
10e7d8d
10e7d8d
# Currently fails on non-x86 because of this error:
10e7d8d
# "qemu: linux kernel too old to load a ram disk"
10e7d8d
ExclusiveArch: %{ix86} x86_64
10e7d8d
10e7d8d
# Basic build requirements:
10e7d8d
BuildRequires: /usr/bin/pod2man
10e7d8d
BuildRequires: /usr/bin/pod2text
10e7d8d
BuildRequires: febootstrap >= 1.5
10e7d8d
BuildRequires: augeas-devel >= 0.5.0
10e7d8d
BuildRequires: readline-devel
b8edfb0
BuildRequires: qemu
10e7d8d
BuildRequires: createrepo
10e7d8d
10e7d8d
# This is only needed for RHEL 5 because readline-devel doesn't
10e7d8d
# properly depend on it, but doesn't do any harm on other platforms:
10e7d8d
BuildRequires: ncurses-devel
10e7d8d
10e7d8d
# Build requirements for the appliance:
10e7d8d
# (see 'make-initramfs.sh.in' in the source)
10e7d8d
BuildRequires: kernel, bash, coreutils, lvm2, ntfs-3g, util-linux-ng
10e7d8d
BuildRequires: MAKEDEV, net-tools, augeas-libs, file
10e7d8d
BuildRequires: module-init-tools, procps, strace, iputils
10e7d8d
BuildRequires: grub, dosfstools, ntfsprogs
10e7d8d
10e7d8d
# These are only required if you want to build the bindings for
10e7d8d
# different languages:
10e7d8d
BuildRequires: ocaml
10e7d8d
BuildRequires: ocaml-findlib-devel
10e7d8d
BuildRequires: perl-devel
10e7d8d
BuildRequires: perl-Test-Simple
10e7d8d
BuildRequires: perl-Test-Pod
10e7d8d
BuildRequires: perl-Test-Pod-Coverage
10e7d8d
BuildRequires: perl-ExtUtils-MakeMaker
10e7d8d
BuildRequires: python-devel
10e7d8d
BuildRequires: ruby-devel
10e7d8d
BuildRequires: rubygem-rake
10e7d8d
BuildRequires: java >= 1.5.0
10e7d8d
BuildRequires: jpackage-utils
10e7d8d
BuildRequires: java-devel
10e7d8d
10e7d8d
# For virt-inspector:
10e7d8d
BuildRequires: perl-Sys-Virt
10e7d8d
10e7d8d
# Runtime requires:
10e7d8d
Requires:    qemu >= 0.10-7
10e7d8d
10e7d8d
10e7d8d
%description
10e7d8d
Libguestfs is a library for accessing and modifying guest disk images.
10e7d8d
Amongst the things this is good for: making batch configuration
10e7d8d
changes to guests, getting disk used/free statistics (see also:
10e7d8d
virt-df), migrating between virtualization systems (see also:
10e7d8d
virt-p2v), performing partial backups, performing partial guest
10e7d8d
clones, cloning guests and changing registry/UUID/hostname info, and
10e7d8d
much else besides.
10e7d8d
10e7d8d
Libguestfs uses Linux kernel and qemu code, and can access any type of
10e7d8d
guest filesystem that Linux and qemu can, including but not limited
10e7d8d
to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition
10e7d8d
schemes, qcow, qcow2, vmdk.
10e7d8d
10e7d8d
Libguestfs provides ways to enumerate guest storage (eg. partitions,
10e7d8d
LVs, what filesystem is in each LV, etc.).  It can also run commands
10e7d8d
in the context of the guest.  Also you can access filesystems over FTP.
10e7d8d
10e7d8d
Libguestfs is a library that can be linked with C and C++ management
10e7d8d
programs.
10e7d8d
10e7d8d
See also the 'guestfish' package for shell scripting and command line
10e7d8d
access.
10e7d8d
10e7d8d
For Perl bindings, see 'perl-libguestfs'.
10e7d8d
10e7d8d
For OCaml bindings, see 'ocaml-libguestfs-devel'.
10e7d8d
10e7d8d
For Python bindings, see 'python-libguestfs'.
10e7d8d
10e7d8d
For Ruby bindings, see 'ruby-libguestfs'.
10e7d8d
10e7d8d
For Java bindings, see 'libguestfs-java-devel'.
10e7d8d
10e7d8d
10e7d8d
%package devel
10e7d8d
Summary:     Development tools and libraries for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    pkgconfig
10e7d8d
10e7d8d
10e7d8d
%description devel
10e7d8d
%{name}-devel contains development tools and libraries
10e7d8d
for %{name}.
10e7d8d
10e7d8d
10e7d8d
%package -n guestfish
10e7d8d
Summary:     Shell for accessing and modifying virtual machine disk images
10e7d8d
Group:       Development/Tools
10e7d8d
License:     GPLv2+
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    /usr/bin/pod2text
10e7d8d
10e7d8d
10e7d8d
%description -n guestfish
10e7d8d
Guestfish is the Filesystem Interactive SHell, for accessing and
10e7d8d
modifying virtual machine disk images from the command line and shell
10e7d8d
scripts.
10e7d8d
10e7d8d
10e7d8d
%package -n virt-inspector
10e7d8d
Summary:     Display OS version, kernel, drivers, etc in a virtual machine
10e7d8d
Group:       Development/Tools
10e7d8d
License:     GPLv2+
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    guestfish
10e7d8d
Requires:    perl-Sys-Virt
10e7d8d
10e7d8d
10e7d8d
%description -n virt-inspector
10e7d8d
Virt-inspector examines a virtual machine and tries to determine the
10e7d8d
version of the OS, the kernel version, what drivers are installed,
10e7d8d
whether the virtual machine is fully virtualized (FV) or
10e7d8d
para-virtualized (PV), what applications are installed and more.
10e7d8d
10e7d8d
10e7d8d
%package -n ocaml-%{name}
10e7d8d
Summary:     OCaml bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
10e7d8d
10e7d8d
%description -n ocaml-%{name}
10e7d8d
ocaml-%{name} contains OCaml bindings for %{name}.
10e7d8d
10e7d8d
This is for toplevel and scripting access only.  To compile OCaml
10e7d8d
programs which use %{name} you will also need ocaml-%{name}-devel.
10e7d8d
10e7d8d
10e7d8d
%package -n ocaml-%{name}-devel
10e7d8d
Summary:     OCaml bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    ocaml-%{name} = %{version}-%{release}
10e7d8d
10e7d8d
10e7d8d
%description -n ocaml-%{name}-devel
10e7d8d
ocaml-%{name}-devel contains development libraries
10e7d8d
required to use the OCaml bindings for %{name}.
10e7d8d
10e7d8d
10e7d8d
%package -n perl-%{name}
10e7d8d
Summary:     Perl bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
10e7d8d
10e7d8d
10e7d8d
%description -n perl-%{name}
10e7d8d
perl-%{name} contains Perl bindings for %{name}.
10e7d8d
10e7d8d
10e7d8d
%package -n python-%{name}
10e7d8d
Summary:     Python bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
10e7d8d
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
10e7d8d
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
10e7d8d
10e7d8d
%description -n python-%{name}
10e7d8d
python-%{name} contains Python bindings for %{name}.
10e7d8d
10e7d8d
10e7d8d
%package -n ruby-%{name}
10e7d8d
Summary:     Ruby bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    ruby(abi) = 1.8
10e7d8d
Provides:    ruby(guestfs) = %{version}
10e7d8d
10e7d8d
%{!?ruby_sitelib: %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")}
10e7d8d
%{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")}
10e7d8d
10e7d8d
%description -n ruby-%{name}
10e7d8d
ruby-%{name} contains Ruby bindings for %{name}.
10e7d8d
10e7d8d
10e7d8d
%package java
10e7d8d
Summary:     Java bindings for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    java >= 1.5.0
10e7d8d
Requires:    jpackage-utils
10e7d8d
10e7d8d
%description java
10e7d8d
%{name}-java contains Java bindings for %{name}.
10e7d8d
10e7d8d
If you want to develop software in Java which uses %{name}, then
10e7d8d
you will also need %{name}-java-devel.
10e7d8d
10e7d8d
10e7d8d
%package java-devel
10e7d8d
Summary:     Java development package for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    %{name}-java = %{version}-%{release}
10e7d8d
10e7d8d
%description java-devel
10e7d8d
%{name}-java-devel contains the tools for developing Java software
10e7d8d
using %{name}.
10e7d8d
10e7d8d
See also %{name}-javadoc.
10e7d8d
10e7d8d
10e7d8d
%package javadoc
10e7d8d
Summary:     Java documentation for %{name}
10e7d8d
Group:       Development/Libraries
10e7d8d
Requires:    %{name} = %{version}-%{release}
10e7d8d
Requires:    %{name}-java = %{version}-%{release}
10e7d8d
Requires:    jpackage-utils
10e7d8d
10e7d8d
%description javadoc
10e7d8d
%{name}-javadoc contains the Java documentation for %{name}.
10e7d8d
10e7d8d
10e7d8d
%prep
10e7d8d
%setup -q
10e7d8d
10e7d8d
mkdir -p daemon/m4
10e7d8d
10e7d8d
10e7d8d
%build
10e7d8d
%if %{buildnonet}
10e7d8d
mkdir repo
10e7d8d
find /var/cache/yum/build -type f -name '*.rpm' -print0 | xargs -0 cp -t repo
10e7d8d
createrepo repo
10e7d8d
%define extra --with-mirror=file://$(pwd)/repo --with-repo=fedora-12
10e7d8d
%else
10e7d8d
%define extra %nil
10e7d8d
%endif
10e7d8d
de88fe3
vmchannel_test=no \
10e7d8d
./configure \
10e7d8d
  --prefix=%{_prefix} --libdir=%{_libdir} \
10e7d8d
  --mandir=%{_mandir} \
10e7d8d
  --with-java-home=%{java_home} \
10e7d8d
  --with-qemu="qemu-kvm qemu-system-%{_build_arch} qemu" \
10e7d8d
  --enable-debug-command \
10e7d8d
  %{extra}
10e7d8d
10e7d8d
# This ensures that /usr/sbin/chroot is on the path.  Not needed
10e7d8d
# except for RHEL 5, it shouldn't do any harm on other platforms.
10e7d8d
export PATH=/usr/sbin:$PATH
10e7d8d
10e7d8d
# 'INSTALLDIRS' ensures that perl libs are installed in the vendor dir
10e7d8d
# not the site dir.
10e7d8d
make INSTALLDIRS=vendor %{?_smp_mflags}
10e7d8d
10e7d8d
10e7d8d
%install
10e7d8d
rm -rf $RPM_BUILD_ROOT
10e7d8d
10e7d8d
make DESTDIR=$RPM_BUILD_ROOT install
10e7d8d
10e7d8d
rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.a
10e7d8d
rm $RPM_BUILD_ROOT%{_libdir}/libguestfs.la
10e7d8d
10e7d8d
# Clean up the examples/ directory which will get installed in %doc.
10e7d8d
# Note we can't delete the original examples/Makefile because that
10e7d8d
# will be needed by the check section later in the RPM build.
10e7d8d
cp -a examples ex
10e7d8d
pushd ex
10e7d8d
make clean
10e7d8d
rm Makefile*
10e7d8d
rm -rf .deps .libs
10e7d8d
popd
10e7d8d
10e7d8d
# Same for ocaml/examples.
10e7d8d
cp -a ocaml/examples ocaml/ex
10e7d8d
pushd ocaml/ex
10e7d8d
make clean
10e7d8d
rm Makefile*
10e7d8d
popd
10e7d8d
10e7d8d
find $RPM_BUILD_ROOT -name perllocal.pod -delete
10e7d8d
find $RPM_BUILD_ROOT -name .packlist -delete
10e7d8d
find $RPM_BUILD_ROOT -name '*.bs' -delete
10e7d8d
10e7d8d
rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.a
10e7d8d
rm $RPM_BUILD_ROOT%{python_sitearch}/libguestfsmod.la
10e7d8d
10e7d8d
if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
10e7d8d
   mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
10e7d8d
   mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
10e7d8d
     $RPM_BUILD_ROOT%{python_sitelib}/
10e7d8d
fi
10e7d8d
10e7d8d
# Install ruby bindings by hand.
10e7d8d
mkdir -p $RPM_BUILD_ROOT%{ruby_sitelib}
10e7d8d
mkdir -p $RPM_BUILD_ROOT%{ruby_sitearch}
10e7d8d
install -p -m0644 ruby/lib/guestfs.rb $RPM_BUILD_ROOT%{ruby_sitelib}
10e7d8d
install -p -m0755 ruby/ext/guestfs/_guestfs.so $RPM_BUILD_ROOT%{ruby_sitearch}
10e7d8d
10e7d8d
# Remove static-linked Java bindings.
10e7d8d
rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.a
10e7d8d
rm $RPM_BUILD_ROOT%{_libdir}/libguestfs_jni.la
10e7d8d
10e7d8d
# Generator shouldn't be executable when we distribute it.
10e7d8d
chmod -x src/generator.ml
10e7d8d
10e7d8d
10e7d8d
%clean
10e7d8d
rm -rf $RPM_BUILD_ROOT
10e7d8d
10e7d8d
10e7d8d
%post -p /sbin/ldconfig
10e7d8d
10e7d8d
%postun -p /sbin/ldconfig
10e7d8d
10e7d8d
10e7d8d
%files
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc COPYING
10e7d8d
%{_libdir}/guestfs/
10e7d8d
%{_libdir}/libguestfs.so.*
10e7d8d
10e7d8d
10e7d8d
%files devel
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc ChangeLog HACKING TODO README ex html/guestfs.3.html html/pod.css
10e7d8d
%doc src/generator.ml
10e7d8d
%{_libdir}/libguestfs.so
10e7d8d
%{_mandir}/man3/guestfs.3*
10e7d8d
%{_includedir}/guestfs.h
10e7d8d
%{_includedir}/guestfs-actions.h
10e7d8d
%{_includedir}/guestfs-structs.h
10e7d8d
%{_libdir}/pkgconfig/libguestfs.pc
10e7d8d
10e7d8d
10e7d8d
%files -n guestfish
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc html/guestfish.1.html html/pod.css recipes/
10e7d8d
%{_bindir}/guestfish
10e7d8d
%{_mandir}/man1/guestfish.1*
10e7d8d
10e7d8d
10e7d8d
%files -n virt-inspector
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%{_bindir}/virt-inspector
10e7d8d
%{_mandir}/man1/virt-inspector.1*
10e7d8d
10e7d8d
10e7d8d
%files -n ocaml-%{name}
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{_libdir}/ocaml/guestfs
10e7d8d
%exclude %{_libdir}/ocaml/guestfs/*.a
10e7d8d
%exclude %{_libdir}/ocaml/guestfs/*.cmxa
10e7d8d
%exclude %{_libdir}/ocaml/guestfs/*.cmx
10e7d8d
%exclude %{_libdir}/ocaml/guestfs/*.mli
10e7d8d
%{_libdir}/ocaml/stublibs/*.so
10e7d8d
%{_libdir}/ocaml/stublibs/*.so.owner
10e7d8d
10e7d8d
10e7d8d
%files -n ocaml-%{name}-devel
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc ocaml/ex
10e7d8d
%{_libdir}/ocaml/guestfs/*.a
10e7d8d
%{_libdir}/ocaml/guestfs/*.cmxa
10e7d8d
%{_libdir}/ocaml/guestfs/*.cmx
10e7d8d
%{_libdir}/ocaml/guestfs/*.mli
10e7d8d
10e7d8d
10e7d8d
%files -n perl-%{name}
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc perl/examples
10e7d8d
%{perl_vendorarch}/*
10e7d8d
%{_mandir}/man3/Sys::Guestfs.3pm*
10e7d8d
10e7d8d
10e7d8d
%files -n python-%{name}
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{python_sitearch}/*
10e7d8d
%{python_sitelib}/*.py
10e7d8d
%{python_sitelib}/*.pyc
10e7d8d
%{python_sitelib}/*.pyo
10e7d8d
10e7d8d
10e7d8d
%files -n ruby-%{name}
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{ruby_sitelib}/guestfs.rb
10e7d8d
%{ruby_sitearch}/_guestfs.so
10e7d8d
10e7d8d
10e7d8d
%files java
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{_libdir}/libguestfs_jni*.so.*
10e7d8d
%{_datadir}/java/*.jar
10e7d8d
10e7d8d
10e7d8d
%files java-devel
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{_libdir}/libguestfs_jni*.so
10e7d8d
10e7d8d
10e7d8d
%files javadoc
10e7d8d
%defattr(-,root,root,-)
10e7d8d
%doc README
10e7d8d
%{_datadir}/javadoc/%{name}-java-%{version}
10e7d8d
10e7d8d
10e7d8d
%changelog
b8edfb0
* Fri May  8 2009 Richard Jones <rjones@redhat.com> - 1.0.21-4
10e7d8d
- New upstream version 1.0.21.
10e7d8d
10e7d8d
* Thu May  7 2009 Richard Jones <rjones@redhat.com> - 1.0.20-2
10e7d8d
- New upstream version 1.0.20.
10e7d8d
10e7d8d
* Thu May  7 2009 Richard Jones <rjones@redhat.com> - 1.0.19-1
10e7d8d
- New upstream version 1.0.19.
10e7d8d
10e7d8d
* Tue Apr 28 2009 Richard Jones <rjones@redhat.com> - 1.0.15-1
10e7d8d
- New upstream version 1.0.15.
10e7d8d
10e7d8d
* Fri Apr 24 2009 Richard Jones <rjones@redhat.com> - 1.0.12-1
10e7d8d
- New upstream version 1.0.12.
10e7d8d
10e7d8d
* Wed Apr 22 2009 Richard Jones <rjones@redhat.com> - 1.0.6-1
10e7d8d
- New upstream version 1.0.6.
10e7d8d
10e7d8d
* Mon Apr 20 2009 Richard Jones <rjones@redhat.com> - 1.0.2-1
10e7d8d
- New upstream version 1.0.2.
10e7d8d
10e7d8d
* Thu Apr 16 2009 Richard Jones <rjones@redhat.com> - 0.9.9-12
10e7d8d
- Multiple fixes to get it to scratch build in Koji.
10e7d8d
10e7d8d
* Sat Apr  4 2009 Richard Jones <rjones@redhat.com> - 0.9.9-1
10e7d8d
- Initial build.