]> git.pld-linux.org Git - packages/cmake.git/blob - cmake.spec
set CMAKE_SYSTEM_PROCESSOR and related options when cmake builds itself
[packages/cmake.git] / cmake.spec
1 # TODO:
2 # - system kwiml >= 1.0?
3 # - make lib64/libx32 patch changes applicable everywhere
4 # - any valid CMAKE_BUILD_TYPE causes overriding of our optflags
5 #   (and default non-verbose makefiles are hiding it!)
6 # - rpmldflags/rpmcppflags are not passed through %%cmake macro at all
7 #   (is there any standard way???)
8 # - FindJNI.cmake module is a PoS full of random incorrect paths,
9 #   needs lib64/libx32 awareness
10 #
11 # Conditional build:
12 %bcond_with     bootstrap       # use internal versions of some libraries
13 %bcond_without  gui             # gui package
14 %bcond_with     tests           # perform "make test"
15 %bcond_without  doc             # documentation
16
17 Summary:        Cross-platform, open-source make system
18 Summary(pl.UTF-8):      Wieloplatformowy system make o otwartych źródłach
19 Name:           cmake
20 Version:        3.27.3
21 Release:        1
22 License:        BSD
23 Group:          Development/Building
24 Source0:        https://cmake.org/files/v3.27/%{name}-%{version}.tar.gz
25 # Source0-md5:  7228f5fcc8a858fdeac27e29bda0c144
26 Patch0:         %{name}-lib64.patch
27 Patch1:         %{name}-libx32.patch
28 Patch2:         %{name}-jni.patch
29 Patch3:         %{name}-findruby.patch
30 Patch4:         %{name}-findruby2.patch
31 Patch5:         disable-completness-check.patch
32 Patch6:         %{name}-zlib.patch
33 Patch7:         atomic.patch
34 URL:            https://cmake.org/
35 # system zlib,bzip2,xz,zstd used only when without system libarchive
36 %if %{with gui}
37 BuildRequires:  Qt5Core-devel >= 5.0
38 BuildRequires:  Qt5Gui-devel >= 5.0
39 BuildRequires:  Qt5Widgets-devel >= 5.0
40 %endif
41 BuildRequires:  automake
42 BuildRequires:  cppdap-devel
43 BuildRequires:  curl-devel
44 BuildRequires:  expat-devel
45 BuildRequires:  jsoncpp-devel >= 1.6.2-2
46 BuildRequires:  libarchive-devel >= 3.3.3
47 %ifnarch %arch_with_atomics64
48 BuildRequires:  libatomic-devel
49 %endif
50 BuildRequires:  libstdc++-devel >= 6:4.7
51 BuildRequires:  libuv-devel >= 1.28.0
52 BuildRequires:  ncurses-devel > 5.9-3
53 BuildRequires:  ncurses-ext-devel > 5.9-3
54 BuildRequires:  nghttp2-devel
55 %{?with_gui:BuildRequires:      qt5-build >= 5.0}
56 %{?with_gui:BuildRequires:      qt5-qmake >= 5.0}
57 BuildRequires:  rhash-devel
58 BuildRequires:  rpm-build >= 4.6
59 BuildRequires:  rpmbuild(macros) >= 2.025
60 %{?with_doc:BuildRequires:      sphinx-pdg}
61 BuildRequires:  xz-devel
62 BuildRequires:  zlib-devel
63 BuildRequires:  zstd-devel
64 Requires:       filesystem >= 3.0-52
65 Requires:       libarchive >= 3.3.3
66 Requires:       libuv >= 1.28.0
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %description
70 CMake is used to control the software compilation process using simple
71 platform and compiler independent configuration files. CMake generates
72 native makefiles and workspaces that can be used in the compiler
73 environment of your choice. CMake is quite sophisticated: it is
74 possible to support complex environments requiring system
75 configuration, pre-processor generation, code generation, and template
76 instantiation.
77
78 %description -l pl.UTF-8
79 CMake służy do sterowania procesem kompilacji oprogramowania przy
80 użyciu prostych plików konfiguracyjnych niezależnych od platformy i
81 kompilatora. CMake generuje natywne pliki makefile i workspace,
82 których można używać w wybranym środowisku kompilatora. CMake jest
83 dość wyrafinowany: może obsłużyć złożone środowiska wymagające
84 konfiguracji systemu, generowanie preprocesora, generowanie kodu i
85 dziedziczenie szablonów.
86
87 %package doc-html
88 Summary:        CMake documentation in HTML format
89 Summary(pl.UTF-8):      Dokumentacja do pakietu CMake w formacie HTML
90 Group:          Documentation
91
92 %description doc-html
93 CMake documentation in HTML format.
94
95 %description doc-html -l pl.UTF-8
96 Dokumentacja do pakietu CMake w formacie HTML.
97
98 %package gui
99 Summary:        Qt GUI for CMake
100 Summary(pl.UTF-8):      Graficzny interfejs użytkownika Qt dla CMake
101 Group:          Development/Tools
102 Requires(post,postun):  desktop-file-utils
103 Requires(post,postun):  gtk-update-icon-cache
104 Requires:       %{name} = %{version}-%{release}
105 Requires:       hicolor-icon-theme
106
107 %description gui
108 This package contains the Qt based GUI for CMake.
109
110 %description gui -l pl.UTF-8
111 Ten pakiet zawiera oparty na Qt graficzny interfejs użytkownika dla
112 CMake.
113
114 %package emacs
115 Summary:        Emacs mode for cmake files
116 Summary(pl.UTF-8):      Tryb Emacsa dla plików cmake'a
117 Group:          Development/Tools
118
119 %description emacs
120 Emacs mode for cmake files.
121
122 %description emacs -l pl.UTF-8
123 Tryb Emacsa dla plików cmake'a.
124
125 %package -n bash-completion-%{name}
126 Summary:        bash-completion for cmake
127 Summary(pl.UTF-8):      Bashowe dopełnianie parametrów dla cmake'a
128 Group:          Applications/Shells
129 Requires:       %{name} = %{version}-%{release}
130 Requires:       bash-completion >= 1:2.0
131 BuildArch:      noarch
132
133 %description -n bash-completion-%{name}
134 bash-completion for cmake.
135
136 %description -n bash-completion-%{name} -l pl.UTF-8
137 Bashowe dopełnianie parametrów dla cmake'a.
138
139 %prep
140 %setup -q
141 %if "%{_lib}" == "lib64"
142 %patch0 -p1
143 %endif
144 %if "%{_lib}" == "libx32"
145 %patch1 -p1
146 %endif
147 %patch2 -p1
148 %patch3 -p1
149 %patch4 -p1
150 %patch5 -p1
151 %patch6 -p1
152 %patch7 -p1
153
154 %{__sed} -i -e '1s,/usr/bin/env bash,/bin/bash,' \
155         Modules/Compiler/XL-Fortran/cpp
156
157 cat > "init.cmake" <<EOF
158 SET (CURSES_INCLUDE_PATH "/usr/include/ncurses" CACHE PATH " " FORCE)
159 SET (CMAKE_INSTALL_SYSCONFDIR "%{_sysconfdir}" CACHE PATH " " FORCE)
160 SET (CMAKE_INSTALL_DATADIR "%{_datadir}" CACHE PATH " " FORCE)
161 SET (CMAKE_SYSTEM_NAME "Linux" CACHE STRING " " FORCE)
162 SET (CMAKE_SYSTEM_VERSION "%(uname -r)" CACHE STRING " " FORCE)
163 SET (CMAKE_CROSSCOMPILING FALSE CACHE BOOL " " FORCE)
164 %ifarch x32
165 SET (CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING " " FORCE)
166 %else
167 SET (CMAKE_SYSTEM_PROCESSOR "%{_target_cpu}" CACHE STRING " " FORCE)
168 %endif
169 EOF
170
171 # cleanup backups after patching, modules are copied as-is
172 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
173
174 %build
175 export CC="%{__cc}"
176 export CXX="%{__cxx}"
177 export CFLAGS="%{rpmcflags}"
178 export CXXFLAGS="%{rpmcxxflags}"
179 export LDFLAGS="%{rpmldflags}"
180 ./bootstrap \
181         --prefix=%{_prefix} \
182         --mandir=/share/man \
183         --datadir=/share/cmake \
184         --init=init.cmake \
185         %{!?with_bootstrap:--system-libs} \
186         %{?with_gui:--qt-gui} \
187         --qt-qmake=%{_bindir}/qmake-qt5 \
188         %{?with_doc:--sphinx-html} \
189         %{?with_doc:--sphinx-man} \
190         %{?__jobs:--parallel=%{__jobs}} \
191         --verbose
192
193 %{__make} \
194         VERBOSE=1
195
196 %{?with_tests:%{__make} test}
197
198 %install
199 rm -rf $RPM_BUILD_ROOT
200
201 %{__make} install \
202         DESTDIR=$RPM_BUILD_ROOT
203
204 # just a bit more recent than packaged in vim.spec
205 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/vim
206 # packaged as %doc
207 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc
208
209 %clean
210 rm -rf $RPM_BUILD_ROOT
211
212 %post gui
213 %update_desktop_database_post
214 %update_icon_cache hicolor
215
216 %postun gui
217 %update_desktop_database_postun
218 %update_icon_cache hicolor
219
220 %files
221 %defattr(644,root,root,755)
222 %doc Copyright.txt README.rst *.gif
223 %attr(755,root,root) %{_bindir}/ccmake
224 %attr(755,root,root) %{_bindir}/cmake
225 %attr(755,root,root) %{_bindir}/cpack
226 %attr(755,root,root) %{_bindir}/ctest
227 %if %{with doc}
228 %{_mandir}/man1/ccmake.1*
229 %{_mandir}/man1/cmake.1*
230 %{_mandir}/man1/cpack.1*
231 %{_mandir}/man1/ctest.1*
232 %{_mandir}/man7/cpack-generators.7*
233 %{_mandir}/man7/cmake-buildsystem.7*
234 %{_mandir}/man7/cmake-commands.7*
235 %{_mandir}/man7/cmake-compile-features.7*
236 %{_mandir}/man7/cmake-configure-log.7*
237 %{_mandir}/man7/cmake-developer.7*
238 %{_mandir}/man7/cmake-env-variables.7*
239 %{_mandir}/man7/cmake-file-api.7*
240 %{_mandir}/man7/cmake-generator-expressions.7*
241 %{_mandir}/man7/cmake-generators.7*
242 %{_mandir}/man7/cmake-language.7*
243 %{_mandir}/man7/cmake-modules.7*
244 %{_mandir}/man7/cmake-packages.7*
245 %{_mandir}/man7/cmake-policies.7*
246 %{_mandir}/man7/cmake-presets.7*
247 %{_mandir}/man7/cmake-properties.7*
248 %{_mandir}/man7/cmake-qt.7*
249 %{_mandir}/man7/cmake-server.7*
250 %{_mandir}/man7/cmake-toolchains.7*
251 %{_mandir}/man7/cmake-variables.7*
252 %{_datadir}/cmake/Help
253 %endif
254 # top cmake/Modules dirs belong to filesystem
255 %{_datadir}/cmake/Modules/.NoDartCoverage
256 %{_datadir}/cmake/Modules/*
257 %{_datadir}/cmake/Templates
258 %{_datadir}/cmake/include
259 %{_aclocaldir}/cmake.m4
260
261 %if %{with doc}
262 %files doc-html
263 %defattr(644,root,root,755)
264 %doc Utilities/Sphinx/html/*
265 %endif
266
267 %if %{with gui}
268 %files gui
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/cmake-gui
271 %{_datadir}/mime/packages/cmakecache.xml
272 %{_desktopdir}/cmake-gui.desktop
273 %{_iconsdir}/hicolor/128x128/apps/CMakeSetup.png
274 %{_iconsdir}/hicolor/32x32/apps/CMakeSetup.png
275 %if %{with doc}
276 %{_mandir}/man1/cmake-gui.1*
277 %endif
278 %endif
279
280 %files emacs
281 %defattr(644,root,root,755)
282 %{_datadir}/emacs/site-lisp/cmake-mode.el
283
284 %files -n bash-completion-%{name}
285 %defattr(644,root,root,755)
286 %{bash_compdir}/cmake
287 %{bash_compdir}/cpack
288 %{bash_compdir}/ctest
This page took 0.637576 seconds and 4 git commands to generate.