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