[packages/libguestfs] - separated -tools (some of them require ocaml or perl bindings) - added bconds for bindings

qboosh qboosh at pld-linux.org
Sat Sep 22 17:42:18 CEST 2012


commit 3eebe7b8d7201b742d2d93563cf323a3b51b1048
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 22 17:43:16 2012 +0200

    - separated -tools (some of them require ocaml or perl bindings)
    - added bconds for bindings

 libguestfs.spec | 259 ++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 166 insertions(+), 93 deletions(-)
---
diff --git a/libguestfs.spec b/libguestfs.spec
index d3ca7d1..af8cd40 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -3,11 +3,19 @@
 #
 # Conditional build:
 %bcond_with	static_libs	# build static libraries
+%bcond_with	haskell		# Haskell (GHC) binding
+%bcond_without	java		# Java 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_with	ruby		# Ruby binding
 #
 %include	/usr/lib/rpm/macros.perl
 %include	/usr/lib/rpm/macros.java
-Summary:	Tools for accessing and modifying virtual machine disk images
-Summary(pl.UTF-8):	Narzędzia do dostępu i modyfikacji obrazów dysków maszyn wirtualnych
+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.12.11
 Release:	5
@@ -20,65 +28,81 @@ Patch1:		augeas-libxml2.patch
 URL:		http://libguestfs.org/
 BuildRequires:	attr-devel
 BuildRequires:	augeas-devel
-BuildRequires:	autoconf
+BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
 BuildRequires:	cdrkit-mkisofs
+BuildRequires:	cpio
 BuildRequires:	db-utils
 #BuildRequires:	febootstrap
 BuildRequires:	gettext-devel
+%{?with_haskell:BuildRequires:	ghc}
 BuildRequires:	gperf
 BuildRequires:	hivex-devel
-BuildRequires:	jdk
+%{?with_java:BuildRequires:	jdk}
 BuildRequires:	libconfig-devel
 BuildRequires:	libfuse-devel
 BuildRequires:	libmagic-devel
 BuildRequires:	libselinux-devel
 BuildRequires:	libtool
 BuildRequires:	libvirt-devel
-BuildRequires:	libxml2-devel
+BuildRequires:	libxml2-devel >= 2.0
 BuildRequires:	libxml2-progs
 BuildRequires:	ncurses-devel
+%if %{with ocaml}
 BuildRequires:	ocaml
-BuildRequires:	ocaml-findlib-devel
+BuildRequires:	ocaml-findlib
+#-devel
 BuildRequires:	ocaml-pcre-devel
+%endif
 BuildRequires:	pcre-devel
-BuildRequires:	perl
+BuildRequires:	perl-base
+BuildRequires:	perl-tools-pod
+%if %{with perl}
+BuildRequires:	perl-ExtUtils-MakeMaker
+BuildRequires:	perl-Test-Simple
+%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(ExtUtils::MakeMaker)
 BuildRequires:	perl(Getopt::Long)
 BuildRequires:	perl(Locale::TextDomain)
 BuildRequires:	perl(Pod::Usage)
-BuildRequires:	perl(String::ShellQuote)
-BuildRequires:	perl(Sys::Virt)
-BuildRequires:	perl(Test::More)
-BuildRequires:	perl(Win::Hivex)
-BuildRequires:	perl(Win::Hivex::Regedit)
-BuildRequires:	perl-tools-pod
-BuildRequires:	php-devel
-BuildRequires:	re2c
+%endif
+%{?with_php:BuildRequires:	php-devel}
+BuildRequires:	pkgconfig
 BuildRequires:	po4a
+%if %{with python}
 BuildRequires:	python
 BuildRequires:	python-devel
+%endif
 BuildRequires:	readline-devel
-#BuildRequires:	ruby
-#BuildRequires:	ruby-devel
+BuildRequires:	rpmbuild(macros) >= 1.219
+%if %{with ruby}
+BuildRequires:	ruby
+BuildRequires:	ruby-devel
+BuildRequires:	ruby-rake
+%endif
 Requires:	qemu-common
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %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
+libguestfs is a library and 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.
 
 %description -l pl.UTF-8
-libguestfs to zestaw narzędzi do dostępu oraz modyfikowania obrazów
-dysków maszyn wirtualnych (VM). Można je wykorzystywać do oglądania
-i edycji plików wewnątrz gości, zmian skryptowych w VM-ach,
-monitorowania statystyk używanego/dostępnego miejsca na dyskach, P2V,
-V2V, wykonywania częściowych kopii zapasowych, klonowania VM-ów i
-wielu podobnych operacji.
+libguestfs to biblioteka oraz zestaw narzędzi do dostępu oraz
+modyfikowania obrazów dysków maszyn wirtualnych (VM). Można je
+wykorzystywać do oglądania i edycji plików wewnątrz gości, zmian
+skryptowych w VM-ach, monitorowania statystyk używanego/dostępnego
+miejsca na dyskach, P2V, V2V, wykonywania częściowych kopii
+zapasowych, klonowania VM-ów i wielu podobnych operacji.
 
 %package devel
 Summary:	Header files for libguestfs library
