# TODO:
-# - finish haskell bindings
+# - finish haskell bindings (when finished upstream, not ready as of 1.20.2)
# - systemtap probes
# - PLD appliance support? (needs at least package list adjustment)
#
# Conditional build:
%bcond_with static_libs # build static libraries
+%bcond_with appliance # appliance build (no PLD support)
%bcond_without erlang # Erlang binding
-%bcond_with haskell # Haskell (GHC) binding [incomplete]
+%bcond_with haskell # Haskell (GHC) binding [incomplete, nothing is installed]
%bcond_without java # Java binding
+%bcond_without lua # Lua binding
%bcond_without ocaml # OCaml binding and tools
%bcond_without perl # Perl binding
%bcond_without perltools # Perl tools
%bcond_without php # PHP binding
%bcond_without python # Python binding
%bcond_without ruby # Ruby binding
-#
+
%include /usr/lib/rpm/macros.perl
%include /usr/lib/rpm/macros.java
Summary: Library and tools for accessing and modifying virtual machine disk images
Summary(pl.UTF-8): Biblioteka i narzędzia do dostępu i modyfikacji obrazów dysków maszyn wirtualnych
Name: libguestfs
-Version: 1.18.8
+Version: 1.22.4
Release: 1
License: LGPL v2+
Group: Libraries
-Source0: http://libguestfs.org/download/1.18-stable/%{name}-%{version}.tar.gz
-# Source0-md5: 043d4e5c89a8cb21834896acaa8c541c
+Source0: http://libguestfs.org/download/1.22-stable/%{name}-%{version}.tar.gz
+# Source0-md5: 8317fd78d47afb05d11200a3e747bef1
Patch0: ncurses.patch
Patch1: augeas-libxml2.patch
Patch2: %{name}-link.patch
+Patch3: %{name}-am.patch
+Patch4: %{name}-completionsdir.patch
URL: http://libguestfs.org/
+BuildRequires: acl-devel
BuildRequires: attr-devel
-BuildRequires: augeas-devel
+BuildRequires: augeas-devel >= 0.5.0
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: cdrkit-mkisofs
-BuildRequires: cpio
BuildRequires: db-utils
# erl_interface package
%{?with_erlang:BuildRequires: erlang}
-#BuildRequires: febootstrap >= 3.0
+%if %{with appliance}
+#BuildRequires: febootstrap >= 3.20
+# or
+#BuildRequires: supermin >= 4.1.0
+%endif
BuildRequires: gettext-devel
%{?with_haskell:BuildRequires: ghc}
BuildRequires: glib2-devel >= 1:2.26.0
BuildRequires: gobject-introspection-devel >= 1.30.0
BuildRequires: gperf
BuildRequires: gtk-doc >= 1.14
-BuildRequires: hivex-devel
+BuildRequires: hivex-devel >= 1.2.7
%{?with_java:BuildRequires: jdk}
+BuildRequires: libcap-devel
BuildRequires: libconfig-devel
BuildRequires: libfuse-devel
BuildRequires: libmagic-devel
BuildRequires: libselinux-devel
BuildRequires: libtool
-BuildRequires: libvirt-devel
+BuildRequires: libvirt-devel >= 0.10.2
BuildRequires: libxml2-devel >= 2.0
BuildRequires: libxml2-progs
+%{?with_java:BuildRequires: rpm-javaprov}
+%if %{with lua}
+# use 5.2 as 5.1 packaging in PLD was incompatible with what's expected by configure
+BuildRequires: lua52
+BuildRequires: lua52-devel
+%endif
BuildRequires: ncurses-devel
%if %{with ocaml}
BuildRequires: ocaml
+BuildRequires: ocaml-camlp4
+BuildRequires: ocaml-fileutils
BuildRequires: ocaml-findlib
BuildRequires: ocaml-gettext-devel
BuildRequires: ocaml-pcre-devel
%if %{with perl}
BuildRequires: perl-ExtUtils-MakeMaker
BuildRequires: perl-Test-Simple
+BuildRequires: rpm-perlprov
%endif
%if %{with perltools}
-BuildRequires: perl-String-ShellQuote
-BuildRequires: perl-Sys-Virt
-BuildRequires: perl-hivex
-BuildRequires: perl-libintl
-BuildRequires: perl-modules
BuildRequires: perl(Data::Dumper)
BuildRequires: perl(Getopt::Long)
BuildRequires: perl(Locale::TextDomain)
BuildRequires: perl(Pod::Man)
BuildRequires: perl(Pod::Simple)
BuildRequires: perl(Pod::Usage)
+BuildRequires: perl-String-ShellQuote
+BuildRequires: perl-Sys-Virt
+BuildRequires: perl-hivex >= 1.2.7
+BuildRequires: perl-libintl
+BuildRequires: perl-modules
%endif
+%{?with_php:BuildRequires: /usr/bin/php}
%{?with_php:BuildRequires: php-devel}
BuildRequires: pkgconfig
BuildRequires: po4a
%if %{with python}
BuildRequires: python
BuildRequires: python-devel
+BuildRequires: rpm-pythonprov
%endif
BuildRequires: readline-devel
-BuildRequires: rpmbuild(macros) >= 1.322
+BuildRequires: rpmbuild(macros) >= 1.656
%if %{with ruby}
+BuildRequires: rpm-rubyprov
BuildRequires: ruby
BuildRequires: ruby-devel
BuildRequires: ruby-rake
+BuildRequires: ruby-rdoc
+BuildRequires: ruby-rubygems
%endif
-Requires: qemu-common
+BuildRequires: yajl-devel >= 2
+Requires: qemu-common >= 1.1.0
Suggests: db-utils
Suggests: icoutils
Suggests: netpbm-progs
%description -n java-libguestfs-javadoc -l pl.UTF-8
Wiązania Javy do libguestfs - dokumentacja.
+%package -n lua-libguestfs
+Summary: Lua bindings for libguestfs
+Summary(pl.UTF-8): Wiązania języka Lua do libguestfs
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+
+%description -n lua-libguestfs
+Lua bindings for libguestfs.
+
+%description -n lua-libguestfs -l pl.UTF-8
+Wiązania języka Lua do libguestfs.
+
%package -n ocaml-libguestfs
Summary: OCaml bindings for libguestfs
Summary(pl.UTF-8): Wiązania OCamla do libguestfs
Requires: %{name} = %{version}-%{release}
Suggests: perl-Sys-Virt
Suggests: perl-XML-XPath
-Suggests: perl-hivex
+Suggests: perl-hivex >= 1.2.7
%description -n perl-libguestfs
Perl bindings for libguestfs.
Summary: bash-completion for libguestfs tools
Summary(pl.UTF-8): Bashowe uzupełnianie argumentów dla narzędzi libguestfs
Group: Applications/Shells
-Requires: bash-completion
+Requires: bash-completion >= 2.0
%description -n bash-completion-libguestfs
bash-completion for guestfish tool.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
%{__automake}
%configure \
vmchannel_test=no \
+ %{?with_lua:LUA=/usr/bin/lua5.2} \
PBMTEXT=/usr/bin/pbmtext \
PNMTOPNG=/usr/bin/pnmtopng \
BMPTOPNM=/usr/bin/bmptopnm \
PAMCUT=/usr/bin/pamcut \
WRESTOOL=/usr/bin/wrestool \
QEMU=%{_bindir}/qemu \
+ --with-completionsdir=%{_datadir}/bash-completion/completions \
--with-html-dir=%{_gtkdocdir} \
- --with-java-home=%{?with_java:%{java_home}}%{!?with_java:no} \
+ --with-java=%{?with_java:%{java_home}}%{!?with_java:no} \
--with-qemu=qemu \
--enable-install-daemon \
- --disable-appliance \
+ %{!?with_appliance:--disable-appliance} \
%{!?with_erlang:--disable-erlang} \
%{!?with_haskell:--disable-haskell} \
+ %{!?with_lua:--disable-lua} \
%{!?with_ocaml:--disable-ocaml} \
%{!?with_perl:--disable-perl} \
%{!?with_php:--disable-php} \
DESTDIR=$RPM_BUILD_ROOT \
phpdir=%{_sysconfdir}/php/conf.d
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la \
- $RPM_BUILD_ROOT%{py_sitedir}/*.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
+%if %{with lua}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lua/*/*.la
+%endif
+%if %{with python}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/*.la
+%endif
%py_comp $RPM_BUILD_ROOT%{py_sitedir}
%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
%files -f %{name}.lang
%defattr(644,root,root,755)
-%doc AUTHORS BUGS ChangeLog README RELEASE-NOTES ROADMAP TODO
+%doc AUTHORS BUGS ChangeLog README ROADMAP TODO
%attr(755,root,root) %{_libdir}/libguestfs.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libguestfs.so.0
+%{_mandir}/man1/guestfs-release-notes.1*
+%lang(ja) %{_mandir}/ja/man1/guestfs-release-notes.1*
+%lang(uk) %{_mandir}/uk/man1/guestfs-release-notes.1*
%files devel
%defattr(644,root,root,755)
%{_includedir}/guestfs-gobject.h
%{_includedir}/guestfs-gobject
%{_datadir}/gir-1.0/Guestfs-1.0.gir
+%{_pkgconfigdir}/libguestfs-gobject-1.0.pc
%if %{with static_libs}
%files gobject-static
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/guestfish
%attr(755,root,root) %{_bindir}/guestmount
+%attr(755,root,root) %{_bindir}/guestunmount
%attr(755,root,root) %{_bindir}/libguestfs-test-tool
%attr(755,root,root) %{_bindir}/virt-alignment-scan
%attr(755,root,root) %{_bindir}/virt-cat
%attr(755,root,root) %{_bindir}/virt-tar-in
%attr(755,root,root) %{_bindir}/virt-tar-out
%attr(755,root,root) %{_sbindir}/guestfsd
+%attr(755,root,root) %{_sbindir}/libguestfs-make-fixed-appliance
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libguestfs-tools.conf
+/lib/udev/rules.d/99-guestfs-serial.rules
+%dir %{_libdir}/guestfs
+%dir %{_libdir}/guestfs/supermin.d
+%{_libdir}/guestfs/supermin.d/daemon.img
+%{_libdir}/guestfs/supermin.d/init.img
+%{_libdir}/guestfs/supermin.d/udev-rules.img
+%if %{with appliance}
+%{_libdir}/guestfs/supermin.d/base.img
+%{_libdir}/guestfs/supermin.d/hostfiles
+%endif
%{_mandir}/man1/guestfish.1*
%{_mandir}/man1/guestfs-faq.1*
%{_mandir}/man1/guestfs-performance.1*
%{_mandir}/man1/guestfs-recipes.1*
%{_mandir}/man1/guestfs-testing.1*
%{_mandir}/man1/guestmount.1*
+%{_mandir}/man1/guestunmount.1*
+%{_mandir}/man1/libguestfs-make-fixed-appliance.1*
%{_mandir}/man1/libguestfs-test-tool.1*
%{_mandir}/man1/virt-alignment-scan.1*
%{_mandir}/man1/virt-cat.1*
%{_mandir}/man1/virt-rescue.1*
%{_mandir}/man1/virt-tar-in.1*
%{_mandir}/man1/virt-tar-out.1*
+%{_mandir}/man8/guestfsd.8*
%lang(ja) %{_mandir}/ja/man1/guestfish.1*
%lang(ja) %{_mandir}/ja/man1/guestfs-faq.1*
%lang(ja) %{_mandir}/ja/man1/guestfs-performance.1*
%lang(ja) %{_mandir}/ja/man1/guestfs-recipes.1*
%lang(ja) %{_mandir}/ja/man1/guestfs-testing.1*
%lang(ja) %{_mandir}/ja/man1/guestmount.1*
-#%lang(ja) %{_mandir}/ja/man1/libguestfs-make-fixed-appliance.1*
+%lang(ja) %{_mandir}/ja/man1/guestunmount.1*
+%lang(ja) %{_mandir}/ja/man1/libguestfs-make-fixed-appliance.1*
%lang(ja) %{_mandir}/ja/man1/libguestfs-test-tool.1*
%lang(ja) %{_mandir}/ja/man1/virt-alignment-scan.1*
%lang(ja) %{_mandir}/ja/man1/virt-cat.1*
%lang(uk) %{_mandir}/uk/man1/guestfs-recipes.1*
%lang(uk) %{_mandir}/uk/man1/guestfs-testing.1*
%lang(uk) %{_mandir}/uk/man1/guestmount.1*
-#%lang(uk) %{_mandir}/uk/man1/libguestfs-make-fixed-appliance.1*
+%lang(uk) %{_mandir}/uk/man1/guestunmount.1*
+%lang(uk) %{_mandir}/uk/man1/libguestfs-make-fixed-appliance.1*
%lang(uk) %{_mandir}/uk/man1/libguestfs-test-tool.1*
%lang(uk) %{_mandir}/uk/man1/virt-alignment-scan.1*
%lang(uk) %{_mandir}/uk/man1/virt-cat.1*
%lang(uk) %{_mandir}/uk/man1/virt-win-reg.1*
%endif
+
%if %{with erlang}
%files -n erlang-libguestfs
%defattr(644,root,root,755)
%{_javadocdir}/libguestfs-java-%{version}
%endif
+%if %{with lua}
+%files -n lua-libguestfs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lua/*/guestfs.so
+%{_mandir}/man3/guestfs-lua.3*
+%lang(ja) %{_mandir}/ja/man3/guestfs-lua.3*
+%lang(uk) %{_mandir}/uk/man3/guestfs-lua.3*
+%endif
+
%if %{with ocaml}
%files -n ocaml-libguestfs
%defattr(644,root,root,755)
%files -n perl-libguestfs
%defattr(644,root,root,755)
%{perl_vendorarch}/Sys/Guestfs.pm
-%dir %{perl_vendorarch}/Sys/Guestfs
-%{perl_vendorarch}/Sys/Guestfs/Lib.pm
%{perl_vendorarch}/Sys/bindtests.pl
%dir %{perl_vendorarch}/auto/Sys/Guestfs
%{perl_vendorarch}/auto/Sys/Guestfs/Guestfs.bs
%attr(755,root,root) %{perl_vendorarch}/auto/Sys/Guestfs/Guestfs.so
%{_mandir}/man3/guestfs-perl.3*
%{_mandir}/man3/Sys::Guestfs.3pm*
-%{_mandir}/man3/Sys::Guestfs::Lib.3pm*
%lang(ja) %{_mandir}/ja/man3/guestfs-perl.3*
%lang(uk) %{_mandir}/uk/man3/guestfs-perl.3*
%endif
%if %{with ruby}
%files -n ruby-libguestfs
%defattr(644,root,root,755)
-%attr(755,root,root) %{ruby_sitearchdir}/_guestfs.so
-%{ruby_sitelibdir}/guestfs.rb
+%attr(755,root,root) %{ruby_vendorarchdir}/_guestfs.so
+%{ruby_vendorlibdir}/guestfs.rb
%{_mandir}/man3/guestfs-ruby.3*
%lang(ja) %{_mandir}/ja/man3/guestfs-ruby.3*
%lang(uk) %{_mandir}/uk/man3/guestfs-ruby.3*
%files -n bash-completion-libguestfs
%defattr(644,root,root,755)
-%attr(755,root,root) /etc/bash_completion.d/guestfish-bash-completion.sh
+%{_datadir}/bash-completion/completions/guestfish
+%{_datadir}/bash-completion/completions/guestmount
+%{_datadir}/bash-completion/completions/virt-*