summaryrefslogtreecommitdiff
path: root/packaging/cmake.spec
blob: 70366943e8e8ad4f1498af89edb1a70bfd3b5f54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Name:           cmake
Version:        3.9.4
Release:        0
License:        BSD-3-Clause
Summary:        Cross-platform make system
Url:            http://www.cmake.org
Group:          Platfrom Development/Tools
Source0:        http://www.cmake.org/files/v2.8/cmake-%{version}.tar.gz
Source1:        macros.cmake
Source2:        TizenCommon.cmake
Source1001:     cmake.manifest
BuildRequires:  fdupes
BuildRequires:  expat-devel
BuildRequires:  pkgconfig(libarchive) >= 2.8.0
BuildRequires:  pkgconfig(zlib)
BuildRequires:  procps
BuildRequires:  ncurses-devel
BuildRequires:  gcc-c++
# To remove /emul/usr/bin/cmake, it should be installed before cmake
%ifarch armv7l
Requires:	qemu-accel-x86_64-armv7l
%endif
%ifarch aarch64
Requires:	qemu-accel-x86_64-aarch64
%endif

%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.


%prep
%setup -q -n cmake-%{version}
cp %{SOURCE1001} .

%build
export CXXFLAGS="$RPM_OPT_FLAGS"
export CFLAGS="$CXXFLAGS"
./configure \
    --prefix=%{_prefix} \
    --datadir=/share/%{name} \
    --docdir=/share/doc/packages/%{name} \
    --mandir=/share/man \
    --system-libs \
    --parallel=0%jobs \
    --no-qt-gui \
    --no-system-curl \
    --no-system-jsoncpp \
    --no-system-librhash \
    --no-system-libuv \
    --no-system-form
%__make VERBOSE=1 %{?_smp_mflags}

%install
%make_install
mkdir -p %{buildroot}%{_libdir}/%{name}
find %{buildroot}%{_datadir}/%{name} -type f -print0 | xargs -0 chmod 644
cp %{SOURCE2} %{buildroot}%{_datadir}/%{name}/Modules

# Install cmake rpm macros
install -D -p -m 0644 %{S:1} \
  %{buildroot}%{_sysconfdir}/rpm/macros.cmake

fdupes %{buildroot}%{_datadir}/%{name}

%docs_package

%post
%ifarch armv7l aarch64
# WORKAROUND before Tizen:Base accepting Cmake 3.9
if echo `cmake --version` | grep -q "%{version}"
then
    echo "The correct version is working"
else
    echo "Probably qemu is executing previous version. Remove it."
    rm -f /emul/usr/bin/cmake
    rm -f /emul/usr/bin/ccmake
fi
%endif

%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/rpm/macros.cmake
%doc %{_datadir}/doc/packages/%{name}
%{_datadir}/aclocal/cmake.m4
%{_bindir}/ccmake
%{_bindir}/cmake
%{_bindir}/cpack
%{_bindir}/ctest
%{_datadir}/%{name}