]> git.pld-linux.org Git - packages/kf5-extra-cmake-modules.git/blob - kf5-extra-cmake-modules.spec
292333d0d63eb3b4ed87e6b85033214cfb763459
[packages/kf5-extra-cmake-modules.git] / kf5-extra-cmake-modules.spec
1 #
2 # Conditional build:
3 %bcond_without  doc             # build without doc
4 %bcond_without  tests           # build without tests
5
6 %define         orgname         extra-cmake-modules
7 %define         kdeframever     5.87
8 Summary:        Extra Cmake Modules for KF5
9 Summary(pl.UTF-8):      Dodatkowe moduły Cmake'a dla KF5
10 Name:           kf5-%{orgname}
11 Version:        5.87.0
12 Release:        2
13 License:        BSD
14 Group:          Development/Building
15 Source0:        https://download.kde.org/stable/frameworks/%{kdeframever}/%{orgname}-%{version}.tar.xz
16 # Source0-md5:  4c99ba4e843f835a129be9f39666efb0
17 Patch0:         %{orgname}-tests.patch
18 Patch1:         kdefetchtranslations-test.patch
19 URL:            https://kde.org/
20 BuildRequires:  cmake >= 3.16
21 BuildRequires:  qt5-assistant >= 5.9.0
22 BuildRequires:  qt5-linguist
23 BuildRequires:  python3-charset_normalizer >= 2.0.0
24 BuildRequires:  rpmbuild(macros) >= 1.698
25 BuildRequires:  sed >= 4.0
26 BuildRequires:  sphinx-pdg >= 1.2
27 BuildRequires:  tar >= 1:1.22
28 BuildRequires:  xz
29 %if %{with tests}
30 BuildRequires:  Qt5Core-devel >= 5.9.0
31 BuildRequires:  Qt5Gui-devel >= 5.9.0
32 BuildRequires:  Qt5Network-devel >= 5.9.0
33 BuildRequires:  Qt5Qml-devel >= 5.9.0
34 BuildRequires:  Qt5Quick-devel >= 5.9.0
35 BuildRequires:  libstdc++-devel >= 6:5
36 BuildRequires:  qt5-build >= 5.9.0
37 %endif
38 Obsoletes:      kf5-extra-cmake-modules-doc
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
43 The Extra CMake Modules package, or ECM, adds to the modules provided
44 by CMake, including both ones used by find_package() to find common
45 software and ones that can be used directly in CMakeLists.txt files to
46 perform common tasks.
47
48 In addition, it provides common build settings used in software
49 produced by the KDE community.
50
51 While the driving force of this module is to reduce duplication in
52 CMake scripts across KDE software, it is intended to be useful for any
53 software that uses the CMake build system.
54
55 %description -l pl.UTF-8
56 Pakiet Extra CMake Modules (ECM) dostarcza dodatkowe moduły do tych
57 dostarczanych przez CMake'a, zawierające te używane przez
58 find_package() do szukania popularnego oprogramowania, a także takie,
59 których można używać bezpośrednio w CMakeLists.txt do wykonywania
60 wspólnych zadań.
61
62 Ponadto pakiet dostarcza wspólne ustawienia budowana używane w
63 oprogramowaniu tworzonym przez społeczność KDE.
64
65 O ile główną motywacją tego modułu jest zmniejszenie duplikacji w
66 skryptach CMake'a w oprogramowaniu KDE, ma także być przydatny dla
67 dowolnych programów wykorzystujących system budowania CMake.
68
69 %package apidocs
70 Summary:        API documentation for %{orgname}
71 Summary(pl.UTF-8):      Dokumentacja API %{orgname}
72 Group:          Documentation
73
74 %description apidocs
75 API documentation for %{orgname}.
76
77 %description apidocs -l pl.UTF-8
78 Dokumentacja API dla %{orgname}.
79
80 %prep
81 %setup -q -n %{orgname}-%{version}
82 %patch0 -p1
83 %patch1 -p0
84
85 # causes make install failure after running tests
86 %{__sed} -i -e '/ECMToolchainAndroidTest/d' tests/CMakeLists.txt
87
88 %build
89 install -d build
90 cd build
91 %cmake \
92         %{!?with_tests:-DBUILD_TESTING=OFF} \
93         %{!?with_doc:-DBUILD_HTML_DOCS=OFF} \
94         ..
95
96 %{__make}
97
98 %if %{with tests}
99 # GenerateSipBindings wants clang and has libclang checks incompatible with libclang >= 4
100 # ECMPoQmToolsTest fails to build it's own moc file
101 ctest -E '(GenerateSipBindings|ECMPoQmToolsTest)'
102 %endif
103
104 %install
105 rm -rf $RPM_BUILD_ROOT
106
107 %{__make} -C build -j1 install \
108         DESTDIR=$RPM_BUILD_ROOT
109
110 sed -i -e 's#/usr/bin/env bash#/bin/bash#' $RPM_BUILD_ROOT%{_datadir}/ECM/kde-modules/kde-git-commit-hooks/pre-commit.in
111 sed -i -e 's#/usr/bin/env bash#/bin/bash#' $RPM_BUILD_ROOT%{_datadir}/ECM/kde-modules/kde-git-commit-hooks/clang-format.sh
112
113 %if %{with doc}
114 %{__mv} $RPM_BUILD_ROOT%{_docdir}/ECM ECM-doc
115 %endif
116 install -d $RPM_BUILD_ROOT%{_datadir}/qlogging-categories5
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %files
122 %defattr(644,root,root,755)
123 %doc COPYING-CMAKE-SCRIPTS README.rst
124 %{_datadir}/ECM
125 %{_datadir}/qlogging-categories5
126 %{_mandir}/man7/ecm*.7*
127
128 %if %{with doc}
129 %files apidocs
130 %defattr(644,root,root,755)
131 %doc ECM-doc/html/*
132 %endif
This page took 0.069908 seconds and 2 git commands to generate.