]> git.pld-linux.org Git - packages/ccache.git/blob - ccache.spec
029109b5dfe302c001d2a53f2b50a44d6b33e91e
[packages/ccache.git] / ccache.spec
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.7.1
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:  b831963916c909248c0d8958a848cff0
15 URL:            https://ccache.dev/
16 BuildRequires:  asciidoc
17 BuildRequires:  cmake >= 3.15
18 %{?with_redis:BuildRequires:    hiredis-devel >= 0.13.3}
19 %ifarch %{arm}
20 BuildRequires:  libatomic-devel
21 %endif
22 BuildRequires:  libstdc++-devel >= 6:5
23 BuildRequires:  rpmbuild(macros) >= 1.742
24 BuildRequires:  ruby-asciidoctor
25 BuildRequires:  tar >= 1:1.22
26 BuildRequires:  xz
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)
31
32 %define         pkglibexecdir   %{_libexecdir}/%{name}
33
34 %ifarch %{arm}
35 %define         archcflags      -DXXH_FORCE_MEMORY_ACCESS=1
36 %endif
37
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
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.
50
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
57   ao tempo normal.
58
59 %package wrapper
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}
64
65 %description wrapper
66 This package contains the softlinks to ccache for each compiler.
67
68 %description wrapper -l pl.UTF-8
69 Ten pakiet zawiera dowiązania symboliczne do ccache dla każdego
70 kompilatora.
71
72 %prep
73 %setup -q
74
75 %build
76 export CFLAGS="%{rpmcflags} %{?archcflags}"
77 %cmake -B build \
78         -DUSE_CCACHE=OFF \
79         -DUSE_FASTER_LINKER=OFF \
80         %{cmake_on_off redis REDIS_STORAGE_BACKEND}
81
82 %{__make} -C build
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT/etc/env.d
87
88 %{__make} -C build install \
89         DESTDIR=$RPM_BUILD_ROOT
90
91 install -d $RPM_BUILD_ROOT{%{_bindir},%{pkglibexecdir},/etc/profile.d}
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
98         ln -s ../../bin/%{name} $RPM_BUILD_ROOT%{pkglibexecdir}/$cc
99 done
100 echo 'export PATH=%{pkglibexecdir}:$PATH' > \
101         $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 %files
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*
111
112 %files wrapper
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
This page took 0.054429 seconds and 2 git commands to generate.