cmake/cmake.spec

160 lines
4.7 KiB
RPMSpec
Raw Permalink Normal View History

2012-02-01 14:59:39 +04:00
%define shortVersion %(echo %{version} | cut -d. -f1,2)
2023-11-07 19:41:47 +00:00
%bcond_without bootstrap
2012-02-01 14:59:39 +04:00
Summary: Cross-platform, open-source make system
2013-08-15 22:35:28 +11:00
Name: cmake
2025-02-03 10:06:16 +00:00
Version: 3.27.9
2020-04-25 16:22:06 +03:00
Release: 1
Epoch: 1
License: BSD
Group: Development/Other
2025-02-03 10:06:16 +00:00
URL: https://cmake.org
Source0: %{url}/files/v%{shortVersion}/%{name}-%{version}.tar.gz
2020-04-25 16:22:06 +03:00
Source1000: %{name}.rpmlintrc
Source1: cmake.macros
Patch0: cmake-3.7.2-optflags.patch
2016-08-26 19:55:42 +10:00
Patch1: cmake-3.6.1-fltk133.patch
Patch2: 0003-Disable-Test198.patch
2014-07-09 17:34:46 +11:00
BuildRequires: gcc-gfortran
BuildRequires: bzip2-devel
2025-02-09 23:29:36 +03:00
BuildRequires: %{_lib}cppdap-devel
BuildRequires: emacs
2014-07-09 17:34:46 +11:00
BuildRequires: pkgconfig(expat)
2013-08-15 22:35:28 +11:00
BuildRequires: pkgconfig(libarchive)
2014-07-09 17:34:46 +11:00
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libidn)
2020-04-25 16:22:06 +03:00
BuildRequires: pkgconfig(libuv) >= 1.0.0
2014-07-09 17:34:46 +11:00
BuildRequires: pkgconfig(ncurses)
2025-02-09 20:17:19 +00:00
BuildRequires: pkgconfig(jsoncpp)
2025-02-10 02:40:51 +03:00
BuildRequires: pkgconfig(nlohmann_json)
2013-08-15 22:35:28 +11:00
%if !%{with bootstrap}
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
2012-02-01 14:59:39 +04:00
%endif
2014-07-09 17:34:46 +11:00
BuildRequires: pkgconfig(zlib)
2020-04-25 16:22:06 +03:00
BuildRequires: %{_lib}rhash-devel
2012-02-01 14:59:39 +04:00
%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, pre-processor generation, code
generation, and template instantiation.
%files
%{_bindir}/cmake
%{_bindir}/ccmake
%{_bindir}/ctest
%{_bindir}/cpack
%{_datadir}/%{name}
%{_sysconfdir}/emacs/site-start.d/%{name}.el
%{_sysconfdir}/rpm/macros.d/*
%{_datadir}/emacs/site-lisp/cmake-mode.el
%{_datadir}/vim/*/*
%{_datadir}/aclocal/cmake.m4
%{_datadir}/bash-completion/completions/cmake
%{_datadir}/bash-completion/completions/cpack
%{_datadir}/bash-completion/completions/ctest
2014-06-11 00:24:49 +11:00
%doc CMakeLogo.gif mydocs/*
2012-02-01 14:59:39 +04:00
#-----------------------------------------------------------------------------
2013-08-15 22:35:28 +11:00
%if !%{with bootstrap}
2014-07-09 17:34:46 +11:00
%package -n %{name}-qtgui
Summary: Qt GUI Dialog for CMake - the Cross-platform, open-source make system
Group: Development/Other
Requires: %{name}
2012-02-01 14:59:39 +04:00
2014-07-09 17:34:46 +11:00
%description -n %{name}-qtgui
2012-02-01 14:59:39 +04:00
CMake is used to control the software compilation process using
simple platform and compiler independent configuration files.
This is the Qt GUI.
2014-07-09 17:34:46 +11:00
%files -n %{name}-qtgui
%{_bindir}/cmake-gui
2020-04-25 16:22:06 +03:00
%{_datadir}/applications/cmake-gui.desktop
%{_datadir}/mime/packages/cmakecache.xml
2015-12-24 18:10:37 +10:00
%{_iconsdir}/hicolor/*/apps/CMakeSetup.*
2012-02-01 14:59:39 +04:00
%endif
#-----------------------------------------------------------------------------
%prep
2012-02-01 18:12:18 +04:00
%setup -q
2020-04-25 16:22:06 +03:00
#apply_patches
2012-02-01 14:59:39 +04:00
# Don't try to automagically find files in /usr/X11R6
# But also don't change a prefix if it is not /usr
perl -pi -e 's@^\s+/usr/X11R6/.*\n@@' Modules/*.cmake
%ifarch %{arm}
2012-02-01 14:59:39 +04:00
# bootstrap test is taking ages on arm
sed -i -e 's!SET(CMAKE_LONG_TEST_TIMEOUT 1500)!SET(CMAKE_LONG_TEST_TIMEOUT 7200)!g' Tests/CMakeLists.txt
%endif
%build
mkdir -p build
cd build
%setup_compile_flags
../configure \
--system-libs \
--parallel=%{_smp_mflags} \
2012-02-01 14:59:39 +04:00
--prefix=%{_prefix} \
--datadir=/share/%{name} \
--mandir=/share/man \
--docdir=/share/doc/%{name} \
2013-08-15 22:35:28 +11:00
%if !%{with bootstrap}
2012-02-01 14:59:39 +04:00
--qt-gui
%endif
%make
%install
2012-09-04 23:58:53 +00:00
%makeinstall_std -C build
2012-02-01 14:59:39 +04:00
# cmake mode for emacs
2014-06-11 00:24:49 +11:00
mkdir -p %{buildroot}%{_datadir}/emacs/site-lisp %{buildroot}%{_sysconfdir}/emacs/site-start.d
#mv %{buildroot}%{_datadir}/cmake/editors/emacs/cmake-mode.el %{buildroot}%{_datadir}/emacs/site-lisp/cmake-mode.el
cat <<EOF >%{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el
2012-02-01 14:59:39 +04:00
(setq load-path (cons (expand-file-name "/dir/with/cmake-mode") load-path))
(require 'cmake-mode)
(setq auto-mode-alist
(append '(("CMakeLists\\\\.txt\\\\'" . cmake-mode)
("\\\\.cmake\\\\'" . cmake-mode))
auto-mode-alist))
EOF
# cmake mode for vim
install -D -p -m644 Auxiliary/vim/syntax/cmake.vim %{buildroot}%{_datadir}/vim/syntax/cmake.vim
install -D -p -m644 Auxiliary/vim/indent/cmake.vim %{buildroot}%{_datadir}/vim/indent/cmake.vim
2014-06-11 00:24:49 +11:00
# remove directory we just cleared by moving files where editors
# will actually find them
rm -rf %{buildroot}%{_datadir}/cmake/editors
2012-02-01 14:59:39 +04:00
# RPM macros
install -m644 %{SOURCE1} -D %{buildroot}%{_sysconfdir}/rpm/macros.d/cmake.macros
2012-02-01 14:59:39 +04:00
# %doc wipes out files in doc dir, fixed in cooker svn for rpm package, though
# not submitted yet, so we'll just work around this by moving it for now..
rm -rf mydocs
mv %{buildroot}%{_datadir}/doc/%{name} mydocs
2012-02-01 14:59:39 +04:00
2013-08-15 22:35:28 +11:00
# As of 2.8.10.2, the test suite needs net access.
# Absent that, it will fail:
# The following tests FAILED:
# 186 - CTestTestFailedSubmit-http (Failed)
# 187 - CTestTestFailedSubmit-https (Failed)
%if 0
2012-02-01 14:59:39 +04:00
%check
unset DISPLAY
cd build
2013-08-15 22:35:28 +11:00
bin/ctest -E SubDirSpaces -V %{_smp_mflags}
%endif