%define version 4.1.0 %define major_minor_version 4.1 %define release 1%{?dist} Name: cmake4 Version: %{version} Release: %{release} Summary: A cross-platform, open-source build system generator. License: BSD URL: https://cmake.org/ Source0: https://github.com/Kitware/CMake/releases/download/v%{version}/cmake-%{version}.tar.gz %if 0%{?amzn} == 2023 BuildRequires: gcc14 BuildRequires: gcc14-c++ %global toolchain gcc14 %else BuildRequires: gcc BuildRequires: gcc-c++ %endif BuildRequires: make BuildRequires: tar BuildRequires: openssl-devel Conflicts: cmake <= 4.0 %description CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generates native makefiles and workspaces that can be used in the compiler environment of your choice. %prep %setup -q -n CMake-%{version} %build ./bootstrap --prefix=/usr make %{?_smp_mflags} %install make DESTDIR=%{buildroot} install # The build system might install to /usr/local despite the prefix. # We need to move the files to the correct /usr location and remove the old directory. mkdir -p %{buildroot}/%{_bindir} if [ -d %{buildroot}/usr/local ]; then mv %{buildroot}/usr/local/bin/* %{buildroot}%{_bindir}/ mv %{buildroot}/usr/local/share/* %{buildroot}%{_datadir}/ rm -rf %{buildroot}/usr/local fi pushd %{buildroot}/%{_bindir} ln -s cmake cmake-%{version} ln -s cpack cpack-%{version} ln -s ctest ctest-%{version} popd # Fix doc location mkdir -p %{buildroot}/%{_docdir}/cmake-%{major_minor_version} mv %{buildroot}/usr/doc/cmake-%{major_minor_version}/* %{buildroot}/%{_docdir}/cmake-%{major_minor_version}/ rm -rf %{buildroot}/usr/doc/cmake-%{major_minor_version} || : %files %{_bindir}/cmake %{_bindir}/cpack %{_bindir}/ctest %{_bindir}/cmake-%{version} %{_bindir}/cpack-%{version} %{_bindir}/ctest-%{version} %{_datadir}/cmake-%{major_minor_version} %{_docdir}/cmake-%{major_minor_version} %{_datadir}/aclocal/cmake.m4 %{_datadir}/bash-completion/completions/* %{_datadir}/emacs/site-lisp/cmake-mode.el %{_datadir}/vim/vimfiles/ %changelog * Thu Aug 21 2025 Yonghang Wang - 4.1.0-1 - Initial Build of CMake 4.1.0