cmake/cmake.spec

152 lines
4.7 KiB
RPMSpec
Raw Normal View History

2012-02-01 14:59:39 +04:00
%define shortVersion %(echo %{version} | cut -d. -f1,2)
2013-08-15 22:35:28 +11:00
%bcond_with 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
2015-02-02 18:36:53 +10:00
Version: 3.0.2
2015-02-22 18:12:32 +04:00
Release: 2
Epoch: 1
License: BSD
Group: Development/Other
Url: http://www.cmake.org/HTML/index.html
Source0: http://www.cmake.org/files/v%{shortVersion}/%{name}-%{version}.tar.gz
Source1: cmake.macros
2014-07-09 17:34:46 +11:00
Patch0: cmake-3.0.0-optflags.patch
2012-02-01 14:59:39 +04:00
# fix ftlk detection
2013-08-15 22:35:28 +11:00
Patch1: 0001-Fix-FLTK-Find-path.patch
Patch3: 0003-Disable-Test198.patch
# Fix ImageMagick detection (not upstream yet; parts 1 and 2 are)
Patch6: 0003-FindImageMagick-part3.patch
2014-07-09 17:34:46 +11:00
BuildRequires: gcc-gfortran
BuildRequires: bzip2-devel
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)
BuildRequires: pkgconfig(ncurses)
2013-08-15 22:35:28 +11:00
%if !%{with bootstrap}
BuildRequires: pkgconfig(QtCore)
2012-02-01 14:59:39 +04:00
%endif
2014-07-09 17:34:46 +11:00
BuildRequires: pkgconfig(zlib)
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
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
%{_datadir}/applications/CMake.desktop
%{_datadir}/mime/packages/cmakecache.xml
%{_datadir}/pixmaps/CMakeSetup32.png
2012-02-01 14:59:39 +04:00
%endif
#-----------------------------------------------------------------------------
%prep
2012-02-01 18:12:18 +04:00
%setup -q
2013-08-15 22:35:28 +11: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
2014-06-11 00:24:49 +11:00
mkdir -p %{buildroot}%{_datadir}/vim/syntax %{buildroot}%{_datadir}/vim/indent %{buildroot}%{_datadir}/vim/plugin
mv %{buildroot}%{_datadir}/cmake/editors/vim/cmake-syntax.vim %{buildroot}%{_datadir}/vim/syntax/cmake.vim
mv %{buildroot}%{_datadir}/cmake/editors/vim/cmake-indent.vim %{buildroot}%{_datadir}/vim/indent/cmake.vim
mv %{buildroot}%{_datadir}/cmake/editors/vim/cmake-help.vim %{buildroot}%{_datadir}/vim/plugin/cmake-help.vim
# 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