]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without redis # Redis secondary storage support | |
4 | ||
5 | Summary: Compiler cache | |
6 | Summary(pl.UTF-8): Pamięć podręczna dla kompilatora | |
7 | Summary(pt_BR.UTF-8): Cache para compiladores C/C++ | |
8 | Name: ccache | |
9 | Version: 4.10 | |
10 | Release: 1 | |
11 | License: GPL v3+ | |
12 | Group: Development/Tools | |
13 | Source0: https://github.com/ccache/ccache/releases/download/v%{version}/%{name}-%{version}.tar.xz | |
14 | # Source0-md5: f61ae4be99ee693fa62bf7bbd794f6a0 | |
15 | URL: https://ccache.dev/ | |
16 | BuildRequires: asciidoc | |
17 | BuildRequires: cmake >= 3.15 | |
18 | BuildRequires: cpp-httplib-devel >= 0.10.6 | |
19 | %{?with_redis:BuildRequires: hiredis-devel >= 0.13.3} | |
20 | BuildRequires: libfmt-devel >= 8.0.0 | |
21 | %ifnarch %arch_with_atomics64 | |
22 | BuildRequires: libatomic-devel | |
23 | %endif | |
24 | BuildRequires: libstdc++-devel >= 6:5 | |
25 | BuildRequires: rpmbuild(macros) >= 2.025 | |
26 | BuildRequires: ruby-asciidoctor | |
27 | BuildRequires: tar >= 1:1.22 | |
28 | BuildRequires: xxHash-devel >= 0.8.0 | |
29 | BuildRequires: xz | |
30 | BuildRequires: zstd-devel >= 1.3.4 | |
31 | %{?with_redis:Requires: hiredis >= 0.13.3} | |
32 | Requires: libfmt >= 8.0.0 | |
33 | Requires: xxHash >= 0.8.0 | |
34 | Requires: zstd >= 1.3.4 | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %define pkglibexecdir %{_libexecdir}/%{name} | |
38 | ||
39 | %ifarch %{arm} | |
40 | %define archcflags -DXXH_FORCE_MEMORY_ACCESS=1 | |
41 | %endif | |
42 | ||
43 | %description | |
44 | ccache is a compiler cache. It acts as a caching pre-processor to | |
45 | C/C++ compilers, using the -E compiler switch and a hash to detect | |
46 | when a compilation can be satisfied from cache. This often results in | |
47 | a 5 to 10 times speedup in common compilations. | |
48 | ||
49 | %description -l pl.UTF-8 | |
50 | ccache to pamięć podręczna dla kompilatora - działa jako cachujący | |
51 | preprocesor dla kompilatorów C/C++, wykorzystujący opcję kompilatora | |
52 | -E oraz tablicę haszującą do wykrywania, czy do kompilacji wystarczy | |
53 | zawartość pamięci podręcznej. Daje to zazwyczaj przyspieszenie | |
54 | kompilacji 5 do 10 razy. | |
55 | ||
56 | %description -l pt_BR.UTF-8 | |
57 | ccache é um cache para compiladores. Ele funciona mantendo um cache de | |
58 | pré-processamento para compiladores C/C++ utilizando-se do parâmetro | |
59 | - -E e de um hash para detectar quando uma compilação pode ser | |
60 | reaproveitada de um cache armazenado em disco. O ganho de tempo em | |
61 | compilações comuns pode chegar a uma escala de até 10 vezes em relação | |
62 | ao tempo normal. | |
63 | ||
64 | %package wrapper | |
65 | Summary: Symlinks for c++/cc/g++/gcc | |
66 | Summary(pl.UTF-8): Dowiązania symboliczne do c++/cc/g++/gcc | |
67 | Group: Development/Tools | |
68 | Requires: %{name} = %{version}-%{release} | |
69 | ||
70 | %description wrapper | |
71 | This package contains the softlinks to ccache for each compiler. | |
72 | ||
73 | %description wrapper -l pl.UTF-8 | |
74 | Ten pakiet zawiera dowiązania symboliczne do ccache dla każdego | |
75 | kompilatora. | |
76 | ||
77 | %prep | |
78 | %setup -q | |
79 | ||
80 | %build | |
81 | export CFLAGS="%{rpmcflags} %{?archcflags}" | |
82 | %cmake -B build \ | |
83 | -DDEPS=LOCAL \ | |
84 | -DDEP_CPPHTTPLIB=SYSTEM \ | |
85 | -DENABLE_TESTING=OFF \ | |
86 | -DUSE_CCACHE=OFF \ | |
87 | -DUSE_FASTER_LINKER=OFF \ | |
88 | %{cmake_on_off redis REDIS_STORAGE_BACKEND} | |
89 | ||
90 | %{__make} -C build | |
91 | ||
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | install -d $RPM_BUILD_ROOT/etc/env.d | |
95 | ||
96 | %{__make} -C build install \ | |
97 | DESTDIR=$RPM_BUILD_ROOT | |
98 | ||
99 | install -d $RPM_BUILD_ROOT{%{_bindir},%{pkglibexecdir},/etc/profile.d} | |
100 | %ifarch x32 | |
101 | target=x86_64-%{_target_vendor}-%{_target_os}-gnux32 | |
102 | %else | |
103 | target=%{_target_cpu}-%{_target_vendor}-%{_target_os} | |
104 | %endif | |
105 | for cc in cc c++ g++ gcc $target-gcc $target-g++; do | |
106 | ln -s ../../bin/%{name} $RPM_BUILD_ROOT%{pkglibexecdir}/$cc | |
107 | done | |
108 | echo 'export PATH=%{pkglibexecdir}:$PATH' > \ | |
109 | $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh | |
110 | ||
111 | %clean | |
112 | rm -rf $RPM_BUILD_ROOT | |
113 | ||
114 | %files | |
115 | %defattr(644,root,root,755) | |
116 | %doc LICENSE.* README.md doc/{AUTHORS.*,MANUAL.*,NEWS.*} | |
117 | %attr(755,root,root) %{_bindir}/ccache | |
118 | %{_mandir}/man1/ccache.1* | |
119 | ||
120 | %files wrapper | |
121 | %defattr(644,root,root,755) | |
122 | /etc/profile.d/%{name}.sh | |
123 | %dir %{pkglibexecdir} | |
124 | %attr(755,root,root) %{pkglibexecdir}/c++ | |
125 | %attr(755,root,root) %{pkglibexecdir}/cc | |
126 | %attr(755,root,root) %{pkglibexecdir}/g++ | |
127 | %attr(755,root,root) %{pkglibexecdir}/gcc | |
128 | %attr(755,root,root) %{pkglibexecdir}/*-g++ | |
129 | %attr(755,root,root) %{pkglibexecdir}/*-gcc |