%define shortVersion %(echo %{version} | cut -d. -f1,2) %define majorVersion %(echo %{version} | cut -d. -f1) %bcond_with bootstrap %ifarch i586 %bcond_with qt %else %bcond_without qt %endif %bcond_with tests #comment out if not prerel #define prerel rc4 #release for bumping %define rel 1 Name: cmake Summary: Cross-platform, open-source make system Epoch: 1 Version: 3.29.2 Release: %mkrel %{?prerel:0.%prerel.}%{rel} License: BSD Group: Development/Other Url: https://www.cmake.org/ Source0: https://www.cmake.org/files/v%{shortVersion}/%{name}-%{version}%{?prerel:-%prerel}.tar.gz # (ngompa) From Fedora -- fixes ruby detection in CMake Patch0: https://src.fedoraproject.org/rpms/cmake/raw/rawhide/f/cmake-findruby.patch BuildRequires: pkgconfig(libcrypto) %if %{without bootstrap} BuildRequires: cmake BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(expat) BuildRequires: gcc-gfortran BuildRequires: pkgconfig(libidn) BuildRequires: pkgconfig(jsoncpp) BuildRequires: pkgconfig(libarchive) BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libuv) BuildRequires: pkgconfig(ncurses) BuildRequires: perl BuildRequires: xz BuildRequires: pkgconfig(zlib) BuildRequires: rhash-devel %if %{with qt} BuildRequires: cmake(Qt6Widgets) %endif %if %{with tests} # Needed for test suite. BuildRequires: cxxtest BuildRequires: pkgconfig(Coin) %endif %endif Requires: rpm-mageia-setup Requires: %{name}-rpm-macros Provides: %{name}%{majorVersion} = %{version}-%{release} %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 %if ! %{with bootstrap} %{_bindir}/ccmake %endif %{_bindir}/ctest %{_bindir}/cpack %{_datadir}/%{name}/ %{_datadir}/aclocal/cmake.m4 %{_datadir}/bash-completion/completions/* %{_sysconfdir}/emacs/site-start.d/%{name}.el %{_datadir}/vim/*/* %{_datadir}/emacs/site-lisp/cmake-mode.el %dir %{_libdir}/%{name} #----------------------------------------------------------------------------- %if %{without bootstrap} %if %{with qt} %package -n %{name}-qtgui Summary: Qt GUI Dialog for CMake - the Cross-platform, open-source make system Group: Development/Other Requires: %{name} = %{epoch}:%{version}-%{release} Provides: %{name}-gui = %{epoch}:%{version}-%{release} %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}/*/*/*/*.png %endif %endif #----------------------------------------------------------------------------- %prep %setup -q -n %{name}-%{version}%{?prerel:-%prerel} %autopatch -p1 # 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 %if %{with bootstrap} mkdir -p %{_vpath_builddir} cd %{_vpath_builddir} %set_build_flags ../configure \ --no-system-libs \ --parallel="%_smp_mflags" \ --prefix=%{_prefix} \ --datadir=/share/%{name} \ --mandir=/share/man \ --docdir=/share/doc/%{name} %make_build %else %cmake \ -DCMAKE_USE_SYSTEM_LIBRARIES:BOOL=ON \ -DCMake_ENABLE_DEBUGGER:BOOL=OFF \ -DCMAKE_DATA_DIR:PATH=/share/%{name} \ -DCMAKE_MAN_DIR:PATH=/share/man \ -DCMAKE_DOC_DIR:PATH=/share/doc/%{name} \ -DBUILD_QtDialog:BOOL=%{?with_qt:ON}%{?!with_qt:OFF} %cmake_build %endif %install %make_install -C %{_vpath_builddir} # cmake mode for emacs install -d %{buildroot}%{_sysconfdir}/emacs/site-start.d 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 # Create/Own this dir as this is used in cmake dependant rpms but not own by any mkdir -p %{buildroot}%{_libdir}/%{name} # There are some stray Copyright.txt files there sometimes. rm -fr %{buildroot}%{_docdir}/%{name}/ %if %{with tests} %check unset DISPLAY cd %{_vpath_builddir} bin/ctest -V -E ModuleNotices -E 'CMake.(HTML|FileDownload)' -E CTestTestUpload %{?_smp_mflags} %endif