3 %bcond_without redis # Redis secondary storage support
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++
12 Group: Development/Tools
13 Source0: https://github.com/ccache/ccache/releases/download/v%{version}/%{name}-%{version}.tar.xz
14 # Source0-md5: a38921ab61002b245b9f08235c04009c
15 URL: https://ccache.dev/
16 BuildRequires: asciidoc
17 BuildRequires: cmake >= 3.10
18 %{?with_redis:BuildRequires: hiredis-devel >= 0.13.3}
20 BuildRequires: libatomic-devel
22 BuildRequires: libstdc++-devel >= 6:5
23 BuildRequires: rpmbuild(macros) >= 1.742
24 BuildRequires: ruby-asciidoctor
25 BuildRequires: tar >= 1:1.22
27 BuildRequires: zstd-devel >= 1.1.2
28 %{?with_redis:Requires: hiredis >= 0.13.3}
29 Requires: zstd >= 1.1.2
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define pkglibexecdir %{_libexecdir}/%{name}
35 %define archcflags -DXXH_FORCE_MEMORY_ACCESS=1
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.
44 %description -l pl.UTF-8
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.
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
55 reaproveitada de um cache armazenado em disco. O ganho de tempo em
56 compilações comuns pode chegar a uma escala de até 10 vezes em relação
60 Summary: Symlinks for c++/cc/g++/gcc
61 Summary(pl.UTF-8): Dowiązania symboliczne do c++/cc/g++/gcc
62 Group: Development/Tools
63 Requires: %{name} = %{version}-%{release}
66 This package contains the softlinks to ccache for each compiler.
68 %description wrapper -l pl.UTF-8
69 Ten pakiet zawiera dowiązania symboliczne do ccache dla każdego
76 export CFLAGS="%{rpmcflags} %{?archcflags}"
79 -DUSE_FASTER_LINKER=OFF \
80 %{cmake_on_off redis REDIS_STORAGE_BACKEND}
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT/etc/env.d
88 %{__make} -C build install \
89 DESTDIR=$RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT{%{_bindir},%{pkglibexecdir},/etc/profile.d}
93 target=x86_64-%{_target_vendor}-%{_target_os}-gnux32
95 target=%{_target_cpu}-%{_target_vendor}-%{_target_os}
97 for cc in cc c++ g++ gcc $target-gcc $target-g++; do
98 ln -s ../../bin/%{name} $RPM_BUILD_ROOT%{pkglibexecdir}/$cc
100 echo 'export PATH=%{pkglibexecdir}:$PATH' > \
101 $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
104 rm -rf $RPM_BUILD_ROOT
107 %defattr(644,root,root,755)
108 %doc LICENSE.* README.md doc/{AUTHORS.*,MANUAL.*,NEWS.*}
109 %attr(755,root,root) %{_bindir}/ccache
110 %{_mandir}/man1/ccache.1*
113 %defattr(644,root,root,755)
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
120 %attr(755,root,root) %{pkglibexecdir}/*-g++
121 %attr(755,root,root) %{pkglibexecdir}/*-gcc