4 Star 0 Fork 4

OpenCloudOS Stream/cmake

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cmake.spec 11.49 KB
一键复制 编辑 原始数据 按行查看 历史
# Use ncurses for colorful output
%bcond_without ncurses
# Setting the Python-version used by default
%bcond_without python3
# Enable RPM dependency generators for cmake files written in Python
%bcond_without rpm
# Run tests
%bcond_without test
# Run git tests
%bcond_with git_test
%bcond_with gui
# we use the bundled version defaultly
%bcond_with system_jsoncpp
%bcond_with system_rhash
# Do not build non-lto objects to reduce build time significantly.
%global optflags %(echo '%{optflags}' | sed -e 's!-ffat-lto-objects!-fno-fat-lto-objects!g')
# Place rpm-macros into proper location
%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Summary: A cross-platform, open-source build system generator
Name: cmake
Version: 3.26.5
Release: 6%{?dist}
License: BSD and MIT and zlib and GPLv2+
URL: http://www.cmake.org
%define maj_ver %(echo %{version} | cut -d. -f1)
%define min_ver %(echo %{version} | cut -d. -f2)
Source0: http://www.cmake.org/files/v%{maj_ver}.%{min_ver}/%{name}-%{version}.tar.gz
Source1: %{name}-init.el
Source2: macros.%{name}
Source3: %{name}.attr
Source4: %{name}.prov
Source5: %{name}.req
# Patch to fix RindRuby vendor settings
# http://public.kitware.com/Bug/view.php?id=12965
# https://bugzilla.redhat.com/show_bug.cgi?id=822796
Patch100: %{name}-findruby.patch
# fix build error with hdf5 new version.
Patch0001: fix-detection-of-HDF5-version.patch
# infomation operation tools
BuildRequires: coreutils, findutils, sed, pkgconfig(bash-completion)
# building tools
BuildRequires: gcc-g++, gcc-gfortran, make, python3-sphinx
# library
BuildRequires: ncurses-devel, bzip2-devel, curl-devel, expat-devel, libarchive-devel, libuv-devel, xz-devel, zlib-devel, openssl-devel
# environment variable
BuildRequires: emacs, cmake-rpm-macros, vim-filesystem
%if %{with system_jsoncpp}
BuildRequires: jsoncpp-devel
%endif
%if %{with system_rhash}
BuildRequires: rhash-devel
%endif
%if %{with gui}
BuildRequires: libX11-devel, pkgconfig(Qt5Widgets), desktop-file-utils
%endif
%if %{with git_test}
BuildRequires: git
%endif
%if %{with rpm}
BuildRequires: python3-devel
%endif
Requires: %{name}-data = %{version}-%{release}
Requires: %{name}-rpm-macros = %{version}-%{release}
Requires: %{name}-filesystem = %{version}-%{release}
# Explicitly require make. (rhbz#1862014)
Requires: make
# Provide the major version name
Provides: cmake3 = %{version}-%{release}
# Source/kwsys/MD5.c
Provides: bundled(md5-deutsch)
Provides: bundled(kwsys)
%if %{without system_jsoncpp}
Provides: bundled(jsoncpp)
%endif
%if %{without system_rhash}
Provides: bundled(rhash)
%endif
%description
CMake is a cross-platform, open-source build system generator. CMake is
maintained and supported by Kitware and developed in collaboration with a
productive community of contributors.
CMake is distributed under the OSI-approved BSD 3-clause License.
%package data
Summary: Common data-files for %{name}
Requires: %{name} = %{version}-%{release}
Requires: %{name}-filesystem = %{version}-%{release}
Requires: %{name}-rpm-macros = %{version}-%{release}
Requires: emacs-filesystem
Requires: vim-filesystem
BuildArch: noarch
%description data
This package contains common data-files for %{name}.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
This package contains documentation for %{name}.
%package filesystem
Summary: Directories used by CMake modules
%description filesystem
This package owns all directories used by CMake modules.
%if %{with gui}
%package gui
Summary: Qt GUI for %{name}
Requires: %{name} = %{version}-%{release}
Requires: hicolor-icon-theme
Requires: shared-mime-info
%description gui
The %{name}-gui package contains the Qt based GUI for %{name}.
%endif
%package rpm-macros
Summary: Common RPM macros for %{name}
Requires: rpm
# when subpkg introduced
Conflicts: cmake-data < 3.10.1-2
BuildArch: noarch
%description rpm-macros
This package contains common RPM macros for %{name}.
%prep
%autosetup -n cmake-%{version}%{?versuf} -p 1
%if %{with rpm}
echo '#!%{__python3}' > %{name}.prov
echo '#!%{__python3}' > %{name}.req
tail -n +2 %{SOURCE4} >> %{name}.prov
tail -n +2 %{SOURCE5} >> %{name}.req
%endif
%build
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS
CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS
FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS
FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
SRCDIR="$(/usr/bin/pwd)"
mkdir %{_vpath_builddir}
pushd %{_vpath_builddir}
$SRCDIR/bootstrap --prefix=%{_prefix} \
--datadir=/share/%{name} \
--docdir=/share/doc/%{name} \
--mandir=/share/man \
--system-libs \
--parallel="$(nproc)" \
%if %{with sphinx}
--sphinx-man \
%else
--sphinx-build=%{_bindir}/false \
%endif
%if %{without system_rhash}
--no-system-librhash \
%endif
%if %{without system_jsoncpp}
--no-system-jsoncpp \
%endif
%if %{with gui}
--qt-gui \
%else
--no-qt-gui \
%endif
-- \
-DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
-DCMAKE_Fortran_FLAGS_RELEASE:STRING="-O2 -g -DNDEBUG" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_INSTALL_DO_STRIP:BOOL=OFF
popd
%make_build -C %{_vpath_builddir}
%install
major_version=$(awk 'NR==2 {print $2}' %{_builddir}/cmake-%{version}/Source/CMakeVersion.cmake | awk -F ')' '{print $1}')
# baseinstall
mkdir -p %{buildroot}%{_pkgdocdir}
%make_install -C %{_vpath_builddir} CMAKE_DOC_DIR=%{buildroot}%{_pkgdocdir}
# link cmake to cmake${major_version}
ln -s ccmake %{buildroot}%{_bindir}/ccmake${major_version}
ln -s cmake %{buildroot}%{_bindir}/cmake${major_version}
ln -s cpack %{buildroot}%{_bindir}/cpack${major_version}
ln -s ctest %{buildroot}%{_bindir}/ctest${major_version}
# Install copyright files for main package
cp -p Source/kwsys/Copyright.txt Copyright.txt_kwsys
cp -p Utilities/cmcurl/COPYING COPYING_cmcurl
cp -p Utilities/cmexpat/COPYING COPYING_cmexpat
cp -p Utilities/cmlibarchive/COPYING COPYING_cmlibarchive
cp -p Utilities/cmzlib/Copyright.txt Copyright.txt_cmzlib
cp -p Utilities/cmlibrhash/COPYING COPYING_cmlibrhash
cp -p Utilities/cmliblzma/COPYING COPYING_cmliblzma
cp -p Utilities/KWIML/Copyright.txt Copyright.txt_KWIML
cp -p Utilities/cmnghttp2/COPYING COPYING_cmnghttp2
# Install documentation
mkdir -p %{buildroot}%{_pkgdocdir}
cp -pr %{buildroot}%{_datadir}/%{name}/Help %{buildroot}%{_pkgdocdir}/rst
# Install emacs cmake mode
mkdir -p %{buildroot}%{_emacs_sitelispdir}/%{name} %{buildroot}%{_emacs_sitestartdir}
mv %{buildroot}%{_emacs_sitelispdir}/%{name}-mode.el %{buildroot}%{_emacs_sitelispdir}/%{name}
%{_emacs_bytecompile} %{buildroot}%{_emacs_sitelispdir}/%{name}/%{name}-mode.el
install -p -m 0644 %{SOURCE1} %{buildroot}%{_emacs_sitestartdir}
# RPM macros
install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.cmake
sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|${major_version}|" %{buildroot}%{rpm_macros_dir}/macros.cmake
touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.cmake
# RPM auto provides
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_rpmconfigdir}/fileattrs/cmake.attr
install -p -m0755 -D %{SOURCE4} %{buildroot}%{_rpmconfigdir}/cmake.prov
install -p -m0755 -D %{SOURCE5} %{buildroot}%{_rpmconfigdir}/cmake.req
mkdir -p %{buildroot}%{_libdir}/cmake
%if %{with gui}
# Install Desktop file
desktop-file-install --delete-original \
--dir=%{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/%{name}-gui.desktop
%endif
# Create manifests for splitting files and directories for filesystem-package
find %{buildroot}%{_datadir}/%{name} -type d | \
sed -e 's!^%{buildroot}!%%dir "!g' -e 's!$!"!g' > data_dirs.mf
find %{buildroot}%{_datadir}/%{name} -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
%if %{with test}
%check
pushd %{_vpath_builddir}
# CTestTestUpload require internet access
# CPackComponentsForAll-RPM-IgnoreGroup failing wih rpm 4.15 - https://gitlab.kitware.com/cmake/cmake/issues/19983
NO_TEST="CTestTestUpload"
# Likely failing for GCC 12
NO_TEST="$NO_TEST|CustomCommand|CMakeLib.testCTestResourceAllocator"
NO_TEST="$NO_TEST|CMakeLib.testCTestResourceSpec|RunCMake.PositionIndependentCode"
bin/ctest%{?name_suffix} %{?_smp_mflags} -V -E "$NO_TEST" --output-on-failure
## do this only periodically, not for every build -- rdieter 20210429
# Keep an eye on failing tests
#bin/ctest%{?name_suffix} %{?_smp_mflags} -V -R "$NO_TEST" --output-on-failure || :
popd
%endif
%files -f lib_files.mf
%doc %dir %{_pkgdocdir}
%license Copyright.txt*
%license COPYING*
%if %{with sphinx}
%{_mandir}/man1/c%{name}.1.*
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man1/cpack%{?name_suffix}.1.*
%{_mandir}/man1/ctest%{?name_suffix}.1.*
%{_mandir}/man7/*.7.*
%endif
%files data -f data_files.mf
%{_datadir}/aclocal/%{name}.m4
%{_datadir}/bash-completion/completions/c*
%{_emacs_sitelispdir}/%{name}
%{_emacs_sitestartdir}/%{name}-init.el
%{_datadir}/vim/vimfiles/indent/%{name}.vim
%{_datadir}/vim/vimfiles/syntax/%{name}.vim
%files doc
%license %{_datadir}/licenses/%{name}*
%doc %{_pkgdocdir}
%files filesystem -f data_dirs.mf -f lib_dirs.mf
%if %{with gui}
%files gui
%{_bindir}/%{name}-gui
%{_datadir}/applications/%{name}-gui.desktop
%{_datadir}/mime/packages
%{_datadir}/icons/hicolor/*/apps/CMake%{?name_suffix}Setup.png
%if %{with sphinx}
%{_mandir}/man1/%{name}-gui.1.*
%endif
%endif
%files rpm-macros
%{rpm_macros_dir}/macros.cmake
%if %{with rpm} && 0%{?_rpmconfigdir:1}
%{_rpmconfigdir}/fileattrs/cmake.attr
%{_rpmconfigdir}/cmake.prov
%{_rpmconfigdir}/cmake.req
%endif
%changelog
* Thu Sep 26 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.26.5-6
- Rebuilt for clarifying the packages requirement in BaseOS and AppStream
* Fri Aug 16 2024 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.26.5-5
- Rebuilt for loongarch release
* Thu May 30 2024 cunshunxia <cunshunxia@tencent.com> - 3.26.5-4
- Fix detection of versions with more than three components
* Thu Oct 12 2023 Miaojun Dong <zoedong@tencent.com> - 3.26.5-3
- Rebuild for curl-8.4.0
* Fri Sep 08 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.26.5-2
- Rebuilt for OpenCloudOS Stream 23.09
* Tue Jul 25 2023 kianli <kianli@tencent.com> - 3.26.5-1
- Upgrade to 3.26.5
* Fri Apr 28 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.22.4-3
- Rebuilt for OpenCloudOS Stream 23.05
* Fri Mar 31 2023 OpenCloudOS Release Engineering <releng@opencloudos.tech> - 3.22.4-2
- Rebuilt for OpenCloudOS Stream 23
* Wed Apr 20 2022 Zhao Zhen <jeremiazhao@tencent.com> - 3.22.4-1
- initial building
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/cmake.git
git@gitee.com:opencloudos-stream/cmake.git
opencloudos-stream
cmake
cmake
master

搜索帮助