cmake/cmake.spec
2012-06-20 11:18:07 +03:00

250 lines
6.5 KiB
RPMSpec

%define shortVersion %(echo %{version} | cut -d. -f1,2)
%bcond_with bootstrap
%define version 2.8.8
%define rel 1
%define prerel 0
%if %prerel
%define release %mkrel -c %prerel %{rel}
%define srcname %{name}-%{version}-%prerel
%else
%define release %mkrel %{rel}
%define srcname %{name}-%{version}
%endif
Name: cmake
Summary: Cross-platform, open-source make system
Version: %{version}
Release: %{release}
License: BSD
Group: Development/Other
Epoch: 1
Url: http://www.cmake.org/HTML/index.html
Source0: http://www.cmake.org/files/v%{shortVersion}/%{srcname}.tar.gz
Source1: cmake.macros
# fix ftlk detection
Patch1: cmake-fltk-path.patch
Patch2: cmake-2.8.8-xz-support.patch
BuildRequires: perl
BuildRequires: ncurses-devel
BuildRequires: libcurl-devel
BuildRequires: idn-devel
BuildRequires: zlib-devel
BuildRequires: xz
BuildRequires: expat-devel
BuildRequires: bzip2-devel
BuildRequires: libarchive-devel
%if ! %with bootstrap
BuildRequires: qt4-devel >= 4:4.4.0
%endif
BuildRequires: gcc-gfortran
Requires: rpm-mageia-setup
%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
%_mandir/man1/*
%_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
%dir %_libdir/%name
%doc CMakeLogo.gif Example
#-----------------------------------------------------------------------------
%if ! %with bootstrap
%package -n %{name}-qtgui
Summary: Qt GUI Dialog for CMake - the Cross-platform, open-source make system
Group: Development/Other
Requires: %name
%description -n %{name}-qtgui
CMake is used to control the software compilation process using
simple platform and compiler independent configuration files.
This is the Qt GUI.
%files -n %{name}-qtgui
%_bindir/cmake-gui
%_datadir/applications/CMake.desktop
%_datadir/mime/packages/cmakecache.xml
%_datadir/pixmaps/CMakeSetup32.png
%endif
#-----------------------------------------------------------------------------
%prep
%setup -q -n %{srcname}
%patch1
%patch2 -p1 -b .xz_patch
# 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
# 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 \
--prefix=%{_prefix} \
--datadir=/share/%{name} \
--mandir=/share/man \
--docdir=/share/doc/%{name} \
%if ! %with bootstrap
--qt-gui
%endif
%make
%install
%makeinstall_std -C build
# cmake mode for emacs
install -m644 Docs/cmake-mode.el -D %buildroot%_datadir/emacs/site-lisp/cmake-mode.el
install -d %buildroot%_sysconfdir/emacs/site-start.d
cat <<EOF >%buildroot%_sysconfdir/emacs/site-start.d/%{name}.el
(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
# Create/Own this dir as this is used in cmake dependant rpms but not own by any
mkdir -p %buildroot%_libdir/%name
# cmake mode for vim
install -m644 Docs/cmake-syntax.vim -D %buildroot%_datadir/vim/syntax/cmake.vim
install -m644 Docs/cmake-indent.vim -D %buildroot%_datadir/vim/indent/cmake.vim
# RPM macros
install -m644 %SOURCE1 -D %buildroot%_sysconfdir/rpm/macros.d/cmake.macros
%check
unset DISPLAY
cd build
bin/ctest -E SubDirSpaces -V %{_smp_mflags}
%changelog
* Fri Jun 08 2012 fwang <fwang> 1:2.8.8-1.mga3
+ Revision: 257642
- new version 2.8.8
* Sun Feb 26 2012 shlomif <shlomif> 1:2.8.7-5.mga2
+ Revision: 215381
- Updated cmake-2.8.4-xz patch from the Mandriva repository. Applying it again.
* Mon Jan 23 2012 dmorgan <dmorgan> 1:2.8.7-4.mga2
+ Revision: 200174
- Own %%_libdir/%%name
* Tue Jan 17 2012 mikala <mikala> 1:2.8.7-3.mga2
+ Revision: 197113
- Remove ugly patch done by me to restore boost detection (the error was in boost packaging)
* Wed Jan 04 2012 fwang <fwang> 1:2.8.7-2.mga2
+ Revision: 190635
- rebuild for new libarchive
* Sat Dec 31 2011 fwang <fwang> 1:2.8.7-1.mga2
+ Revision: 189268
- new version 2.8.7
* Sun Oct 09 2011 fwang <fwang> 1:2.8.6-1.mga2
+ Revision: 153428
- new version 2.8.6
* Wed Sep 28 2011 fwang <fwang> 1:2.8.6-0.rc4.1.mga2
+ Revision: 149962
- new version 2.8.6 rc4
* Wed Sep 14 2011 fwang <fwang> 1:2.8.6-0.rc3.2.mga2
+ Revision: 143569
- fix pthread detection
* Sat Sep 10 2011 fwang <fwang> 1:2.8.6-0.rc3.1.mga2
+ Revision: 142167
- new version 2.8.6 rc3
* Thu Sep 08 2011 mikala <mikala> 1:2.8.6-0.rc2.2.mga2
+ Revision: 140979
- Add patch3 to reverse for the moment a change regarding FindBoost.cmake module (which prevent findings boost librairies)
* Wed Sep 07 2011 dmorgan <dmorgan> 1:2.8.6-0.rc2.1.mga2
+ Revision: 140712
- Remove file moving, the files does not exist anymore
- New version 2.8.6 rc2
- New version 2.8.6-rc1
+ tv <tv>
- fix %%install
- fix file list
* Sat Jul 09 2011 ahmad <ahmad> 1:2.8.5-1.mga2
+ Revision: 120929
- Update to 2.8.5
* Thu Jul 07 2011 ahmad <ahmad> 1:2.8.5-0.rc3.1.mga2
+ Revision: 119742
- Update to 2.8.5-rc3
- Change the spec to make it easier to package rc's
+ kharec <kharec>
- just clean the top of spec by tabs, no need to increment rel.
* Tue Mar 15 2011 ahmad <ahmad> 1:2.8.4-1.mga1
+ Revision: 72094
- update to 2.8.4
* Fri Feb 11 2011 ahmad <ahmad> 1:2.8.3-4.mga1
+ Revision: 49945
- drop py27 patch, fixed upstream
- use current qt4 Epoch in the qt4-devel BR
- remove the mydocs hack, %%doc macro was fixed ages ago
* Sun Jan 16 2011 dmorgan <dmorgan> 1:2.8.3-3.mga1
+ Revision: 20018
- Rebuild with new cmake
* Fri Jan 14 2011 dmorgan <dmorgan> 1:2.8.3-2.mga1
+ Revision: 17381
- Bump release
- Rebuild cmake with qt4 support now
* Tue Jan 11 2011 dmorgan <dmorgan> 1:2.8.3-1.mga1
+ Revision: 6287
- Do not build qtgui for now
+ ahmad <ahmad>
- drop old scriptlets and conflicts
- require rpm-magei-setup
- imported package cmake