From 7a166b8d10549e37fc21b5213097addea645c7f1 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 21:08:55 +0100 Subject: [PATCH] provide ccache folder with symlinks, profile and default files to quickly enable or disable system-wide usage [release 4.8.3-2mamba;Sun Dec 10 2023] --- README.md | 1 + ccache.spec | 46 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e545af5..d999819 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ # ccache ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations. + diff --git a/ccache.spec b/ccache.spec index f9bac17..791626e 100644 --- a/ccache.spec +++ b/ccache.spec @@ -1,6 +1,6 @@ Name: ccache Version: 4.8.3 -Release: 1mamba +Release: 2mamba Summary: A compiler cache that often boosts from 5 to 10 times speedup in common compilations. Group: Development/Tools Vendor: openmamba @@ -21,17 +21,17 @@ BuildRequires: asciidoc %description ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compilers, using the -E compiler switch and a hash to detect when a compilation can be satisfied from cache. This often results in a 5 to 10 times speedup in common compilations. -#% debug_package +%debug_package %prep %setup -q %build -%cmake -d build \ -\ -%ifarch %{ix86} - -DUSE_FASTER_LINKER=OFF -%endif +%cmake -d build + +#%ifarch %{ix86} +# -DUSE_FASTER_LINKER=OFF +#%endif %make @@ -39,16 +39,46 @@ ccache is a compiler cache. It acts as a caching pre-processor to C/C++ compiler [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %makeinstall -C build +install -d -m0755 %{buildroot}%{_libdir}/ccache/bin +for p in gcc g++ c++; do + ln -s %{_bindir}/ccache %{buildroot}%{_libdir}/ccache/bin/${p} + ln -s %{_bindir}/ccache %{buildroot}%{_libdir}/ccache/bin/%{_host}-${p} +done + +for p in cc clang clang++; do + ln -s %{_bindir}/ccache %{buildroot}%{_libdir}/ccache/bin/${p} +done + +install -d -m0755 %{buildroot}%{_sysconfdir}/default +cat > %{buildroot}%{_sysconfdir}/default/ccache << EOF +CCACHE_ENABLED=no +EOF + +install -d -m0755 %{buildroot}%{_sysconfdir}/profile.d +cat > %{buildroot}%{_sysconfdir}/profile.d/ccache.sh << EOF +. %{_sysconfdir}/default/ccache +if [ "\${CCACHE_ENABLED}" == "yes" ]; then + export PATH=%{_libdir}/ccache/bin:\$PATH +fi +EOF + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files %defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/default/ccache +%{_sysconfdir}/profile.d/ccache.sh %{_bindir}/ccache -%{_mandir}/* +%dir %{_libdir}/ccache +%{_libdir}/ccache/* +%{_mandir}/man1/ccache.1* %doc GPL-3.0.txt %changelog +* Sun Dec 10 2023 Silvan Calarco 4.8.3-2mamba +- provide ccache folder with symlinks, profile and default files to quickly enable or disable system-wide usage + * Wed Aug 30 2023 Automatic Build System 4.8.3-1mamba - automatic version update by autodist