%define shortVersion %(echo %{version} | cut -d. -f1,2) %bcond_without bootstrap Summary: Cross-platform, open-source make system Name: cmake Version: 3.27.9 Release: 1 Epoch: 1 License: BSD Group: Development/Other URL: https://cmake.org Source0: %{url}/files/v%{shortVersion}/%{name}-%{version}.tar.gz Source1000: %{name}.rpmlintrc Source1: cmake.macros Patch0: cmake-3.7.2-optflags.patch Patch1: cmake-3.6.1-fltk133.patch Patch2: 0003-Disable-Test198.patch BuildRequires: gcc-gfortran BuildRequires: bzip2-devel BuildRequires: %{_lib}cppdap-devel BuildRequires: emacs BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(libarchive) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libidn) BuildRequires: pkgconfig(libuv) >= 1.0.0 BuildRequires: pkgconfig(ncurses) BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(nlohmann_json) %if !%{with bootstrap} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Widgets) %endif BuildRequires: pkgconfig(zlib) BuildRequires: %{_lib}rhash-devel %description CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation. %files %{_bindir}/cmake %{_bindir}/ccmake %{_bindir}/ctest %{_bindir}/cpack %{_datadir}/%{name} %{_sysconfdir}/emacs/site-start.d/%{name}.el %{_sysconfdir}/rpm/macros.d/* %{_datadir}/emacs/site-lisp/cmake-mode.el %{_datadir}/vim/*/* %{_datadir}/aclocal/cmake.m4 %{_datadir}/bash-completion/completions/cmake %{_datadir}/bash-completion/completions/cpack %{_datadir}/bash-completion/completions/ctest %doc CMakeLogo.gif mydocs/* #----------------------------------------------------------------------------- %if !%{with bootstrap} %package -n %{name}-qtgui Summary: Qt GUI Dialog for CMake - the Cross-platform, open-source make system Group: Development/Other Requires: %{name} %description -n %{name}-qtgui CMake is used to control the software compilation process using simple platform and compiler independent configuration files. This is the Qt GUI. %files -n %{name}-qtgui %{_bindir}/cmake-gui %{_datadir}/applications/cmake-gui.desktop %{_datadir}/mime/packages/cmakecache.xml %{_iconsdir}/hicolor/*/apps/CMakeSetup.* %endif #----------------------------------------------------------------------------- %prep %setup -q #apply_patches # Don't try to automagically find files in /usr/X11R6 # But also don't change a prefix if it is not /usr perl -pi -e 's@^\s+/usr/X11R6/.*\n@@' Modules/*.cmake %ifarch %{arm} # bootstrap test is taking ages on arm sed -i -e 's!SET(CMAKE_LONG_TEST_TIMEOUT 1500)!SET(CMAKE_LONG_TEST_TIMEOUT 7200)!g' Tests/CMakeLists.txt %endif %build mkdir -p build cd build %setup_compile_flags ../configure \ --system-libs \ --parallel=%{_smp_mflags} \ --prefix=%{_prefix} \ --datadir=/share/%{name} \ --mandir=/share/man \ --docdir=/share/doc/%{name} \ %if !%{with bootstrap} --qt-gui %endif %make %install %makeinstall_std -C build # cmake mode for emacs mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp %{buildroot}%{_sysconfdir}/emacs/site-start.d #mv %{buildroot}%{_datadir}/cmake/editors/emacs/cmake-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/cmake-mode.el cat <%{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el (setq load-path (cons (expand-file-name "/dir/with/cmake-mode") load-path)) (require 'cmake-mode) (setq auto-mode-alist (append '(("CMakeLists\\\\.txt\\\\'" . cmake-mode) ("\\\\.cmake\\\\'" . cmake-mode)) auto-mode-alist)) EOF # cmake mode for vim install -D -p -m644 Auxiliary/vim/syntax/cmake.vim %{buildroot}%{_datadir}/vim/syntax/cmake.vim install -D -p -m644 Auxiliary/vim/indent/cmake.vim %{buildroot}%{_datadir}/vim/indent/cmake.vim # remove directory we just cleared by moving files where editors # will actually find them rm -rf %{buildroot}%{_datadir}/cmake/editors # RPM macros install -m644 %{SOURCE1} -D %{buildroot}%{_sysconfdir}/rpm/macros.d/cmake.macros # %doc wipes out files in doc dir, fixed in cooker svn for rpm package, though # not submitted yet, so we'll just work around this by moving it for now.. rm -rf mydocs mv %{buildroot}%{_datadir}/doc/%{name} mydocs # As of 2.8.10.2, the test suite needs net access. # Absent that, it will fail: # The following tests FAILED: # 186 - CTestTestFailedSubmit-http (Failed) # 187 - CTestTestFailedSubmit-https (Failed) %if 0 %check unset DISPLAY cd build bin/ctest -E SubDirSpaces -V %{_smp_mflags} %endif