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
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. 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 Name: ccache
Version: 4.8.3 Version: 4.8.3
Release: 1mamba Release: 2mamba
Summary: A compiler cache that often boosts from 5 to 10 times speedup in common compilations. Summary: A compiler cache that often boosts from 5 to 10 times speedup in common compilations.
Group: Development/Tools Group: Development/Tools
Vendor: openmamba Vendor: openmamba
@ -21,17 +21,17 @@ BuildRequires: asciidoc
%description %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. 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 %prep
%setup -q %setup -q
%build %build
%cmake -d build \ %cmake -d build
\
%ifarch %{ix86} #%ifarch %{ix86}
-DUSE_FASTER_LINKER=OFF # -DUSE_FASTER_LINKER=OFF
%endif #%endif
%make %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}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall -C build %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 %clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" [ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/default/ccache
%{_sysconfdir}/profile.d/ccache.sh
%{_bindir}/ccache %{_bindir}/ccache
%{_mandir}/* %dir %{_libdir}/ccache
%{_libdir}/ccache/*
%{_mandir}/man1/ccache.1*
%doc GPL-3.0.txt %doc GPL-3.0.txt
%changelog %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 * Wed Aug 30 2023 Automatic Build System <autodist@mambasoft.it> 4.8.3-1mamba
- automatic version update by autodist - automatic version update by autodist