SHA256
1
0
forked from pool/libguestfs

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
This commit is contained in:
2013-03-25 14:22:09 +00:00
committed by Git OBS Bridge
parent 2b8aac626f
commit 95c541568a
2 changed files with 67 additions and 60 deletions

View File

@@ -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. * filearch: Don't print errno if cpio command fails, print command status instead.
* proto: send_to_daemon is not an exported function. * 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 Wed Mar 6 20:27:13 CET 2013 - ohering@suse.de

View File

@@ -1,7 +1,7 @@
# #
# spec file for package libguestfs # 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 <mhrusecky@novell.com> # Copyright (c) 2011 Michal Hrusecky <mhrusecky@novell.com>
# #
# All modifications and additions to the file contributed by third parties # 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/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%if !%opt %if !%opt
# get rid of /usr/lib/rpm/find-debuginfo.sh # get rid of /usr/lib/rpm/find-debuginfo.sh
@@ -24,34 +25,34 @@
%undefine _build_create_debug %undefine _build_create_debug
%endif %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 # disable certain features for a SLES11 build
# in Virtualization repo in OBS they're reenabled via prjconf
%if %suse_version == 1110 %if %suse_version == 1110
%if "%_project" == "Virtualization" %bcond_with ocaml_bindings
# leave features enabled in OBS main repo %bcond_with lua_bindings
%bcond_with python_bindings
%bcond_with perl_bindings
%bcond_with hivex
%bcond_with zerofree
%bcond_without ext4_writeable
%else %else
%define with_ocaml_bindings 0 %bcond_without ocaml_bindings
%define with_lua_bindings 0 %bcond_without lua_bindings
%define with_perl_bindings 0 %bcond_without python_bindings
%define with_python_bindings 0 %bcond_without perl_bindings
%define with_ruby_bindings 0 %bcond_without hivex
%define with_hivex 0 %bcond_without zerofree
%define with_zerofree 0 %bcond_with ext4_writeable
%endif %endif
%bcond_without fuse
%if %suse_version > 1210
%bcond_without ruby_bindings
%else
%bcond_with ruby_bindings
%endif %endif
#
# The following defines are overridden in the individual subpackages # The following defines are overridden in the individual subpackages
%define _configure_fuse --disable-fuse %define _configure_fuse --disable-fuse
%define _configure_lua --disable-lua %define _configure_lua --disable-lua
@@ -81,9 +82,6 @@ Name: libguestfs
%if "%{?_ignore_exclusive_arch}" == "" %if "%{?_ignore_exclusive_arch}" == ""
ExclusiveArch: %ix86 x86_64 ExclusiveArch: %ix86 x86_64
%endif %endif
BuildRequires: libacl-devel
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: aaa_base BuildRequires: aaa_base
BuildRequires: attr-devel BuildRequires: attr-devel
BuildRequires: augeas-devel BuildRequires: augeas-devel
@@ -93,6 +91,7 @@ BuildRequires: file-devel
BuildRequires: gcc BuildRequires: gcc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: gperf BuildRequires: gperf
BuildRequires: libacl-devel
BuildRequires: libcap-devel BuildRequires: libcap-devel
%if %suse_version >= 1220 %if %suse_version >= 1220
BuildRequires: libconfig-devel BuildRequires: libconfig-devel
@@ -100,36 +99,34 @@ BuildRequires: libconfig-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: libvirt-devel >= 0.10.2 BuildRequires: libvirt-devel >= 0.10.2
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
%if %{with perl_bindings}
%if %suse_version < 1140 %if %suse_version < 1140
BuildRequires: perl-macros BuildRequires: perl-macros
%endif %endif
%endif
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: readline-devel BuildRequires: readline-devel
# %if %{with ocaml_bindings}
%if %{with_ocaml_bindings}
%define with_ocaml_tools 1
%endif
%if %{with_ocaml_tools}
# Required to build tools, its independent from bindings # Required to build tools, its independent from bindings
BuildRequires: ocaml BuildRequires: ocaml
BuildRequires: ocaml-findlib BuildRequires: ocaml-findlib
%define _configure_ocaml --enable-ocaml %define _configure_ocaml --enable-ocaml
%endif %endif
# #
%if %{with_fuse} %if %{with fuse}
BuildRequires: fuse-devel BuildRequires: fuse-devel
%define _configure_fuse --enable-fuse %define _configure_fuse --enable-fuse
%endif %endif
# #
%if %{with_hivex} %if %{with hivex}
BuildRequires: hivex-devel BuildRequires: hivex-devel
%endif %endif
# #
Url: http://libguestfs.org/ Url: http://libguestfs.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Compatibility package for guestfs-tools Summary: Compatibility package for guestfs-tools
License: GPL-2 License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
Version: 1.20.4 Version: 1.20.4
Release: 0 Release: 0
@@ -161,11 +158,12 @@ virtual machines.
%package -n guestfs-tools %package -n guestfs-tools
Summary: Tools for accessing and modifying virtual machine disk images Summary: Tools for accessing and modifying virtual machine disk images
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
Provides: %{name} = %{version} Provides: %{name} = %{version}
Obsoletes: %{name} < %{version} Obsoletes: %{name} < %{version}
Requires: kvm >= 1.1 Requires: kvm >= 1.1
%if %{with_perl_bindings} %if %{with perl_bindings}
Requires: perl(Data::Dumper) Requires: perl(Data::Dumper)
Requires: perl(File::Basename) Requires: perl(File::Basename)
Requires: perl(File::Temp) Requires: perl(File::Temp)
@@ -175,12 +173,12 @@ Requires: perl(Pod::Usage)
Requires: perl(String::ShellQuote) Requires: perl(String::ShellQuote)
Requires: perl(Sys::Guestfs) Requires: perl(Sys::Guestfs)
Requires: perl(Sys::Guestfs::Lib) Requires: perl(Sys::Guestfs::Lib)
%if %{with_hivex} %{perl_requires}
%if %{with hivex}
Requires: perl(Win::Hivex) Requires: perl(Win::Hivex)
Requires: perl(Win::Hivex::Regedit) Requires: perl(Win::Hivex::Regedit)
%endif %endif
%endif %endif
%{perl_requires}
Recommends: guestfs-data Recommends: guestfs-data
Conflicts: guestfs-data < %{version} Conflicts: guestfs-data < %{version}
Conflicts: libguestfs0 < %{version} Conflicts: libguestfs0 < %{version}
@@ -203,6 +201,7 @@ virtual machines.
%package -n guestfsd %package -n guestfsd
Summary: Daemon for the libguestfs appliance Summary: Daemon for the libguestfs appliance
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
%description -n guestfsd %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. This package is only required for building the appliance.
# #
%if %{with_ocaml_bindings} %if %{with ocaml_bindings}
%package -n ocaml-libguestfs %package -n ocaml-libguestfs
Summary: Provides OCaml support for libguestfs Summary: Provides OCaml support for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
# #
@@ -222,15 +222,17 @@ Allows OCaml scripts to directly use libguestfs.
%package -n ocaml-libguestfs-devel %package -n ocaml-libguestfs-devel
Summary: Provides OCaml support for libguestfs Summary: Provides OCaml support for libguestfs
License: GPL-2.0
Group: Development/Libraries/Other Group: Development/Libraries/Other
%description -n ocaml-libguestfs-devel %description -n ocaml-libguestfs-devel
Allows OCaml scripts to directly use libguestfs. Allows OCaml scripts to directly use libguestfs.
%endif %endif
# #
%if %{with_perl_bindings} %if %{with perl_bindings}
%package -n perl-Sys-Guestfs %package -n perl-Sys-Guestfs
Summary: Provides Perl support for libguestfs Summary: Provides Perl support for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
BuildRequires: perl BuildRequires: perl
BuildRequires: perl(Data::Dumper) BuildRequires: perl(Data::Dumper)
@@ -239,7 +241,7 @@ BuildRequires: perl(Locale::TextDomain)
BuildRequires: perl(Pod::Usage) BuildRequires: perl(Pod::Usage)
BuildRequires: perl(String::ShellQuote) BuildRequires: perl(String::ShellQuote)
BuildRequires: perl(Sys::Virt) BuildRequires: perl(Sys::Virt)
%if %{with_hivex} %if %{with hivex}
BuildRequires: perl(Win::Hivex) BuildRequires: perl(Win::Hivex)
BuildRequires: perl(Win::Hivex::Regedit) BuildRequires: perl(Win::Hivex::Regedit)
%endif %endif
@@ -255,9 +257,10 @@ Requires: perl(Locale::TextDomain)
Allows Perl scripts to directly use libguestfs. Allows Perl scripts to directly use libguestfs.
%endif %endif
# #
%if %{with_lua_bindings} %if %{with lua_bindings}
%package -n lua-libguestfs %package -n lua-libguestfs
Summary: Provides Lua support for libguestfs Summary: Provides Lua support for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
BuildRequires: lua-devel BuildRequires: lua-devel
%define _configure_lua --enable-lua %define _configure_lua --enable-lua
@@ -267,9 +270,10 @@ BuildRequires: lua-devel
Allows lua scripts to directly use libguestfs. Allows lua scripts to directly use libguestfs.
%endif %endif
# #
%if %{with_python_bindings} %if %{with python_bindings}
%package -n python-libguestfs %package -n python-libguestfs
Summary: Provides Python support for libguestfs Summary: Provides Python support for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
%define pyver %(python -c "import sys; print sys.version[:3]") %define pyver %(python -c "import sys; print sys.version[:3]")
BuildRequires: python BuildRequires: python
@@ -283,9 +287,10 @@ Obsoletes: libguestfs-python < %{version}
Allows Python scripts to directly use libguestfs. Allows Python scripts to directly use libguestfs.
%endif %endif
# #
%if %{with_ruby_bindings} %if %{with ruby_bindings}
%package -n rubygem-libguestfs %package -n rubygem-libguestfs
Summary: Ruby bindings for libguestfs Summary: Ruby bindings for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
BuildRequires: ruby BuildRequires: ruby
BuildRequires: ruby-devel BuildRequires: ruby-devel
@@ -314,15 +319,9 @@ BuildRequires: e2fsprogs
# ext4 in the sles11 kernel-binary.rpm packages operates only in read-only mode. # 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. # The generated initrd operates inside the temporary guest on image files.
# For that reason it needs to make modifications to any kind of filesystems. # For that reason it needs to make modifications to any kind of filesystems.
# Make use of an ext4 driver with write support. But: %if %{with ext4_writeable}
# 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
BuildRequires: ext4-writeable-kmp-default BuildRequires: ext4-writeable-kmp-default
%endif %endif
%endif
BuildRequires: file BuildRequires: file
BuildRequires: findutils BuildRequires: findutils
BuildRequires: gawk BuildRequires: gawk
@@ -349,10 +348,11 @@ BuildRequires: udev
BuildRequires: util-linux BuildRequires: util-linux
BuildRequires: xfsprogs BuildRequires: xfsprogs
BuildRequires: xz BuildRequires: xz
%if %{with_zerofree} %if %{with zerofree}
BuildRequires: zerofree BuildRequires: zerofree
%endif %endif
Summary: Virtual machine needed for libguestfs Summary: Virtual machine needed for libguestfs
License: GPL-2.0
Group: System/Filesystems Group: System/Filesystems
Provides: libguestfs-data = %{version} Provides: libguestfs-data = %{version}
Obsoletes: libguestfs-data < %{version} Obsoletes: libguestfs-data < %{version}
@@ -364,6 +364,7 @@ This package provides such an image, an initrd and a kernel.
%package devel %package devel
Summary: Development files for libguestfs Summary: Development files for libguestfs
License: GPL-2.0
Group: Development/Libraries/Other Group: Development/Libraries/Other
Requires: libguestfs0 = %{version} Requires: libguestfs0 = %{version}
@@ -386,8 +387,8 @@ guestfish, or use virt-rescue to get a rescue shell for fixing unbootable
virtual machines. virtual machines.
%package -n libguestfs0 %package -n libguestfs0
License: LGPL-2.1
Summary: Runtime library of libguestfs Summary: Runtime library of libguestfs
License: LGPL-2.1
Group: System/Filesystems Group: System/Filesystems
%description -n libguestfs0 %description -n libguestfs0
@@ -480,7 +481,7 @@ export NO_BRP_STRIP_DEBUG=true
%endif %endif
%makeinstall %makeinstall
#remove ocaml bindings files if they are disable via rpm macro #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 rm -rfv $RPM_BUILD_ROOT%{_libdir}/ocaml
%endif %endif
rm -rfv $RPM_BUILD_ROOT%{guestfs_docdir} 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-list-partitions" -o -name "virt-list-partitions.*" -o \
-name "virt-tar" -o -name "virt-tar.*" \ -name "virt-tar" -o -name "virt-tar.*" \
\) -print -delete \) -print -delete
%if %{with_perl_bindings} %if %{with perl_bindings}
# Delete empty perl bootstrap files # Delete empty perl bootstrap files
find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete find $RPM_BUILD_ROOT -name "*.bs" -size 0c -print -delete
# Delete unused perl script without executable permissions # Delete unused perl script without executable permissions
@@ -655,7 +656,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/guestfs %{_libdir}/guestfs
%if %{with_ocaml_bindings} %if %{with ocaml_bindings}
%files -n ocaml-libguestfs %files -n ocaml-libguestfs
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_libdir}/ocaml %dir %{_libdir}/ocaml
@@ -677,13 +678,13 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/ocaml/guestfs/*.mli %{_libdir}/ocaml/guestfs/*.mli
%endif %endif
# #
%if %{with_lua_bindings} %if %{with lua_bindings}
%files -n lua-libguestfs %files -n lua-libguestfs
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/lua %{_libdir}/lua
%endif %endif
# #
%if %{with_perl_bindings} %if %{with perl_bindings}
%post -n perl-Sys-Guestfs -p /sbin/ldconfig %post -n perl-Sys-Guestfs -p /sbin/ldconfig
%postun -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) %defattr(-,root,root)
%endif %endif
# #
%if %{with_python_bindings} %if %{with python_bindings}
%files -n python-libguestfs %files -n python-libguestfs
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/python%{pyver}/site-packages/* %{_libdir}/python%{pyver}/site-packages/*
%endif %endif
# #
%if %{with_ruby_bindings} %if %{with ruby_bindings}
%files -n rubygem-libguestfs %files -n rubygem-libguestfs
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/ruby %{_libdir}/ruby