@@ -104,6 +128,28 @@ Static libguestfs library.
 %description static -l pl.UTF-8
 Statyczna biblioteka libguestfs.
 
+%package tools
+Summary:	libguestfs tools for accessing and modifying virtual machine disk images
+Summary(pl.UTF-8):	Narzędzia libguestfs do dostępu i modyfikacji obrazów dysków maszyn wirtualnych
+Group:		Applications/System
+Requires:	%{name} = %{version}-%{release}
+%{?with_ocaml:Requires:	ocaml-libguestfs = %{version}-%{release}}
+%{?with_perltools:Requires:	perl-libguestfs = %{version}-%{release}}
+
+%description tools
+libguestfs 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.
+
+%description tools -l pl.UTF-8
+Zestaw narzędzi libguestfs do dostępu oraz modyfikowania obrazów
+dysków maszyn wirtualnych (VM). Można je wykorzystywać do oglądania i
+edycji plików wewnątrz gości, zmian skryptowych w VM-ach,
+monitorowania statystyk używanego/dostępnego miejsca na dyskach, P2V,
+V2V, wykonywania częściowych kopii zapasowych, klonowania VM-ów i
+wielu podobnych operacji.
+
 %package -n java-libguestfs
 Summary:	Java bindings for libguestfs
 Summary(pl.UTF-8):	Wiązania Javy do libguestfs
@@ -156,6 +202,9 @@ Summary:	Perl bindings for libguestfs
 Summary(pl.UTF-8):	Wiązania Perla do libguestfs
 Group:		Development/Languages/Perl
 Requires:	%{name} = %{version}-%{release}
+Suggests:	perl-Sys-Virt
+Suggests:	perl-XML-XPath
+Suggests:	perl-hivex
 
 %description -n perl-libguestfs
 Perl bindings for libguestfs.
@@ -220,14 +269,18 @@ cd ..
 %configure \
 	vmchannel_test=no \
 	QEMU=%{_bindir}/qemu \
-	--with-java-home=%{java_home} \
+	--with-java-home=%{?with_java:%{java_home}}%{!?with_java:no} \
 	--with-qemu=qemu \
 	--enable-install-daemon \
-	--disable-haskell \
-	--disable-ruby \
 	--disable-appliance \
-	%{__enable_disable static_libs static} \
-	--disable-silent-rules
+	%{!?with_haskell:--disable-haskell} \
+	%{!?with_ocaml:--disable-ocaml} \
+	%{!?with_perl:--disable-perl} \
+	%{!?with_php:--disable-php} \
+	%{!?with_python:--disable-python} \
+	%{!?with_ruby:--disable-ruby} \
+	--disable-silent-rules \
+	%{__enable_disable static_libs static}
 
 %{__make} \
 	INSTALLDIRS=vendor
