]> git.pld-linux.org Git - packages/ccache.git/blobdiff - ccache.spec
up to 4.9.1
[packages/ccache.git] / ccache.spec
index a5df31ac2b6c42a149cbc572129d6b5fbdb0335d..ea207988ec89f63eb8462e5403842f12cc9872e2 100644 (file)
@@ -1,19 +1,39 @@
+#
+# Conditional build:
+%bcond_without redis           # Redis secondary storage support
+
 Summary:       Compiler cache
-Summary(pl.UTF-8):     Przyspieszacz kompilowania
+Summary(pl.UTF-8):     Pamięć podręczna dla kompilatora
 Summary(pt_BR.UTF-8):  Cache para compiladores C/C++
 Name:          ccache
-Version:       3.1.7
+Version:       4.9.1
 Release:       1
-License:       GPL v3
+License:       GPL v3+
 Group:         Development/Tools
-Source0:       http://samba.org/ftp/ccache/%{name}-%{version}.tar.bz2
-# Source0-md5: 82257745eac54826527946e9e3d046f4
-Patch0:                %{name}-nohash_size_mtime.patch
-URL:           http://ccache.samba.org/
-BuildRequires: automake
+Source0:       https://github.com/ccache/ccache/releases/download/v%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: a574ea87aa223c01d74b511a5487ed15
+URL:           https://ccache.dev/
+BuildRequires: asciidoc
+BuildRequires: cmake >= 3.15
+%{?with_redis:BuildRequires:   hiredis-devel >= 0.13.3}
+%ifnarch %arch_with_atomics64
+BuildRequires: libatomic-devel
+%endif
+BuildRequires: libstdc++-devel >= 6:5
+BuildRequires: rpmbuild(macros) >= 2.025
+BuildRequires: ruby-asciidoctor
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
+BuildRequires: zstd-devel >= 1.1.2
+%{?with_redis:Requires:        hiredis >= 0.13.3}
+Requires:      zstd >= 1.1.2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _libdir         %{_prefix}/%{_lib}/%{name}
+%define                pkglibexecdir   %{_libexecdir}/%{name}
+
+%ifarch %{arm}
+%define                archcflags      -DXXH_FORCE_MEMORY_ACCESS=1
+%endif
 
 %description
 ccache is a compiler cache. It acts as a caching pre-processor to
@@ -22,10 +42,11 @@ when a compilation can be satisfied from cache. This often results in
 a 5 to 10 times speedup in common compilations.
 
 %description -l pl.UTF-8
-ccache działa jako cachujący preprocesor dla kompilatorów C/C++. Przy
-użyciu opcji kompilatora -E oraz tablicy haszującej do wykrywania, czy
-do kompilacji wystarczy zawartość cache. Daje to zazwyczaj
-przyspieszenie kompilacji 5 do 10 razy.
+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
@@ -50,35 +71,33 @@ kompilatora.
 
 %prep
 %setup -q
-%patch0 -p1
 
 %build
-cp -f /usr/share/automake/config.* .
-%configure
+export CFLAGS="%{rpmcflags} %{?archcflags}"
+%cmake -B build \
+       -DUSE_CCACHE=OFF \
+       -DUSE_FASTER_LINKER=OFF \
+       %{cmake_on_off redis REDIS_STORAGE_BACKEND}
 
-%{__make}
+%{__make} -C build
 
 %install
 rm -rf $RPM_BUILD_ROOT
-
 install -d $RPM_BUILD_ROOT/etc/env.d
 
-%{__make} install \
+%{__make} -C build install \
        DESTDIR=$RPM_BUILD_ROOT
 
-for X in CCACHE_DIR CCACHE_TEMPDIR CCACHE_LOGFILE CCACHE_PATH CCACHE_CC CCACHE_PREFIX \
-       CCACHE_DISABLE CCACHE_READONLY CCACHE_CPP2 CCACHE_NOSTATS CCACHE_NLEVELS \
-       CCACHE_HARDLINK CCACHE_RECACHE CCACHE_UMASK CCACHE_HASHDIR CCACHE_UNIFY \
-       CCACHE_EXTENSION CCACHE_NOHASH_SIZE_MTIME
-do
-       echo "#${X}=\"\"" > $RPM_BUILD_ROOT/etc/env.d/${X}
-done
-
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},/etc/profile.d}
-for cc in cc c++ g++ gcc %{_target_cpu}-pld-linux-gcc %{_target_cpu}-pld-linux-g++; do
-       ln -s ../../bin/%{name} $RPM_BUILD_ROOT%{_libdir}/$cc
+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=%{_libdir}:$PATH' > \
+echo 'export PATH=%{pkglibexecdir}:$PATH' > \
        $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
 
 %clean
@@ -86,13 +105,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS.txt MANUAL.txt NEWS.txt README.txt
+%doc LICENSE.* README.md doc/{AUTHORS.*,MANUAL.*,NEWS.*}
 %attr(755,root,root) %{_bindir}/ccache
-%{_mandir}/man1/ccache*
-%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/*
+%{_mandir}/man1/ccache.1*
 
 %files wrapper
 %defattr(644,root,root,755)
-%attr(755,root,root) /etc/profile.d/%{name}.sh
-%dir %{_libdir}
-%attr(755,root,root) %{_libdir}/*
+/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.353966 seconds and 4 git commands to generate.