use %cmake macros more

enable -doc subpkg (qsh docs)
epel8
Rex Dieter 5 years ago
parent b268b32758
commit 7f2a490cb1

@ -1,5 +1,7 @@
%global framework kconfig
%undefine __cmake_in_source_build
# uncomment to enable bootstrap mode
#global bootstrap 1
@ -13,6 +15,7 @@
%endif
%endif
#endif
%global docs 1
%global tests 1
%endif
@ -105,6 +108,18 @@ KConfigGui provides a way to hook widgets to the configuration so that they are
automatically initialized from the configuration and automatically propagate
their changes to their respective configuration files.
%if 0%{?docs}
%package doc
Summary: API documentation for %{name}
BuildRequires: doxygen
BuildRequires: qt5-qdoc
BuildRequires: qt5-qhelpgenerator
BuildRequires: qt5-qtbase-doc
BuildArch: noarch
%description doc
%{summary}.
%endif
%if 0%{?python_bindings}
%package -n python2-pykf5-%{framework}
Summary: Python2 bindings for %{framework}
@ -137,23 +152,16 @@ PYTHONPATH=%{_datadir}/ECM/python
export PYTHONPATH
%endif
%{cmake_kf5} -B %{_target_platform} \
%cmake_kf5 \
%{?docs:-DBUILD_QCH:BOOL=ON} \
%{?ninja:-G Ninja} \
%{?tests:-DBUILD_TESTING:BOOL=ON}
%if 0%{?ninja}
%ninja_build -C %{_target_platform}
%else
%make_build -C %{_target_platform}
%endif
%cmake_build
%install
%if 0%{?ninja}
%ninja_install -C %{_target_platform}
%else
%cmake_install
%endif
%find_lang_kf5 kconfig5_qt
@ -164,9 +172,9 @@ export CTEST_OUTPUT_ON_FAILURE=1
## cant use %%ninja_test here for some reason, doesn't inherit env vars from xvfb or dbus -- rex
xvfb-run -a \
%if 0%{?ninja}
ninja test -v -C %{_target_platform} ||:
ninja test -v %{?_smp_mflags} -C %{_target_platform} ||:
%else
make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300" ||:
make test %{?_smp_mflags} -C %{_target_platform} ARGS="--output-on-failure --timeout 300" ||:
%endif
%endif
@ -200,6 +208,12 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300" ||:
%{_kf5_archdatadir}/mkspecs/modules/qt_KConfigCore.pri
%{_kf5_archdatadir}/mkspecs/modules/qt_KConfigGui.pri
%if 0%{?docs}
%files doc
%{_qt5_docdir}/KF5Config.qch
%{_qt5_docdir}/KF5Config.tags
%endif
%if 0%{?python_bindings}
%files -n python2-pykf5-%{framework}
%{python2_sitearch}/PyKF5/
@ -213,6 +227,10 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300" ||:
%changelog
* Tue Jul 21 2020 Rex Dieter <rdieter@fedoraproject.org> - 5.72.0-1
- use %%cmake macros more
- enable -doc subpkg (qsh docs)
* Tue Jul 07 2020 Rex Dieter <rdieter@fedoraproject.org> - 5.72.0-1
- 5.72.0

Loading…
Cancel
Save