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]

This commit is contained in:
Silvan Calarco 2024-01-05 21:08:55 +01:00
parent 8067c4a857
commit 7a166b8d10
2 changed files with 39 additions and 8 deletions

View File

@ -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.

View File

@ -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 <silvan.calarco@mambasoft.it> 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 <autodist@mambasoft.it> 4.8.3-1mamba
- automatic version update by autodist