@@ -243,6 +296,10 @@ rm -rf $RPM_BUILD_ROOT
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la \
 	$RPM_BUILD_ROOT%{py_sitedir}/*.la
 
+%py_comp $RPM_BUILD_ROOT%{py_sitedir}
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
+%py_postclean
+
 %find_lang %{name}
 
 %clean
@@ -254,6 +311,28 @@ rm -rf $RPM_BUILD_ROOT
 %files -f %{name}.lang
 %defattr(644,root,root,755)
 %doc AUTHORS BUGS ChangeLog README RELEASE-NOTES ROADMAP TODO
+%attr(755,root,root) %{_libdir}/libguestfs.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libguestfs.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libguestfs.so
+%{_includedir}/guestfs.h
+%{_pkgconfigdir}/libguestfs.pc
+%{_mandir}/man3/guestfs-examples.3*
+%{_mandir}/man3/guestfs.3*
+%{_mandir}/man3/libguestfs.3*
+%{_mandir}/ja/man3/guestfs.3*
+%{_mandir}/uk/man3/guestfs.3*
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libguestfs.a
+%endif
+
+%files tools
+%defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/guestfish
 %attr(755,root,root) %{_bindir}/guestmount
 %attr(755,root,root) %{_bindir}/libguestfs-test-tool
@@ -264,19 +343,12 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/virt-edit
 %attr(755,root,root) %{_bindir}/virt-filesystems
 %attr(755,root,root) %{_bindir}/virt-inspector
-%attr(755,root,root) %{_bindir}/virt-list-filesystems
-%attr(755,root,root) %{_bindir}/virt-list-partitions
 %attr(755,root,root) %{_bindir}/virt-ls
-%attr(755,root,root) %{_bindir}/virt-make-fs
 %attr(755,root,root) %{_bindir}/virt-rescue
-%attr(755,root,root) %{_bindir}/virt-resize
-%attr(755,root,root) %{_bindir}/virt-tar
 %attr(755,root,root) %{_bindir}/virt-tar-in
 %attr(755,root,root) %{_bindir}/virt-tar-out
-%attr(755,root,root) %{_bindir}/virt-win-reg
-%attr(755,root,root) %{_libdir}/libguestfs.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libguestfs.so.0
-%{_sysconfdir}/libguestfs-tools.conf
+%attr(755,root,root) %{_sbindir}/guestfsd
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/libguestfs-tools.conf
 %{_mandir}/man1/guestfish.1*
 %{_mandir}/man1/guestfs-recipes.1*
 %{_mandir}/man1/guestmount.1*
@@ -288,16 +360,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/virt-edit.1*
 %{_mandir}/man1/virt-filesystems.1*
 %{_mandir}/man1/virt-inspector.1*
-%{_mandir}/man1/virt-list-filesystems.1*
-%{_mandir}/man1/virt-list-partitions.1*
 %{_mandir}/man1/virt-ls.1*
-%{_mandir}/man1/virt-make-fs.1*
 %{_mandir}/man1/virt-rescue.1*
-%{_mandir}/man1/virt-resize.1*
 %{_mandir}/man1/virt-tar-in.1*
 %{_mandir}/man1/virt-tar-out.1*
-%{_mandir}/man1/virt-tar.1*
-%{_mandir}/man1/virt-win-reg.1*
 %lang(ja) %{_mandir}/ja/man1/guestfish.1*
 %lang(ja) %{_mandir}/ja/man1/guestmount.1*
 %lang(ja) %{_mandir}/ja/man1/virt-cat.1*
@@ -307,16 +373,10 @@ rm -rf $RPM_BUILD_ROOT
 %lang(ja) %{_mandir}/ja/man1/virt-edit.1*
 %lang(ja) %{_mandir}/ja/man1/virt-filesystems.1*
 %lang(ja) %{_mandir}/ja/man1/virt-inspector.1*
-%lang(ja) %{_mandir}/ja/man1/virt-list-filesystems.1*
-%lang(ja) %{_mandir}/ja/man1/virt-list-partitions.1*
 %lang(ja) %{_mandir}/ja/man1/virt-ls.1*
-%lang(ja) %{_mandir}/ja/man1/virt-make-fs.1*
 %lang(ja) %{_mandir}/ja/man1/virt-rescue.1*
-%lang(ja) %{_mandir}/ja/man1/virt-resize.1*
 %lang(ja) %{_mandir}/ja/man1/virt-tar-in.1*
 %lang(ja) %{_mandir}/ja/man1/virt-tar-out.1*
-%lang(ja) %{_mandir}/ja/man1/virt-tar.1*
-%lang(ja) %{_mandir}/ja/man1/virt-win-reg.1*
 %lang(uk) %{_mandir}/uk/man1/guestfish.1*
 %lang(uk) %{_mandir}/uk/man1/guestmount.1*
 %lang(uk) %{_mandir}/uk/man1/virt-cat.1*
@@ -326,64 +386,58 @@ rm -rf $RPM_BUILD_ROOT
 %lang(uk) %{_mandir}/uk/man1/virt-edit.1*
 %lang(uk) %{_mandir}/uk/man1/virt-filesystems.1*
 %lang(uk) %{_mandir}/uk/man1/virt-inspector.1*
-%lang(uk) %{_mandir}/uk/man1/virt-list-filesystems.1*
-%lang(uk) %{_mandir}/uk/man1/virt-list-partitions.1*
 %lang(uk) %{_mandir}/uk/man1/virt-ls.1*
-%lang(uk) %{_mandir}/uk/man1/virt-make-fs.1*
 %lang(uk) %{_mandir}/uk/man1/virt-rescue.1*
-%lang(uk) %{_mandir}/uk/man1/virt-resize.1*
 %lang(uk) %{_mandir}/uk/man1/virt-tar-in.1*
 %lang(uk) %{_mandir}/uk/man1/virt-tar-out.1*
+%if %{with ocaml}
+%attr(755,root,root) %{_bindir}/virt-resize
+%{_mandir}/man1/virt-resize.1*
+%lang(ja) %{_mandir}/ja/man1/virt-resize.1*
+%lang(uk) %{_mandir}/uk/man1/virt-resize.1*
+%endif
+%if %{with perltools}
+%attr(755,root,root) %{_bindir}/virt-list-filesystems
+%attr(755,root,root) %{_bindir}/virt-list-partitions
+%attr(755,root,root) %{_bindir}/virt-make-fs
+%attr(755,root,root) %{_bindir}/virt-tar
+%attr(755,root,root) %{_bindir}/virt-win-reg
+%{_mandir}/man1/virt-list-filesystems.1*
+%{_mandir}/man1/virt-list-partitions.1*
+%{_mandir}/man1/virt-make-fs.1*
+%{_mandir}/man1/virt-tar.1*
+%{_mandir}/man1/virt-win-reg.1*
+%lang(ja) %{_mandir}/ja/man1/virt-list-filesystems.1*
+%lang(ja) %{_mandir}/ja/man1/virt-list-partitions.1*
+%lang(ja) %{_mandir}/ja/man1/virt-make-fs.1*
+%lang(ja) %{_mandir}/ja/man1/virt-tar.1*
+%lang(ja) %{_mandir}/ja/man1/virt-win-reg.1*
+%lang(uk) %{_mandir}/uk/man1/virt-list-filesystems.1*
+%lang(uk) %{_mandir}/uk/man1/virt-list-partitions.1*
+%lang(uk) %{_mandir}/uk/man1/virt-make-fs.1*
 %lang(uk) %{_mandir}/uk/man1/virt-tar.1*
 %lang(uk) %{_mandir}/uk/man1/virt-win-reg.1*
-
-%files devel
-%defattr(644,root,root,755)
-%{_libdir}/libguestfs.so
-%{_includedir}/guestfs.h
-%{_pkgconfigdir}/libguestfs.pc
-%{_mandir}/man3/guestfs-examples.3*
-%{_mandir}/man3/guestfs.3*
-%{_mandir}/man3/libguestfs.3*
-%{_mandir}/ja/man3/guestfs.3*
-%{_mandir}/uk/man3/guestfs.3*
-
-%if %{with static_libs}
-%files static
-%defattr(644,root,root,755)
-%{_libdir}/libguestfs.a
 %endif
 
-%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*
-
+%if %{with java}
 %files -n java-libguestfs
 %defattr(644,root,root,755)
-%{_libdir}/libguestfs_jni.so
-%attr(755,root,root) %{_libdir}/libguestfs_jni.so.1
 %attr(755,root,root) %{_libdir}/libguestfs_jni.so.1.12.11
+%attr(755,root,root) %{_libdir}/libguestfs_jni.so.1
+%attr(755,root,root) %{_libdir}/libguestfs_jni.so
 %{_javadir}/libguestfs-1.12.11.jar
 %{_mandir}/man3/guestfs-java.3*
 
 %files -n java-libguestfs-javadoc
 %defattr(644,root,root,755)
 %{_javadocdir}/libguestfs-java-1.12.11
+%endif
 
+%if %{with ocaml}
 %files -n ocaml-libguestfs
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllmlguestfs.so
 %{_libdir}/ocaml/stublibs/dllmlguestfs.so.owner
-%{_mandir}/man3/guestfs-ocaml.3*
 
 %files -n ocaml-libguestfs-devel
 %defattr(644,root,root,755)
@@ -398,18 +452,37 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/ocaml/guestfs/mlguestfs.a
 %{_libdir}/ocaml/guestfs/mlguestfs.cma
 %{_libdir}/ocaml/guestfs/mlguestfs.cmxa
+%{_mandir}/man3/guestfs-ocaml.3*
+%endif
 
-%files -n python-libguestfs
+%if %{with perl}
+%files -n perl-libguestfs
 %defattr(644,root,root,755)
-%{_mandir}/man3/guestfs-python.3*
-%{py_sitedir}/guestfs.py
-%attr(755,root,root) %{py_sitedir}/libguestfsmod.so
+%{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*
+%endif
 
 %files -n php-guestfs
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php/conf.d/guestfs_php.ini
 %attr(755,root,root) %{_libdir}/php/guestfs_php.so
 
+%if %{with python}
+%files -n python-libguestfs
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/libguestfsmod.so
+%{py_sitedir}/guestfs.py[co]
+%{_mandir}/man3/guestfs-python.3*
+%endif
+
 %files -n bash-completion-libguestfs
 %defattr(644,root,root,755)
 %attr(755,root,root) /etc/bash_completion.d/guestfish-bash-completion.sh
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libguestfs.git/commitdiff/3eebe7b8d7201b742d2d93563cf323a3b51b1048



More information about the pld-cvs-commit mailing list