- use proper build conditionals so that it can be influenced

outside spec file (via e.g. prjconf)

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=194
This commit is contained in:
Dirk Mueller 2013-03-18 18:46:58 +00:00 committed by Git OBS Bridge
parent 71cd725388
commit c6969c8773
2 changed files with 52 additions and 53 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
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

@ -24,34 +24,37 @@
%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 ruby_bindings
%bcond_with hivex
%bcond_with zerofree
%bcond_without ext4_writeable
%else %else
%define with_ocaml_bindings 0 %bcond_without ocaml_tools
%define with_lua_bindings 0 %bcond_without ocaml_bindings
%define with_perl_bindings 0 %bcond_without lua_bindings
%define with_python_bindings 0 %bcond_without python_bindings
%define with_ruby_bindings 0 %bcond_without perl_bindings
%define with_hivex 0 %bcond_without hivex
%define with_zerofree 0 %bcond_without zerofree
%bcond_without 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
@ -106,23 +109,19 @@ BuildRequires: perl-macros
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
# #
@ -165,7 +164,7 @@ 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,7 +174,7 @@ 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} %if %{with hivex}
Requires: perl(Win::Hivex) Requires: perl(Win::Hivex)
Requires: perl(Win::Hivex::Regedit) Requires: perl(Win::Hivex::Regedit)
%endif %endif
@ -211,7 +210,7 @@ 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
Group: System/Filesystems Group: System/Filesystems
@ -228,7 +227,7 @@ Group: Development/Libraries/Other
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
Group: System/Filesystems Group: System/Filesystems
@ -239,7 +238,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,7 +254,7 @@ 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
Group: System/Filesystems Group: System/Filesystems
@ -267,7 +266,7 @@ 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
Group: System/Filesystems Group: System/Filesystems
@ -283,7 +282,7 @@ 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
Group: System/Filesystems Group: System/Filesystems
@ -314,15 +313,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,7 +342,7 @@ 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
@ -480,7 +473,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 +482,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 +648,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 +670,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 +685,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