diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..19d41ea
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ client-headers
+
diff --git a/valgrind.changes b/valgrind.changes
index f0285a4..b12ffcb 100644
--- a/valgrind.changes
+++ b/valgrind.changes
@@ -3,6 +3,13 @@ Tue Oct 29 12:10:39 UTC 2019 - Dirk Mueller
- move s390-*xml files to main package (bsc#1147071)
+-------------------------------------------------------------------
+Tue Oct 22 16:46:06 UTC 2019 - Stefan Brüns
+
+- Use _multibuild for creating the client-headers subpackage. As
+ the headers are just copied over, the package has no substantial
+ build dependencies.
+
-------------------------------------------------------------------
Thu Oct 17 22:43:21 UTC 2019 - Stefan Brüns
diff --git a/valgrind.spec b/valgrind.spec
index 5880ff7..759fb0c 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -20,9 +20,15 @@
%define glibc_main_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f1)
%define glibc_major_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f2)
+%global flavor @BUILD_FLAVOR@%{nil}
+
+%if "%{flavor}" == "client-headers"
+%define psuffix -client-headers-source
+%endif
+
%bcond_without docs
-Name: valgrind
+Name: valgrind%{?psuffix}
Version: 3.15.0
Release: 0
Summary: Memory Management Debugger
@@ -33,8 +39,10 @@ Source0: ftp://sourceware.org/pub/valgrind/valgrind-%{version}.tar.bz2
# https://bugs.kde.org/show_bug.cgi?id=390553
# https://github.com/olafhering/valgrind/compare/olh-base-master...olh-fixes-master
Patch0: valgrind.xen.patch
-Patch1: jit-register-unregister.diff
+# PATCH-NEEDS-REBASE
+# Patch1: jit-register-unregister.diff
Patch2: armv6-support.diff
+%if "%{flavor}" == ""
%if %{with docs}
BuildRequires: docbook-xsl-stylesheets
BuildRequires: libxslt
@@ -60,6 +68,8 @@ BuildRequires: gcc-c++-32bit
%endif
BuildRequires: glibc-devel-32bit
%endif
+%else
+%endif
%description
Valgrind checks all memory operations in an application, like read,
@@ -91,7 +101,7 @@ Requires: %{name}-client-headers = %{version}
%description devel
This package contains the Valgrind header files.
-%package client-headers
+%package -n valgrind-client-headers
Summary: Header files for for Valgrind
# The client headers are permissively licensed under a BSD-style
# license. SPDX License Request filed.
@@ -99,8 +109,9 @@ Summary: Header files for for Valgrind
License: GPL-2.0-or-later AND GFDL-1.2-only
Group: Development/Tools/Debuggers
Provides: valgrind-devel:%{_includedir}/valgrind/valgrind.h
+BuildArch: noarch
-%description client-headers
+%description -n valgrind-client-headers
This package contains the BSD-style licensed Valgrind header
files for inclusion into regular programs. The program can
detect if it is running under Valgrind and interact with the
@@ -138,13 +149,14 @@ but it has been successfully used to optimize several KDE applications.
%endif
%prep
-%setup -q
+%setup -q -n valgrind-%{version}
%patch0 -p1
# needs porting to 3.11
-##%patch1
+# %%patch1
%patch2
%build
+%if "%{flavor}" == ""
%define _lto_cflags %{nil}
%if 0%{?suse_version} < 1320
export CC="%{_bindir}/gcc-8"
@@ -184,8 +196,10 @@ pushd docs
make FAQ.txt man-pages html-docs
popd
%endif
+%endif
%install
+%if "%{flavor}" == ""
make DESTDIR=%{buildroot} install %{?_smp_mflags}
rm %{buildroot}/%{_libdir}/valgrind/lib*.a # drop unreproducible unused files to fix boo#1118163
@@ -197,7 +211,20 @@ if test -d %{buildroot}%{_datadir}/doc/valgrind; then
fi
mkdir -p %{buildroot}%{_docdir}/%{name}
+rm %{buildroot}/%{_includedir}/valgrind/{valgrind,callgrind,drd,helgrind,memcheck}.h
+
+%else
+install -m 755 -d %{buildroot}/%{_includedir}/valgrind
+install -m 644 -t %{buildroot}/%{_includedir}/valgrind \
+ include/valgrind.h \
+ callgrind/callgrind.h \
+ drd/drd.h \
+ helgrind/helgrind.h \
+ memcheck/memcheck.h
+%endif
+
%check
+%if "%{flavor}" == ""
# OBS doesn't have a z13
%ifnarch s390x
# has too many spurious failures
@@ -205,27 +232,22 @@ mkdir -p %{buildroot}%{_docdir}/%{name}
#patent pending self test
VALGRIND_LIB=$PWD/.in_place VALGRIND_LIB_INNER=$PWD/.in_place ./coregrind/valgrind /usr/bin/perl -wc tests/vg_regtest
%endif
+%endif
+%if "%{flavor}" == ""
%files devel
+%dir %{_includedir}/valgrind
%{_includedir}/valgrind/config.h
%{_includedir}/valgrind/vki
%{_includedir}/valgrind/libvex*.h
%{_includedir}/valgrind/pub_tool*.h
%{_libdir}/pkgconfig/valgrind.pc
-%files client-headers
-%dir %{_includedir}/valgrind
-%{_includedir}/valgrind/callgrind.h
-%{_includedir}/valgrind/drd.h
-%{_includedir}/valgrind/helgrind.h
-%{_includedir}/valgrind/memcheck.h
-%{_includedir}/valgrind/valgrind.h
-
-%files
+%files -n valgrind
%license COPYING COPYING.DOCS
%{_bindir}/*
%doc README* NEWS AUTHORS
-%doc %{_defaultdocdir}/%{name}/
+%doc %{_defaultdocdir}/%{name}/*
%doc %{_mandir}/*/*
%dir %{_libdir}/valgrind
%ifarch aarch64
@@ -346,4 +368,14 @@ VALGRIND_LIB=$PWD/.in_place VALGRIND_LIB_INNER=$PWD/.in_place ./coregrind/valgri
%{_libdir}/valgrind/powerpc-altivec64l-valgrind.xml
%{_libdir}/valgrind/powerpc-altivec64l.xml
+%else
+%files -n valgrind-client-headers
+%dir %{_includedir}/valgrind
+%{_includedir}/valgrind/callgrind.h
+%{_includedir}/valgrind/drd.h
+%{_includedir}/valgrind/helgrind.h
+%{_includedir}/valgrind/memcheck.h
+%{_includedir}/valgrind/valgrind.h
+%endif
+
%changelog