diff --git a/eigen3.spec b/eigen3.spec index 90df1d1..4536d0d 100644 --- a/eigen3.spec +++ b/eigen3.spec @@ -15,10 +15,15 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # -%bcond_with tests -%bcond_without docs +%global flavor @BUILD_FLAVOR@%{nil} -Name: eigen3 +%bcond_with tests + +%if %{flavor} == "docs" +%define pkgsuffix -doc +%endif + +Name: eigen3%{?pkgsuffix} Version: 3.3.7 Release: 0 Summary: C++ Template Library for Linear Algebra @@ -48,7 +53,7 @@ BuildRequires: pkg-config BuildRequires: sparsehash-devel BuildRequires: suitesparse-devel BuildRequires: superlu-devel -%if %{with docs} +%if %{flavor} == "docs" BuildRequires: doxygen BuildRequires: fdupes BuildRequires: graphviz @@ -79,13 +84,14 @@ Obsoletes: libeigen3-devel < %{version} Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms. -%package doc +%if %{flavor} == "docs" Summary: Documentation for the Eigen3 C++ Template Library for Linear Algebra Group: Documentation/HTML -%description doc +%description Documentation in HTML format for the Eigen3 C++ Template Library for Linear Algebra +%endif %prep %setup -q -n eigen-eigen-323c052e1731 @@ -106,8 +112,10 @@ echo "HTML_TIMESTAMP = NO" >> doc/Doxyfile.in -DCMAKE_BUILD_TYPE=Release \ -DINCLUDE_INSTALL_DIR=%{_includedir}/eigen3 \ -DGOOGLEHASH_INCLUDES=%{_includedir} + +%if %{flavor} == "" make %{?_smp_mflags} all -%if %{with docs} +%else make %{?_smp_mflags} doc %endif @@ -118,6 +126,11 @@ find doc -name _formulas.log -print -delete %cmake_install %fdupes -s build/doc/html/ +%if %{flavor} == "docs" +%files +%doc build/doc/html/ + +%else %files devel %license COPYING.* %{_includedir}/eigen3/ @@ -125,7 +138,6 @@ find doc -name _formulas.log -print -delete %{_datadir}/pkgconfig/eigen3.pc %{_datadir}/cmake/Modules/FindEigen3.cmake -%files doc -%doc build/doc/html/ +%endif %changelog