summaryrefslogtreecommitdiff
path: root/packaging/cmake.spec
blob: 821b9b08cca069a985268dc20d42456db4e11042 (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
96
97
98
99
100
101
102
103
104
105
106
Name:           cmake
Version:        3.16.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/v3.16/cmake-%{version}.tar.gz
Source1:        macros.cmake
Source2:        TizenCommon.cmake
Source1001:     cmake.manifest
Source3:        cmake.attr
Source4:        cmake.prov

BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  ncurses-devel
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(openssl1.1)
BuildRequires:  pkgconfig(liblzma)
BuildRequires:  pkgconfig(libarchive) >= 3.3.3
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  procps

%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 -D_FILE_OFFSET_BITS=64"
export CFLAGS="$CXXFLAGS"
export LDFLAGS="-ltinfo"
./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-libarchive \
    --no-system-zstd \
    --no-system-libuv
%__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
# RPM auto provides
install -p -m0644 -D %{SOURCE3} %{buildroot}%{_libexecdir}/rpm/fileattrs/cmake.attr
install -p -m0755 -D %{SOURCE4} %{buildroot}%{_libexecdir}/rpm/cmake.prov


# Install bash completion symlinks
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
for f in %{buildroot}%{_datadir}/cmake/completions/*
do
  ln -s ../../cmake/completions/$(basename $f) %{buildroot}%{_datadir}/bash-completion/completions
done

# cmake-mode.el
%define cmake_mode_el %{_datadir}/emacs/site-lisp/cmake-mode.el
install -D -p -m 0644 Auxiliary/cmake-mode.el %{buildroot}%cmake_mode_el
rm %{buildroot}%{_datadir}/cmake/editors/emacs/cmake-mode.el
# fix: W: files-duplicate  (%%license covers already)
rm %{buildroot}%{_docdir}/cmake/Copyright.txt
fdupes %{buildroot}%{_datadir}/%{name}

%docs_package

%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}
%{_libexecdir}/rpm
%{_datadir}/bash-completion
%cmake_mode_el
%dir %{dirname:%cmake_mode_el}