Projects
Mega:24.03:SP1:Everything
cmake
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
_service:tar_scm:cmake.spec
Changed
@@ -14,6 +14,11 @@ %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}} @@ -22,13 +27,14 @@ Name: cmake Version: 3.27.9 -Release: 5 +%global major_version %(echo %{version} | awk -F. '{print $1}') +Release: 7 Summary: Cross-platform make system -License: BSD and MIT and zlib +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 +Source2: macros.cmake.in Source3: cmake.attr Source4: cmake.prov Source5: cmake.req @@ -144,8 +150,8 @@ 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 build -pushd build +mkdir %{_vpath_builddir} +pushd %{_vpath_builddir} ../bootstrap --prefix=%{_prefix} --datadir=/share/cmake \ --docdir=/share/doc/cmake --mandir=/share/man \ --%{?with_bootstrap:no-}system-libs \ @@ -163,11 +169,13 @@ %endif %endif ; -%make_build VERBOSE=1 +popd + +%make_build -C %{_vpath_builddir} %install install -d %{buildroot}%{_pkgdocdir} -%make_install -C build CMAKE_DOC_DIR=%{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 @@ -184,10 +192,10 @@ rm -f %{buildroot}%{_emacs_sitelispdir} %endif -install -p -m0644 -D %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.cmake -sed -i -e "s|@@CMAKE_VERSION@@|%{version}|" -e "s|@@CMAKE_MAJOR_VERSION@@|3|" %{buildroot}%{rpm_macros_dir}/macros.cmake -touch -r %{SOURCE2} %{buildroot}%{rpm_macros_dir}/macros.cmake -install -p -m0644 -D %{SOURCE3} %{buildroot}%{_prefix}/lib/rpm/fileattrs/cmake.attr +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 @@ -223,9 +231,18 @@ sed -e '/.*-gui$/d' -e '/^$/d' -e 's!^%{buildroot}!"!g' -e 's!$!"!g' >> lib_files.mf %check -#cd build -#export NO_TEST="CMake.FileDownload|CTestTestUpload|curl|RunCMake.CPack_RPM" -#bin/ctest -V -E "$NO_TEST" %{?_smp_mflags} +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 @@ -299,6 +316,14 @@ %exclude %{_pkgdocdir}/Copyright.txt %changelog +* 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.
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/cmake.git</param> - <param name="revision">openEuler-24.03-LTS-SP1</param> + <param name="revision">ba9215e51b336c56cd706fbe82899476e46282d3</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
View file
_service:tar_scm:macros.cmake
Deleted
@@ -1,83 +0,0 @@ -# -# Macros for cmake -# -%_cmake_lib_suffix64 -DLIB_SUFFIX=64 -%_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:.} - -# - 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 -# - Set default install prefixes and library install directories -# - Turn on shared libraries by default -%cmake \ - 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 ;} \ - %__cmake \\\ - -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_PREFIX:PATH=%{_prefix} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ -%if "%{?_lib}" == "lib64" \ - %{?_cmake_lib_suffix64} \\\ -%endif \ -%if "%{?_lib}" == "libilp32" \ - -DLIB_SUFFIX=ilp32 \\\ -%endif \ - -DBUILD_SHARED_LIBS:BOOL=ON - -# cmake for cmake_build and cmake_install -%cmake_conf \ - 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 ;} \ - %__cmake \\\ - %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\ - %{!?__cmake_in_source_build:-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_PREFIX:PATH=%{_prefix} \\\ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ - -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ -%if "%{?_lib}" == "lib64" \ - %{?_cmake_lib_suffix64} \\\ -%endif \ -%if "%{?_lib}" == "libilp32" \ - -DLIB_SUFFIX=ilp32 \\\ -%endif \ - -DBUILD_SHARED_LIBS:BOOL=ON - -%cmake_build \ - %__cmake --build "%{__cmake_builddir}" %{?_smp_mflags} --verbose - -%cmake_install \ - DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}" - -%ctest(:-:) \ -cd "%{__cmake_builddir}" \ -%__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \ -cd - - -%cmake@@CMAKE_MAJOR_VERSION@@ %cmake -%cmake@@CMAKE_MAJOR_VERSION@@_conf %cmake_conf -%cmake@@CMAKE_MAJOR_VERSION@@_build %cmake_build -%cmake@@CMAKE_MAJOR_VERSION@@_install %cmake_install -%ctest@@CMAKE_MAJOR_VERSION@@(:-:) %ctest %{**}
View file
_service:tar_scm:macros.cmake.in
Added
@@ -0,0 +1,90 @@ +# +# Macros for cmake +# + +%__cmake_in_source_build 1 + +%_cmake_lib_suffix64 -DLIB_SUFFIX=64 +%_cmake_lib_suffixilp32 -DLIB_SUFFIX=ilp32 +%_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 %{lua: + if rpm.expand('%{__cmake_in_source_build}') == '%{__cmake_in_source_build}' then + print(rpm.expand('%{_vpath_builddir}')) + else + if rpm.expand('%{__cmake_in_source_build}') == '0' then + print(rpm.expand('%{_vpath_builddir}')) + else + print(".") + end + end +} +%_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 \ +%if "%{?_lib}" == "libilp32" \ + %{?_cmake_lib_suffixilp32} \\\ +%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 %{**}
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2