diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..58ef5ee
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ doc
+
diff --git a/taglib.changes b/taglib.changes
index f0dbd5b..9f9887a 100644
--- a/taglib.changes
+++ b/taglib.changes
@@ -1,3 +1,13 @@
+-------------------------------------------------------------------
+Thu Jul 4 18:04:10 UTC 2019 - Stefan Brüns
+
+- Split API documentation from devel package, and convert it to multibuild
+ - API documentation is significantly larger than library and headers
+ - API documentation is noarch
+ - Significantly reduced dependency chain for the library package
+- Use graphviz-gd instead of graphviz-gnome for API docs
+- Cleanup specfile
+
-------------------------------------------------------------------
Sun Jun 2 12:06:18 UTC 2019 - Stefan Brüns
diff --git a/taglib.spec b/taglib.spec
index 5c801ec..c8041e9 100644
--- a/taglib.spec
+++ b/taglib.spec
@@ -16,29 +16,50 @@
#
+%global flavor @BUILD_FLAVOR@%{nil}
+%global sname taglib
+
+%if "%{flavor}" != ""
+%global pname %{sname}-%{flavor}
+%else
+%global pname %{sname}
+%endif
+
+%if "%{flavor}" == ""
+%bcond_without tests
+%bcond_without examples
+%else
+%bcond_with tests
+%bcond_with examples
+%endif
+
%define rev ba7adc2bc261ed634c2a964185bcffb9365ad2f4
-Name: taglib
+Name: %{pname}
Version: 1.11.2~git20190601
Release: 0
Summary: Audio Meta-Data Library
License: LGPL-2.1-or-later AND MPL-1.1
Group: Productivity/Multimedia/Other
URL: http://taglib.github.io/
-Source0: https://github.com/taglib/taglib/archive/%{rev}.tar.gz#/%{name}-%{version}.tar.gz
-#Source0: http://taglib.github.io/releases/%%{name}-%%{version}.tar.gz
-Source1: %{name}.desktop
+Source0: https://github.com/taglib/taglib/archive/%{rev}.tar.gz#/%{sname}-%{version}.tar.gz
+#Source0: http://taglib.github.io/releases/%%{sname}-%%{version}.tar.gz
+Source1: %{sname}.desktop
Source100: baselibs.conf
Patch0: taglib-versionbump.patch
BuildRequires: cmake >= 2.8
-BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: gcc-c++
-BuildRequires: graphviz-gnome
+%if "%{flavor}" == "doc"
+BuildRequires: doxygen
+BuildRequires: ghostscript-fonts-std
+BuildRequires: graphviz-gd
+BuildRequires: update-desktop-files
+%else
BuildRequires: libcppunit-devel
BuildRequires: pkgconfig
-BuildRequires: update-desktop-files
BuildRequires: pkgconfig(zlib)
+%endif
# NOTE: The tagreader and writer executables give different results when built with
# an earlier taglib-1.8-ds-rusxmms patch. See bnc#814814
Requires: libtag1 = %{version}-%{release}
@@ -52,6 +73,7 @@ TrueAudio, WAV, AIFF, MP4 and ASF files.
This package contains built examples which manipulate tags from the
command line.
+%if "%{flavor}" == ""
%package -n libtag1
Summary: Audio Meta-Data Library
License: LGPL-2.1-or-later
@@ -91,44 +113,58 @@ Obsoletes: taglib-devel <= 1.6.3
%description -n libtag-devel
This package contains development files for taglib.
+%else
+%package -n libtag-doc
+Summary: API documentation for taglib
+License: LGPL-2.1-or-later
+Group: Documentation/HTML
+BuildArch: noarch
+
+%description -n libtag-doc
+This package contains the taglib API Documentation in HTML format.
+%endif
+
%prep
-%setup -q -n %{name}-%{rev}
+%setup -q -n %{sname}-%{rev}
%patch0 -p0
%build
%cmake \
- -DBUILD_TESTS:BOOL=ON \
+ -DBUILD_TESTS:BOOL=%{?with_tests:ON}%{?without_tests:OFF} \
-DWITH_ASF:BOOL=ON \
-DWITH_MP4:BOOL=ON \
- -DBUILD_EXAMPLES:BOOL=ON
-make %{?_smp_mflags} all docs
+ -DBUILD_EXAMPLES:BOOL=%{?with_examples:ON}%{?without_examples:OFF}
+
+%if "%{flavor}" == "doc"
+%cmake_build docs
+%else
+%cmake_build all
+%endif
%install
-%cmake_install
-
+%if "%{flavor}" == "doc"
# install susehelp file
mkdir -p %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/
install -pm 0644 %{SOURCE1} %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/
-%suse_update_desktop_file %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/%{name}.desktop
+%suse_update_desktop_file %{buildroot}%{_datadir}/susehelp/meta/Development/Libraries/%{sname}.desktop
# Documentation
-mkdir -p %{buildroot}%{_defaultdocdir}/libtag-devel
-rm -f examples/CMake*
-cp -a AUTHORS NEWS build/doc/html/ examples/ %{buildroot}%{_defaultdocdir}/libtag-devel/
+mkdir -p %{buildroot}%{_defaultdocdir}/libtag-doc
+# Copy manually, otherwise fdupes does not work
+cp -a build/doc/html/ %{buildroot}%{_defaultdocdir}/libtag-doc/
+
+%else
+%cmake_install all
# Add built examples to taglib package.
mkdir -p %{buildroot}%{_bindir}
-for i in `find build/examples -maxdepth 1 ! -type d -executable`; do cp -v ${i} %{buildroot}%{_bindir}/; done
+find build/examples -maxdepth 1 ! -type d -executable -exec cp -v \{\} %{buildroot}%{_bindir} \;
+%endif
%fdupes %{buildroot}
-%post
-%desktop_database_post
-
-%postun
-%desktop_database_postun
-
+%if "%{flavor}" == ""
%post -n libtag1 -p /sbin/ldconfig
%postun -n libtag1 -p /sbin/ldconfig
%post -n libtag_c0 -p /sbin/ldconfig
@@ -143,16 +179,27 @@ for i in `find build/examples -maxdepth 1 ! -type d -executable`; do cp -v ${i}
%{_libdir}/libtag_c.so.0.*
%files -n libtag-devel
-%doc %{_defaultdocdir}/libtag-devel
%{_bindir}/taglib-config
%{_includedir}/taglib/
%{_libdir}/libtag*.so
%{_libdir}/pkgconfig/*.pc
-%{_datadir}/susehelp/
%files
%license COPYING.LGPL COPYING.MPL
%{_bindir}/*
%exclude %{_bindir}/taglib-config
+%else
+%post
+%desktop_database_post
+
+%postun
+%desktop_database_postun
+
+%files -n libtag-doc
+%doc AUTHORS NEWS examples
+%{_docdir}/libtag-doc/html
+%{_datadir}/susehelp/
+%endif
+
%changelog