]> git.pld-linux.org Git - packages/ccache.git/blobdiff - ccache.spec
use ccache for building ccache only if instructed explicitly
[packages/ccache.git] / ccache.spec
index 0e8f28bdf0e2643a8c94b2f76c687705d9e476f1..1971ce28b6b565944648f923d6a38fe32035dbed 100644 (file)
@@ -1,13 +1,24 @@
+Summary:       Compiler cache
+Summary(pl.UTF-8):     Pamięć podręczna dla kompilatora
+Summary(pt_BR.UTF-8):  Cache para compiladores C/C++
 Name:          ccache
-Summary:       compiler cache
-Summary(pl):   przyspieszacz kompilowania 
-Url:           http://ccache.samba.org/
-Version:       1.8
-Release:       1
-License:       GPL
+Version:       4.2.1
+Release:       2
+License:       GPL v3+
 Group:         Development/Tools
-Source0:       http://ccache.samba.org/ftp/ccache/%{name}-%{version}.tar.gz
-BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Source0:       https://github.com/ccache/ccache/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 0f95a4b491a4dcd904c8235ee7c660cd
+URL:           https://ccache.dev/
+BuildRequires: cmake >= 3.4.3
+BuildRequires: libstdc++-devel >= 6:4.8.1
+BuildRequires: rpmbuild(macros) >= 1.605
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+BuildRequires: zstd-devel >= 1.1.2
+Requires:      zstd >= 1.1.2
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define                pkglibexecdir   %{_libexecdir}/%{name}
 
 %description
 ccache is a compiler cache. It acts as a caching pre-processor to
@@ -15,32 +26,79 @@ 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.
 
-%description -l pl 
-ccache narzêdziem które przyspiesza proces kompilacji programów napisanych 
-w C/C++ 
+%description -l pl.UTF-8
+ccache to pamięć podręczna dla kompilatora - działa jako cachujący
+preprocesor dla kompilatorów C/C++, wykorzystujący opcję kompilatora
+-E oraz tablicę haszującą do wykrywania, czy do kompilacji wystarczy
+zawartość pamięci podręcznej. Daje to zazwyczaj przyspieszenie
+kompilacji 5 do 10 razy.
+
+%description -l pt_BR.UTF-8
+ccache é um cache para compiladores. Ele funciona mantendo um cache de
+pré-processamento para compiladores C/C++ utilizando-se do parâmetro
+- -E e de um hash para detectar quando uma compilação pode ser
+  reaproveitada de um cache armazenado em disco. O ganho de tempo em
+  compilações comuns pode chegar a uma escala de até 10 vezes em relação
+  ao tempo normal.
+
+%package wrapper
+Summary:       Symlinks for c++/cc/g++/gcc
+Summary(pl.UTF-8):     Dowiązania symboliczne do c++/cc/g++/gcc
+Group:         Development/Tools
+Requires:      %{name} = %{version}-%{release}
+
+%description wrapper
+This package contains the softlinks to ccache for each compiler.
+
+%description wrapper -l pl.UTF-8
+Ten pakiet zawiera dowiązania symboliczne do ccache dla każdego
+kompilatora.
 
 %prep
-%setup -q -n ccache-1.8
+%setup -q
 
 %build
-%configure
+%cmake -B build \
+       -DUSE_CCACHE=OFF \
+       -DUSE_FASTER_LINKER=OFF
 
-%{__make}
+%{__make} -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/env.d
 
-install -d  $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
-install   ccache $RPM_BUILD_ROOT%{_bindir}
-install   ccache.1 $RPM_BUILD_ROOT%{_mandir}/man1
+%{__make} -C build install \
+       DESTDIR=$RPM_BUILD_ROOT
 
-gzip -9nf README
+install -d $RPM_BUILD_ROOT{%{_bindir},%{pkglibexecdir},/etc/profile.d}
+%ifarch x32
+target=x86_64-%{_target_vendor}-%{_target_os}-gnux32
+%else
+target=%{_target_cpu}-%{_target_vendor}-%{_target_os}
+%endif
+for cc in cc c++ g++ gcc $target-gcc $target-g++; do
+       ln -s ../../bin/%{name} $RPM_BUILD_ROOT%{pkglibexecdir}/$cc
+done
+echo 'export PATH=%{pkglibexecdir}:$PATH' > \
+       $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
 
 %clean
-rm -fr $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
+%doc LICENSE.* README.md doc/{AUTHORS.*,MANUAL.*,NEWS.*}
 %attr(755,root,root) %{_bindir}/ccache
-%{_mandir}/man1/ccache*
-%doc *.gz
+%{_mandir}/man1/ccache.1*
+
+%files wrapper
+%defattr(644,root,root,755)
+/etc/profile.d/%{name}.sh
+%dir %{pkglibexecdir}
+%attr(755,root,root) %{pkglibexecdir}/c++
+%attr(755,root,root) %{pkglibexecdir}/cc
+%attr(755,root,root) %{pkglibexecdir}/g++
+%attr(755,root,root) %{pkglibexecdir}/gcc
+%attr(755,root,root) %{pkglibexecdir}/*-g++
+%attr(755,root,root) %{pkglibexecdir}/*-gcc
This page took 0.105281 seconds and 4 git commands to generate.