%define debug_package %{nil} %bcond_without ncurses %bcond_without X11_test %ifarch aarch64_ilp32 %bcond_with cmake_gui %bcond_with emacs %bcond_without bootstrap %bcond_with sphinx %else %bcond_without cmake_gui %bcond_without emacs %bcond_with bootstrap %bcond_without sphinx %endif # Do not build non-lto objects to reduce build time significantly. %global build_cflags %(echo '%{build_cflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') %global build_cxxflags %(echo '%{build_cxxflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') %global build_fflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') %global build_fcflags %(echo '%{build_fflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g') %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/cmake-%{version}} %{?rcsuf:%global relsuf .%{rcsuf}} %{?rcsuf:%global versuf -%{rcsuf}} Name: cmake Version: 3.27.9 %global major_version %(echo %{version} | awk -F. '{print $1}') Release: 5 Summary: Cross-platform make system License: BSD-3-Clause AND MIT-open-group AND Zlib URL: http://www.cmake.org Source0: https://www.cmake.org/files/v3.27/cmake-%{version}.tar.gz Source1: cmake-init.el Source2: macros.cmake.in Source3: cmake.attr Source4: cmake.prov Source5: cmake.req Patch0: cmake-findruby.patch %ifarch sw_64 Patch1: cmake-3.22.0-sw.patch %endif Patch2: cmake-3.27.9-fix-cxx-standard-check-issue.patch %ifarch aarch64_ilp32 Patch6000: backport-cmake-aarch64-ilp32-support.patch %endif BuildRequires: coreutils findutils gcc-c++ gcc-gfortran sed %if %{with cmake_gui} BuildRequires: pkgconfig(Qt5Widgets) desktop-file-utils %endif %if %{with emacs} BuildRequires: emacs %endif BuildRequires: python3-devel %if %{with X11_test} BuildRequires: libX11-devel %endif %if %{with ncurses} BuildRequires: ncurses-devel %endif %if %{with sphinx} BuildRequires: python3-sphinx %endif %if %{without bootstrap} BuildRequires: bzip2-devel curl-devel expat-devel jsoncpp-devel libarchive-devel BuildRequires: libuv-devel xz-devel zlib-devel cmake-rpm-macros %endif BuildRequires: pkgconfig(bash-completion) %global bash_completionsdir %(pkg-config --variable=completionsdir bash-completion 2>/dev/null || echo '%{_datadir}/bash-completion/completions') Requires: cmake-data = %{version}-%{release} cmake-rpm-macros = %{version}-%{release} Requires: cmake-filesystem = %{version}-%{release} Provides: cmake3 = %{version}-%{release} bundled(md5-deutsch) bundled(kwsys) bundled(cppdap) %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, preprocessor generation, code generation, and template instantiation. %package data Summary: Common data-files for cmake Requires: cmake = %{version}-%{release} cmake-filesystem = %{version}-%{release} Requires: cmake-rpm-macros = %{version}-%{release} %if %{with emacs} Requires: emacs-filesystem%{?_emacs_version: >= %{_emacs_version}} %endif BuildArch: noarch %description data This package contains common data-files for cmake. %package filesystem Summary: Directories used by CMake modules %description filesystem This package owns all directories used by CMake modules. %if %{with cmake_gui} %package gui Summary: Qt GUI for cmake Requires: cmake = %{version}-%{release} Requires: hicolor-icon-theme Requires: shared-mime-info %description gui The cmake-gui package contains the Qt based GUI for cmake. %endif %package rpm-macros Summary: Common RPM macros for cmake Requires: rpm Conflicts: cmake-data < 3.10.1-2 BuildArch: noarch %description rpm-macros This package contains common RPM macros for cmake. %package help Summary: Documentation for cmake Provides: %{name}-doc = %{version}-%{release} Obsoletes: %{name}-doc < %{version}-%{release} BuildArch: noarch %description help Documentation for cmake. %prep %autosetup -n cmake-%{version}%{?versuf} -p 1 echo '#!%{__python3}' > %{name}.prov echo '#!%{__python3}' > %{name}.req tail -n +2 %{SOURCE4} >> %{name}.prov tail -n +2 %{SOURCE5} >> %{name}.req %build export CFLAGS=`echo %{optflags} | sed 's/-g\b/-s/g'` export CXXFLAGS=`echo %{optflags} | sed 's/-g\b/-s/g'` export LDFLAGS="%{?__global_ldflags}" mkdir %{_vpath_builddir} pushd %{_vpath_builddir} ../bootstrap --prefix=%{_prefix} --datadir=/share/cmake \ --docdir=/share/doc/cmake --mandir=/share/man \ --%{?with_bootstrap:no-}system-libs \ --parallel=`/usr/bin/getconf _NPROCESSORS_ONLN` \ --no-system-cppdap \ --no-system-librhash \ %if %{with sphinx} --sphinx-man --sphinx-html \ %else --sphinx-build=%{_bindir}/false \ %endif %if %{with cmake_gui} %if 0%{?build_cross} == 0 --qt-gui \ %endif %endif ; popd %make_build -C %{_vpath_builddir} %install install -d %{buildroot}%{_pkgdocdir} %make_install -C %{_vpath_builddir} CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir} find %{buildroot}%{_datadir}/cmake/Modules -type f | xargs chmod -x for f in ccmake cmake cpack ctest; do ln -s $f %{buildroot}%{_bindir}/${f}3; done %if %{with emacs} install -d %{buildroot}%{_emacs_sitelispdir}/cmake install -p -m 0644 Auxiliary/cmake-mode.el %{buildroot}%{_emacs_sitelispdir}/cmake/cmake-mode.el %{_emacs_bytecompile} %{buildroot}%{_emacs_sitelispdir}/cmake/cmake-mode.el install -d %{buildroot}%{_emacs_sitestartdir} install -p -m 0644 %SOURCE1 %{buildroot}%{_emacs_sitestartdir} %else rm -f %{buildroot}%{_emacs_sitelispdir} %endif install -p -m0644 -D %{S:2} %{buildroot}%{rpm_macros_dir}/macros.%{name} sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|%{major_version}|" %{buildroot}%{rpm_macros_dir}/macros.%{name} touch -r %{S:2} %{buildroot}%{rpm_macros_dir}/macros.%{name} install -p -m0644 -D %{S:3} %{buildroot}%{_prefix}/lib/rpm/fileattrs/cmake.attr install -p -m0755 -D cmake.prov %{buildroot}%{_prefix}/lib/rpm/cmake.prov install -p -m0755 -D cmake.req %{buildroot}%{_prefix}/lib/rpm/cmake.req install -d %{buildroot}%{_libdir}/cmake find Source Utilities -type f -iname copy\* cp -p Source/kwsys/Copyright.txt ./Copyright_kwsys cp -p Utilities/KWIML/Copyright.txt ./Copyright_KWIML cp -p Utilities/cmlibarchive/COPYING ./COPYING_cmlibarchive cp -p Utilities/cmliblzma/COPYING ./COPYING_cmliblzma cp -p Utilities/cmcurl/COPYING ./COPYING_cmcurl cp -p Utilities/cmlibrhash/COPYING ./COPYING_cmlibrhash cp -p Utilities/cmzlib/Copyright.txt ./Copyright_cmzlib cp -p Utilities/cmexpat/COPYING ./COPYING_cmexpat install -d %{buildroot}%{_pkgdocdir} cp -pr %{buildroot}%{_datadir}/cmake/Help %{buildroot}%{_pkgdocdir} cp -p Utilities/cmcppdap/LICENSE LICENSE.cppdap cp -p Utilities/cmcppdap/NOTICE NOTICE.cppdap %if %{with cmake_gui} %if 0%{?build_cross} == 0 desktop-file-install --delete-original \ --dir=%{buildroot}%{_datadir}/applications \ %{buildroot}%{_datadir}/applications/cmake-gui.desktop %endif install -d %{buildroot}%{_metainfodir} %endif find %{buildroot}%{_datadir}/cmake -type d | sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > data_dirs.mf find %{buildroot}%{_datadir}/cmake -type f | sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > data_files.mf find %{buildroot}%{_libdir}/cmake -type d | sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > lib_dirs.mf find %{buildroot}%{_libdir}/cmake -type f | sed -e 's!^%{buildroot}!"!g' -e 's!$!"!g' > lib_files.mf find %{buildroot}%{_bindir} -type f -or -type l -or -xtype l | \ sed -e '/.*-gui$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf %check pushd %{_vpath_builddir} # CTestTestUpload requires internet access. NO_TEST="CTestTestUpload" # Likely failing for hardening flags from system. NO_TEST="$NO_TEST|CustomCommand|RunCMake.PositionIndependentCode" %ifarch riscv64 # These three tests timeout on riscv64, skip them. NO_TEST="$NO_TEST|Qt5Autogen.ManySources|Qt5Autogen.MocInclude|Qt5Autogen.MocIncludeSymlink|Qt6Autogen.MocIncludeSymlink" %endif bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure popd %if %{with cmake_gui} %post gui update-desktop-database &> /dev/null || : touch --no-create %{_datadir}/mime || : touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun gui update-desktop-database &> /dev/null || : if [ $1 -eq 0 ] ; then touch --no-create %{_datadir}/mime || : update-mime-database %{_datadir}/mime &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi %posttrans gui update-mime-database %{_datadir}/mime &> /dev/null || : gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %files -f lib_files.mf %doc %dir %{_pkgdocdir} %license Copyright_* COPYING* Copyright.txt %license LICENSE.cppdap NOTICE.cppdap %files data -f data_files.mf %{_datadir}/aclocal/cmake.m4 %{_datadir}/bash-completion %if %{with emacs} %{_emacs_sitelispdir}/cmake %{_emacs_sitelispdir}/cmake-mode.el %{_emacs_sitestartdir}/cmake-init.el %endif %{_datadir}/vim/vimfiles/indent/%{name}.vim %{_datadir}/vim/vimfiles/syntax/%{name}.vim %exclude %{_datadir}/cmake/Templates/Windows/Windows_TemporaryKey.pfx %files filesystem -f data_dirs.mf -f lib_dirs.mf %if %{with cmake_gui} %files gui %if 0%{?build_cross} == 0 %{_bindir}/cmake-gui %{_datadir}/applications/cmake-gui.desktop %{_datadir}/mime/packages %{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png %endif %endif %files rpm-macros %{rpm_macros_dir}/macros.cmake %{_rpmconfigdir}/fileattrs/cmake.attr %{_rpmconfigdir}/cmake.prov %{_rpmconfigdir}/cmake.req %files help %if %{with sphinx} %{_mandir}/man1/ccmake.1.* %{_mandir}/man1/cmake.1.* %{_mandir}/man1/cpack.1.* %{_mandir}/man1/ctest.1.* %{_mandir}/man7/*.7.* %if %{with cmake_gui} %if 0%{?build_cross} == 0 %{_mandir}/man1/cmake-gui.1.* %endif %endif %endif %doc %{_pkgdocdir} %exclude %{_pkgdocdir}/Copyright.txt %changelog * Thu Jul 18 2024 Funda Wang - 3.27.9-5 - Update cmake rpm macro - make use of _vpath_builddir - enable check section * Wed Jul 10 2024 fuanan - 3.27.9-4 - Add compilation options for i686. - Support arrch64-ilp32 compilation. * Fri Apr 5 2024 tiberium 3.27.9-3 - fix cmake compile issue due to cxx standard check failed * Fri Feb 2 2024 liyanan - 3.27.9-2 - Remove Windows_TemporaryKey.pfx * Fri Jan 5 2024 liyanan - 3.27.9-1 - Update to 3.27.9 * Thu Dec 14 2023 liyanan - 3.24.3-2 - Fix abnormal empty link in cmake-data package * Mon Nov 14 2022 jchzhou - 3.24.3-1 - Update to 3.24.3 * Wed Oct 19 2022 wuzx - 3.22.0-3 - add sw64 patch * Wed Mar 2 2022 wangchen - 3.22.0-2 - Remove rhash-devel from BuildRequires * Sat Feb 12 2022 wangchen - 3.22.0-1 - Update to 3.22.0 * Tue Jul 20 2021 wangchen - 3.19.2-3 - Delete unnecessary gdb from BuildRequires * Mon Mar 22 2021 lirui - 3.19.2-2 - Remove the -g option and the debug package - add the -s option * Mon Jan 25 2021 wangchen - 3.19.2-1 - Update to 3.19.2 * Sat Aug 29 2020 wangchen - 3.18.0-3 - Revert macros.cmake * Tue Aug 25 2020 wangchen - 3.18.0-2 - Modify macros.cmake * Thu Jul 30 2020 wangchen - 3.18.0-1 - Update to cmake-3.18.0 * Mon May 25 2020 licihua - 3.17.2-1 - Update to cmake-3.17.2 * Fri Apr 03 2020 zhouyihang - 3.12.1-6 - Remove useless scriptlet * Mon Mar 23 2020 Xiangyang Yu -3.12.1-5 - add BuildRequires:gdb to fix src.rpm build error * Thu Feb 20 2020 lijin Yang -3.12.1-4 - make sphinx-build enable * Wed Jan 22 2020 Yiru Wang - 3.12.1-3 - Disable test * Fri Nov 29 2019 lijin Yang - 3.12.1-2 - init package