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