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