From 95c541568a9bcc424e6cced8cc105e67dda945c87b7e4962ed1c0dbccd3e86d8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 25 Mar 2013 14:22:09 +0000 Subject: [PATCH] Accepting request 160930 from Cloud:OpenStack:Master - use proper build conditionals so that it can be influenced outside spec file (via e.g. prjconf) OBS-URL: https://build.opensuse.org/request/show/160930 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=206 --- libguestfs.changes | 6 +++ libguestfs.spec | 121 +++++++++++++++++++++++---------------------- 2 files changed, 67 insertions(+), 60 deletions(-) diff --git a/libguestfs.changes b/libguestfs.changes index 40e58a6..2b77499 100644 --- a/libguestfs.changes +++ b/libguestfs.changes @@ -6,6 +6,12 @@ Fri Mar 22 19:55:41 CET 2013 - ohering@suse.de * filearch: Don't print errno if cpio command fails, print command status instead. * proto: send_to_daemon is not an exported function. +------------------------------------------------------------------- +Mon Mar 18 18:46:34 UTC 2013 - dmueller@suse.com + +- use proper build conditionals so that it can be influenced + outside spec file (via e.g. prjconf) + ------------------------------------------------------------------- Wed Mar 6 20:27:13 CET 2013 - ohering@suse.de diff --git a/libguestfs.spec b/libguestfs.spec index 3457e6f..9037cc9 100644 --- a/libguestfs.spec +++ b/libguestfs.spec @@ -1,7 +1,7 @@ # # spec file for package libguestfs # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2011 Michal Hrusecky # # All modifications and additions to the file contributed by third parties @@ -16,6 +16,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %if !%opt # get rid of /usr/lib/rpm/find-debuginfo.sh @@ -24,34 +25,34 @@ %undefine _build_create_debug %endif -%define with_ocaml_tools 1 -%define with_ocaml_bindings 1 -%define with_lua_bindings 1 -%define with_python_bindings 1 -%define with_perl_bindings 1 -%if %suse_version > 1210 -%define with_ruby_bindings 1 -%else -%define with_ruby_bindings 0 -%endif -%define with_fuse 1 -%define with_hivex 1 -%define with_zerofree 1 # disable certain features for a SLES11 build +# in Virtualization repo in OBS they're reenabled via prjconf %if %suse_version == 1110 -%if "%_project" == "Virtualization" -# leave features enabled in OBS main repo +%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 %else -%define with_ocaml_bindings 0 -%define with_lua_bindings 0 -%define with_perl_bindings 0 -%define with_python_bindings 0 -%define with_ruby_bindings 0 -%define with_hivex 0 -%define with_zerofree 0 +%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 %endif + +%bcond_without fuse + +%if %suse_version > 1210 +%bcond_without ruby_bindings +%else +%bcond_with ruby_bindings %endif -# + # The following defines are overridden in the individual subpackages %define _configure_fuse --disable-fuse %define _configure_lua --disable-lua @@ -81,9 +82,6 @@ Name: libguestfs %if "%{?_ignore_exclusive_arch}" == "" ExclusiveArch: %ix86 x86_64 %endif -BuildRequires: libacl-devel -BuildRequires: autoconf -BuildRequires: automake BuildRequires: aaa_base BuildRequires: attr-devel BuildRequires: augeas-devel @@ -93,6 +91,7 @@ BuildRequires: file-devel BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gperf +BuildRequires: libacl-devel BuildRequires: libcap-devel %if %suse_version >= 1220 BuildRequires: libconfig-devel @@ -100,36 +99,34 @@ BuildRequires: libconfig-devel BuildRequires: libtool BuildRequires: libvirt-devel >= 0.10.2 BuildRequires: ncurses-devel +%if %{with perl_bindings} %if %suse_version < 1140 BuildRequires: perl-macros %endif +%endif BuildRequires: pcre-devel BuildRequires: pkg-config BuildRequires: readline-devel -# -%if %{with_ocaml_bindings} -%define with_ocaml_tools 1 -%endif -%if %{with_ocaml_tools} +%if %{with ocaml_bindings} # Required to build tools, its independent from bindings BuildRequires: ocaml BuildRequires: ocaml-findlib %define _configure_ocaml --enable-ocaml %endif # -%if %{with_fuse} +%if %{with fuse} BuildRequires: fuse-devel %define _configure_fuse --enable-fuse %endif # -%if %{with_hivex} +%if %{with hivex} BuildRequires: hivex-devel %endif # Url: http://libguestfs.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: Compatibility package for guestfs-tools -License: GPL-2 +License: GPL-2.0 Group: System/Filesystems Version: 1.20.4 Release: 0 @@ -161,11 +158,12 @@ virtual machines. %package -n guestfs-tools Summary: Tools for accessing and modifying virtual machine disk images +License: GPL-2.0 Group: System/Filesystems Provides: %{name} = %{version} Obsoletes: %{name} < %{version} Requires: kvm >= 1.1 -%if %{with_perl_bindings} +%if %{with perl_bindings} Requires: perl(Data::Dumper) Requires: perl(File::Basename) Requires: perl(File::Temp) @@ -175,12 +173,12 @@ Requires: perl(Pod::Usage) Requires: perl(String::ShellQuote) Requires: perl(Sys::Guestfs) Requires: perl(Sys::Guestfs::Lib) -%if %{with_hivex} +%{perl_requires} +%if %{with hivex} Requires: perl(Win::Hivex) Requires: perl(Win::Hivex::Regedit) %endif %endif -%{perl_requires} Recommends: guestfs-data Conflicts: guestfs-data < %{version} Conflicts: libguestfs0 < %{version} @@ -203,6 +201,7 @@ virtual machines. %package -n guestfsd Summary: Daemon for the libguestfs appliance +License: GPL-2.0 Group: System/Filesystems %description -n guestfsd @@ -211,9 +210,10 @@ and performs the requested action by calling the helper binaries. This package is only required for building the appliance. # -%if %{with_ocaml_bindings} +%if %{with ocaml_bindings} %package -n ocaml-libguestfs Summary: Provides OCaml support for libguestfs +License: GPL-2.0 Group: System/Filesystems # @@ -222,15 +222,17 @@ Allows OCaml scripts to directly use libguestfs. %package -n ocaml-libguestfs-devel Summary: Provides OCaml support for libguestfs +License: GPL-2.0 Group: Development/Libraries/Other %description -n ocaml-libguestfs-devel Allows OCaml scripts to directly use libguestfs. %endif # -%if %{with_perl_bindings} +%if %{with perl_bindings} %package -n perl-Sys-Guestfs Summary: Provides Perl support for libguestfs +License: GPL-2.0 Group: System/Filesystems BuildRequires: perl BuildRequires: perl(Data::Dumper) @@ -239,7 +241,7 @@ BuildRequires: perl(Locale::TextDomain) BuildRequires: perl(Pod::Usage) BuildRequires: perl(String::ShellQuote) BuildRequires: perl(Sys::Virt) -%if %{with_hivex} +%if %{with hivex} BuildRequires: perl(Win::Hivex) BuildRequires: perl(Win::Hivex::Regedit) %endif @@ -255,9 +257,10 @@ Requires: perl(Locale::TextDomain) Allows Perl scripts to directly use libguestfs. %endif # -%if %{with_lua_bindings} +%if %{with lua_bindings} %package -n lua-libguestfs Summary: Provides Lua support for libguestfs +License: GPL-2.0 Group: System/Filesystems BuildRequires: lua-devel %define _configure_lua --enable-lua @@ -267,9 +270,10 @@ BuildRequires: lua-devel Allows lua scripts to directly use libguestfs. %endif # -%if %{with_python_bindings} +%if %{with python_bindings} %package -n python-libguestfs Summary: Provides Python support for libguestfs +License: GPL-2.0 Group: System/Filesystems %define pyver %(python -c "import sys; print sys.version[:3]") BuildRequires: python @@ -283,9 +287,10 @@ Obsoletes: libguestfs-python < %{version} Allows Python scripts to directly use libguestfs. %endif # -%if %{with_ruby_bindings} +%if %{with ruby_bindings} %package -n rubygem-libguestfs Summary: Ruby bindings for libguestfs +License: GPL-2.0 Group: System/Filesystems BuildRequires: ruby BuildRequires: ruby-devel @@ -314,15 +319,9 @@ BuildRequires: e2fsprogs # 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. -# Make use of an ext4 driver with write support. But: -# This package exists only in the internal buildservice, so require it only there. -%if %suse_version == 1110 -%if "%_project" == "Virtualization" -# package does not exist in OBS main repo -%else +%if %{with ext4_writeable} BuildRequires: ext4-writeable-kmp-default %endif -%endif BuildRequires: file BuildRequires: findutils BuildRequires: gawk @@ -349,10 +348,11 @@ BuildRequires: udev BuildRequires: util-linux BuildRequires: xfsprogs BuildRequires: xz -%if %{with_zerofree} +%if %{with zerofree} BuildRequires: zerofree %endif Summary: Virtual machine needed for libguestfs +License: GPL-2.0 Group: System/Filesystems Provides: libguestfs-data = %{version} Obsoletes: libguestfs-data < %{version} @@ -364,6 +364,7 @@ This package provides such an image, an initrd and a kernel. %package devel Summary: Development files for libguestfs +License: GPL-2.0 Group: Development/Libraries/Other Requires: libguestfs0 = %{version} @@ -386,8 +387,8 @@ guestfish, or use virt-rescue to get a rescue shell for fixing unbootable virtual machines. %package -n libguestfs0 -License: LGPL-2.1 Summary: Runtime library of libguestfs +License: LGPL-2.1 Group: System/Filesystems %description -n libguestfs0 @@ -480,7 +481,7 @@ export NO_BRP_STRIP_DEBUG=true %endif %makeinstall #remove ocaml bindings files if they are disable via rpm macro -%if !%{with_ocaml_bindings} +%if !%{with ocaml_bindings} rm -rfv $RPM_BUILD_ROOT%{_libdir}/ocaml %endif rm -rfv $RPM_BUILD_ROOT%{guestfs_docdir} @@ -489,7 +490,7 @@ find $RPM_BUILD_ROOT -type f \( \ -name "virt-list-partitions" -o -name "virt-list-partitions.*" -o \ -name "virt-tar" -o -name "virt-tar.*" \ \) -print -delete -%if %{with_perl_bindings} +%if %{with perl_bindings} # Delete empty perl bootstrap files find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete # Delete unused perl script without executable permissions @@ -655,7 +656,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %{_libdir}/guestfs -%if %{with_ocaml_bindings} +%if %{with ocaml_bindings} %files -n ocaml-libguestfs %defattr(-,root,root) %dir %{_libdir}/ocaml @@ -677,13 +678,13 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/ocaml/guestfs/*.mli %endif # -%if %{with_lua_bindings} +%if %{with lua_bindings} %files -n lua-libguestfs %defattr(-,root,root) %{_libdir}/lua %endif # -%if %{with_perl_bindings} +%if %{with perl_bindings} %post -n perl-Sys-Guestfs -p /sbin/ldconfig %postun -n perl-Sys-Guestfs -p /sbin/ldconfig @@ -692,13 +693,13 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %endif # -%if %{with_python_bindings} +%if %{with python_bindings} %files -n python-libguestfs %defattr(-,root,root) %{_libdir}/python%{pyver}/site-packages/* %endif # -%if %{with_ruby_bindings} +%if %{with ruby_bindings} %files -n rubygem-libguestfs %defattr(-,root,root) %{_libdir}/ruby