diff options
author | CoprDistGit <infra@openeuler.org> | 2025-02-03 18:32:18 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2025-02-03 18:32:18 +0000 |
commit | aef909b1372505e14db429cbc41faab40f24892c (patch) | |
tree | 9b04109e5ea4de23f892b948e815473a00682fa5 | |
parent | 5e22330e82e00d7a7ef0da6160cbfcfa89f831f6 (diff) |
automatic import of cmakeopeneuler24.03_LTS_SP1
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | cmake-3.22.0-sw.patch | 76 | ||||
-rw-r--r-- | cmake-3.27.9-fix-cxx-standard-check-issue.patch | 13 | ||||
-rw-r--r-- | cmake-findruby.patch | 22 | ||||
-rw-r--r-- | cmake-init.el | 9 | ||||
-rw-r--r-- | cmake.attr | 3 | ||||
-rw-r--r-- | cmake.prov | 82 | ||||
-rw-r--r-- | cmake.req | 70 | ||||
-rw-r--r-- | cmake.spec | 395 | ||||
-rw-r--r-- | macros.cmake.in | 74 | ||||
-rw-r--r-- | sources | 1 |
11 files changed, 746 insertions, 0 deletions
@@ -0,0 +1 @@ +/cmake-3.27.9.tar.gz diff --git a/cmake-3.22.0-sw.patch b/cmake-3.22.0-sw.patch new file mode 100755 index 0000000..b2e7a2c --- /dev/null +++ b/cmake-3.22.0-sw.patch @@ -0,0 +1,76 @@ +diff -Naur cmake-3.22.0.org/Modules/FindJNI.cmake cmake-3.22.0.sw/Modules/FindJNI.cmake +--- cmake-3.22.0.org/Modules/FindJNI.cmake 2022-02-25 01:21:55.530000000 +0000 ++++ cmake-3.22.0.sw/Modules/FindJNI.cmake 2022-02-25 01:30:19.530000000 +0000 +@@ -150,6 +150,8 @@ + set(_java_libarch "i386") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64") + set(_java_libarch "arm64" "aarch64") ++ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sw_64") ++ set(_java_libarch "sw_64") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^alpha") + set(_java_libarch "alpha") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm") +@@ -509,6 +511,7 @@ + ${JAVA_INCLUDE_PATH}/solaris + ${JAVA_INCLUDE_PATH}/hp-ux + ${JAVA_INCLUDE_PATH}/alpha ++ ${JAVA_INCLUDE_PATH}/sw_64 + ${JAVA_INCLUDE_PATH}/aix + DOC "jni_md.h jniport.h include directory" + ) + +diff -Naur cmake-3.22.0.org/Modules/GNUInstallDirs.cmake cmake-3.22.0.sw/Modules/GNUInstallDirs.cmake +--- cmake-3.22.0.org/Modules/GNUInstallDirs.cmake 2022-02-25 01:21:55.550000000 +0000 ++++ cmake-3.22.0.sw/Modules/GNUInstallDirs.cmake 2022-02-25 01:32:38.270000000 +0000 +@@ -286,9 +286,9 @@ + elseif(NOT DEFINED __system_type_for_install) + # not debian, alpine, arch, or conda so rely on CMAKE_SIZEOF_VOID_P: + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") +- set(_LIBDIR_DEFAULT "lib64") ++ set(_LIBDIR_DEFAULT "lib") + if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX) +- set(__LAST_LIBDIR_DEFAULT "lib64") ++ set(__LAST_LIBDIR_DEFAULT "lib") + endif() + endif() + endif() +diff -Naur cmake-3.22.0.org/Utilities/KWIML/include/kwiml/abi.h cmake-3.22.0.sw/Utilities/KWIML/include/kwiml/abi.h +--- cmake-3.22.0.org/Utilities/KWIML/include/kwiml/abi.h 2022-02-25 01:21:57.660000000 +0000 ++++ cmake-3.22.0.sw/Utilities/KWIML/include/kwiml/abi.h 2022-02-25 01:25:45.020000000 +0000 +@@ -363,6 +363,10 @@ + #elif defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) + # define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE + ++/* Sw_64 */ ++#elif defined(__sw_64) || defined(__sw_64__) || defined(_M_SW_64) ++# define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE ++ + /* Alpha */ + #elif defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA) + # define KWIML_ABI_ENDIAN_ID KWIML_ABI_ENDIAN_ID_LITTLE +diff -Naur cmake-3.22.0.org/Utilities/cmlibrhash/librhash/byte_order.h cmake-3.22.0.sw/Utilities/cmlibrhash/librhash/byte_order.h +--- cmake-3.22.0.org/Utilities/cmlibrhash/librhash/byte_order.h 2022-02-25 01:21:57.810000000 +0000 ++++ cmake-3.22.0.sw/Utilities/cmlibrhash/librhash/byte_order.h 2022-02-25 01:26:26.980000000 +0000 +@@ -75,7 +75,7 @@ + /* try detecting endianness by CPU */ + #ifdef RHASH_BYTE_ORDER + #elif defined(CPU_IA32) || defined(CPU_X64) || defined(__ia64) || defined(__ia64__) || \ +- defined(__alpha__) || defined(_M_ALPHA) || defined(vax) || defined(MIPSEL) || \ ++ defined(__alpha__) || defined(_M_ALPHA) || defined(__sw_64__) || defined(_M_SW_64) || defined(vax) || defined(MIPSEL) || \ + defined(_ARM_) || defined(__arm__) + # define RHASH_BYTE_ORDER RHASH_BYTE_ORDER_LE + #elif defined(__sparc) || defined(__sparc__) || defined(sparc) || \ +diff -Naur cmake-3.22.0.org/Utilities/cmlibuv/src/win/util.c cmake-3.22.0.sw/Utilities/cmlibuv/src/win/util.c +--- cmake-3.22.0.org/Utilities/cmlibuv/src/win/util.c 2022-02-25 01:21:57.830000000 +0000 ++++ cmake-3.22.0.sw/Utilities/cmlibuv/src/win/util.c 2022-02-25 01:33:21.970000000 +0000 +@@ -1849,6 +1849,10 @@ + case PROCESSOR_ARCHITECTURE_MIPS: + uv__strscpy(buffer->machine, "mips", sizeof(buffer->machine)); + break; ++ case PROCESSOR_ARCHITECTURE_SW_64: ++ case PROCESSOR_ARCHITECTURE_SW_6464: ++ uv__strscpy(buffer->machine, "sw_64", sizeof(buffer->machine)); ++ break; + case PROCESSOR_ARCHITECTURE_ALPHA: + case PROCESSOR_ARCHITECTURE_ALPHA64: + uv__strscpy(buffer->machine, "alpha", sizeof(buffer->machine)); diff --git a/cmake-3.27.9-fix-cxx-standard-check-issue.patch b/cmake-3.27.9-fix-cxx-standard-check-issue.patch new file mode 100644 index 0000000..af9e6a6 --- /dev/null +++ b/cmake-3.27.9-fix-cxx-standard-check-issue.patch @@ -0,0 +1,13 @@ +diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake +index 02627464..4f6ccdaf 100644 +--- a/Source/Checks/cm_cxx_features.cmake ++++ b/Source/Checks/cm_cxx_features.cmake +@@ -44,6 +44,8 @@ function(cm_check_cxx_feature name) + string(REGEX REPLACE "[^\n]*warning D[0-9][0-9][0-9][0-9][^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by user flags. + string(REGEX REPLACE "[^\n]*warning:[^\n]*-Winvalid-command-line-argument[^\n]*" "" check_output "${check_output}") ++ # Filter out clang output warnings ++ string(REGEX REPLACE "[^\n]*warning:[^\n]*-Wunused-command-line-argument[^\n]*" "" check_output "${check_output}") + # Filter out warnings caused by local configuration. + string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}") + string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}") diff --git a/cmake-findruby.patch b/cmake-findruby.patch new file mode 100644 index 0000000..72a8b25 --- /dev/null +++ b/cmake-findruby.patch @@ -0,0 +1,22 @@ +Index: cmake-3.23.0-rc2/Modules/FindRuby.cmake +=================================================================== +--- cmake-3.23.0-rc2.orig/Modules/FindRuby.cmake ++++ cmake-3.23.0-rc2/Modules/FindRuby.cmake +@@ -315,14 +315,9 @@ if(Ruby_EXECUTABLE AND NOT Ruby_VERSION_ + _RUBY_CONFIG_VAR("sitearchdir" Ruby_SITEARCH_DIR) + _RUBY_CONFIG_VAR("sitelibdir" Ruby_SITELIB_DIR) + +- # vendor_ruby available ? +- execute_process(COMMAND ${Ruby_EXECUTABLE} -r vendor-specific -e "print 'true'" +- OUTPUT_VARIABLE Ruby_HAS_VENDOR_RUBY ERROR_QUIET) +- +- if(Ruby_HAS_VENDOR_RUBY) +- _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) +- _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) +- endif() ++ # vendor_ruby ++ _RUBY_CONFIG_VAR("vendorlibdir" Ruby_VENDORLIB_DIR) ++ _RUBY_CONFIG_VAR("vendorarchdir" Ruby_VENDORARCH_DIR) + + # save the results in the cache so we don't have to run ruby the next time again + set(Ruby_VERSION_MAJOR ${Ruby_VERSION_MAJOR} CACHE PATH "The Ruby major version" FORCE) diff --git a/cmake-init.el b/cmake-init.el new file mode 100644 index 0000000..a5e0e2e --- /dev/null +++ b/cmake-init.el @@ -0,0 +1,9 @@ +;; +;; Setup cmake-mode for autoloading +;; +(autoload 'cmake-mode "cmake-mode" "Major mode for editing CMake listfiles." t) +(setq auto-mode-alist + (append + '(("CMakeLists\\.txt\\'" . cmake-mode)) + '(("\\.cmake\\'" . cmake-mode)) + auto-mode-alist)) diff --git a/cmake.attr b/cmake.attr new file mode 100644 index 0000000..83f3f1a --- /dev/null +++ b/cmake.attr @@ -0,0 +1,3 @@ +%__cmake_provides %{_rpmconfigdir}/cmake.prov +%__cmake_requires %{_rpmconfigdir}/cmake.req +%__cmake_path ^(%{_libdir}|%{_datadir})/cmake/.*/.*(Config\.cmake|-config\.cmake)$ diff --git a/cmake.prov b/cmake.prov new file mode 100644 index 0000000..58d3522 --- /dev/null +++ b/cmake.prov @@ -0,0 +1,82 @@ +#!/usr/bin/python3 +# -*- coding:utf-8 -*- +# +# Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com> +# Copyright (C) 2017 Daniel Vrátil <dvratil@fedoraproject.org> +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +import sys +import re +import glob + +class CMakeParser: + def __init__(self, filelist = None): + if filelist == None: + filelist = sys.stdin + + paths = map(lambda x: x.rstrip(), filelist.readlines()) + for path in paths: + modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path) + if modulePath and cmakeModule: + version = self.resolveCMakeModuleVersion(modulePath, cmakeModule, lowercase) + + if version: + string = "cmake(" + cmakeModule + ") = " + version + else: + string = "cmake(" + cmakeModule + ")" + if string == string.lower(): + print(string) + else: + # Temporarily print both variants to satisfy requires + # by the old version of this generator which made mistakes + print(string) + print(string.lower()) + + + def parseCmakeModuleConfig(self, configFile): + paths = configFile.rsplit("/", 3) + + modulePath = "%s/cmake/%s" % (paths[0], paths[2]) + cfgFile = paths[3] + if cfgFile.endswith("Config.cmake"): + return (modulePath, cfgFile[0:-len("Config.cmake")], False) + elif cfgFile.endswith("-config.cmake"): + return (modulePath, cfgFile[0:-len("-config.cmake")], True) + else: + return (None, None, False) + + def resolveCMakeModuleVersion(self, modulePath, cmakeModule, lowercase): + versionFile = ("%s/%s-config-version.cmake" if lowercase else "%s/%sConfigVersion.cmake") % (modulePath, cmakeModule) + try: + f = open(versionFile, 'r') + except: + return None + + for line in f: + line = line.strip() + + # set(PACKAGE_VERSION <version>) + version = re.match(r"^set[\ ]*\([\ ]*PACKAGE_VERSION[\ ]+[\"]*([0-9\.]+)[\"]*[\ ]*[.]*\)", line) + if version: + return version.groups(1)[0] + + return None + +if __name__ == "__main__": + parser = CMakeParser() diff --git a/cmake.req b/cmake.req new file mode 100644 index 0000000..9af5c44 --- /dev/null +++ b/cmake.req @@ -0,0 +1,70 @@ +#!/usr/bin/python3 +# -*- coding:utf-8 -*- +# +# Copyright (C) 2017 Björn Esser <besser82@fedoraproject.org> +# +# based on cmake.prov, which is +# Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com> +# Copyright (C) 2017 Daniel Vrátil <dvratil@fedoraproject.org> +# +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +import sys +import re +import subprocess + +class CMakeParser: + def __init__(self, filelist = None): + if filelist == None: + filelist = sys.stdin + + has_module = False + is_arched = False + + isa_suf = subprocess.check_output(["/usr/bin/rpm", "-E %{?_isa}"]).decode().strip() + + paths = map(lambda x: x.rstrip(), filelist.readlines()) + for path in paths: + modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path) + if modulePath and cmakeModule: + has_module = True + if re.match(".*/usr/lib(64)?/cmake/.*", modulePath): + is_arched = True + + if has_module: + if is_arched: + print("cmake-filesystem%s" % isa_suf) + else: + print("cmake-filesystem") + + + def parseCmakeModuleConfig(self, configFile): + paths = configFile.rsplit("/", 3) + + modulePath = "%s/cmake/%s" % (paths[0], paths[2]) + cfgFile = paths[3] + if cfgFile.endswith("Config.cmake"): + return (modulePath, cfgFile[0:-len("Config.cmake")], False) + elif cfgFile.endswith("-config.cmake"): + return (modulePath, cfgFile[0:-len("-config.cmake")], True) + else: + return (None, None, False) + + +if __name__ == "__main__": + parser = CMakeParser() diff --git a/cmake.spec b/cmake.spec new file mode 100644 index 0000000..4c1cb27 --- /dev/null +++ b/cmake.spec @@ -0,0 +1,395 @@ +%define debug_package %{nil} +%bcond_without ncurses +%bcond_without X11_test + +%bcond_without cmake_gui +%bcond_without emacs +%bcond_with bootstrap +%bcond_without sphinx + +# 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: 10 +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 +Patch1: cmake-3.27.9-fix-cxx-standard-check-issue.patch +Patch2: cmake-3.22.0-sw.patch + +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 +%setup -n cmake-%{version}%{?versuf} +%patch 0 -p1 +%patch 1 -p1 +%ifarch sw_64 +%patch 2 -p1 +%endif + +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 +* Sun Jan 26 2025 fuanan <fuanan3@h-partners.com> - 3.27.9-10 +- No longer support aarch64_ilp32 compilation + +* Thu Jan 23 2025 Funda Wang <fundawang@yeah.net> - 3.27.9-9 +- default to out-of-source build + +* Thu Jan 23 2025 fuanan <fuanan3@h-partners.com> - 3.27.9-8 +- remove the architecture judgment in the patches section; +- include all patches in the source package. + +* Tue Nov 05 2024 Funda Wang <fundawang@yeah.net> - 3.27.9-7 +- change __cmake_builddir definition based on numeric comparision +- force define source and binary directory + +* Mon Sep 02 2024 Funda Wang <fundawang@yeah.net> - 3.27.9-6 +- make use of _vpath_builddir, but default to in source build for backward compatibility +- enable check section + +* Thu Aug 22 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.27.9-5 +- Support %cmake_build and %cmake_install. + +* Wed Jul 10 2024 fuanan <fuanan3@h-partners.com> - 3.27.9-4 +- Add compilation options for i686. +- Support arrch64-ilp32 compilation. + +* Fri Apr 5 2024 tiberium <jinzhe.oerv@isrc.iscas.ac.cn> 3.27.9-3 +- fix cmake compile issue due to cxx standard check failed + +* Fri Feb 2 2024 liyanan <liyanan61@h-partners.com> - 3.27.9-2 +- Remove Windows_TemporaryKey.pfx + +* Fri Jan 5 2024 liyanan <liyanan61@h-partners.com> - 3.27.9-1 +- Update to 3.27.9 + +* Thu Dec 14 2023 liyanan <liyanan61@h-partners.com> - 3.24.3-2 +- Fix abnormal empty link in cmake-data package + +* Mon Nov 14 2022 jchzhou <zhoujiacheng@iscas.ac.cn> - 3.24.3-1 +- Update to 3.24.3 + +* Wed Oct 19 2022 wuzx<wuzx1226@qq.com> - 3.22.0-3 +- add sw64 patch + +* Wed Mar 2 2022 wangchen <wangchen137@h-partners.com> - 3.22.0-2 +- Remove rhash-devel from BuildRequires + +* Sat Feb 12 2022 wangchen <wangchen137@h-partners.com> - 3.22.0-1 +- Update to 3.22.0 + +* Tue Jul 20 2021 wangchen <wangchen137@huawei.com> - 3.19.2-3 +- Delete unnecessary gdb from BuildRequires + +* Mon Mar 22 2021 lirui <lirui130@huawei.com> - 3.19.2-2 +- Remove the -g option and the debug package +- add the -s option + +* Mon Jan 25 2021 wangchen <wangchen137@huawei.com> - 3.19.2-1 +- Update to 3.19.2 + +* Sat Aug 29 2020 wangchen <wangchen137@huawei.com> - 3.18.0-3 +- Revert macros.cmake + +* Tue Aug 25 2020 wangchen <wangchen137@huawei.com> - 3.18.0-2 +- Modify macros.cmake + +* Thu Jul 30 2020 wangchen <wangchen137@huawei.com> - 3.18.0-1 +- Update to cmake-3.18.0 + +* Mon May 25 2020 licihua <licihua@huawei.com> - 3.17.2-1 +- Update to cmake-3.17.2 + +* Fri Apr 03 2020 zhouyihang <zhouyihang1@huawei.com> - 3.12.1-6 +- Remove useless scriptlet + +* Mon Mar 23 2020 Xiangyang Yu <yuxiangyang4@huawei.com> -3.12.1-5 +- add BuildRequires:gdb to fix src.rpm build error + +* Thu Feb 20 2020 lijin Yang <yanglijin@huawei.com> -3.12.1-4 +- make sphinx-build enable + +* Wed Jan 22 2020 Yiru Wang <wangyiru1@huawei.com> - 3.12.1-3 +- Disable test + +* Fri Nov 29 2019 lijin Yang <yanglijin@huawei.com> - 3.12.1-2 +- init package diff --git a/macros.cmake.in b/macros.cmake.in new file mode 100644 index 0000000..24e3806 --- /dev/null +++ b/macros.cmake.in @@ -0,0 +1,74 @@ +# +# Macros for cmake +# + +%_cmake_lib_suffix64 -DLIB_SUFFIX=64 +%_cmake_shared_libs -DBUILD_SHARED_LIBS:BOOL=ON +%_cmake_skip_rpath -DCMAKE_SKIP_RPATH:BOOL=ON +%_cmake_version @@CMAKE_VERSION@@ +%__cmake /usr/bin/cmake +%__ctest /usr/bin/ctest +%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.} +%_cmake_module_linker_flags %(echo %build_ldflags|sed -e 's#-Wl,--no-undefined##') + +# - Set default compile flags +# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables +# and default to -O3 -DNDEBUG. Strip the -O3 so we can override with *FLAGS +# - Turn on verbose makefiles so we can see and verify compile flags +# - Turn off stripping by default so RPM can do it separately +# - Set default install prefixes and library install directories +# - Turn on shared libraries by default +%cmake \ + %{set_build_flags} \ + %__cmake \\\ + -S "%{_vpath_srcdir}" \\\ + -B "%{__cmake_builddir}" \\\ + -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ + -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \\\ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ + -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DCMAKE_INSTALL_RUNSTATEDIR:PATH=%{_rundir} \\\ + -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ +%if "%{?_lib}" == "lib64" \ + %{?_cmake_lib_suffix64} \\\ +%endif \ + %{?_cmake_shared_libs} \\\ + %{?_cmake_module_linker_flags:-DCMAKE_MODULE_LINKER_FLAGS="%_cmake_module_linker_flags%{?_cmake_module_linker_flags_extra: %_cmake_module_linker_flags_extra}"} \\\ + %{nil} + +%cmake_conf %cmake + +%cmake_build \ + %__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose + +%cmake_install \ + DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}" + +%ctest(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) \ + %__ctest --test-dir "%{__cmake_builddir}" \\\ + --output-on-failure \\\ + --force-new-ctest-process \\\ +%ifarch riscv64 \ + --timeout 6000 \\\ +%endif \ + %{?_smp_mflags} %{**} + + +%cmake@@CMAKE_MAJOR_VERSION@@ %cmake +%cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build +%cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install +%ctest@@CMAKE_MAJOR_VERSION@@(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) \ + %ctest %{**} + +# Declarative buildsystem, requires RPM 4.20+ to work +# https://rpm-software-management.github.io/rpm/manual/buildsystem.html +%buildsystem_cmake_generate_buildrequires() %{nil} +%buildsystem_cmake_conf() %cmake %* +%buildsystem_cmake_build() %cmake_build %* +%buildsystem_cmake_install() %cmake_install %* +%buildsystem_cmake_check(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) %ctest %{**} @@ -0,0 +1 @@ +d8c5c2a764229f61a4ed1e06498a6031 cmake-3.27.9.tar.gz |