]> 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 a2a0f8735109a531c7076e584f5a08bc434b989a..1971ce28b6b565944648f923d6a38fe32035dbed 100644 (file)
@@ -2,21 +2,23 @@ Summary:      Compiler cache
 Summary(pl.UTF-8):     Pamięć podręczna dla kompilatora
 Summary(pt_BR.UTF-8):  Cache para compiladores C/C++
 Name:          ccache
-Version:       3.1.10
-Release:       1
-License:       GPL v3
+Version:       4.2.1
+Release:       2
+License:       GPL v3+
 Group:         Development/Tools
-Source0:       http://www.samba.org/ftp/ccache/%{name}-%{version}.tar.xz
-# Source0-md5: 20cd43818f84e3208fb4859e9679060e
-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: 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: zlib-devel >= 1.2.3
+BuildRequires: zstd-devel >= 1.1.2
+Requires:      zstd >= 1.1.2
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _libdir         %{_prefix}/%{_lib}/%{name}
+%define                pkglibexecdir   %{_libexecdir}/%{name}
 
 %description
 ccache is a compiler cache. It acts as a caching pre-processor to
@@ -54,38 +56,31 @@ kompilatora.
 
 %prep
 %setup -q
-%patch0 -p1
-
-# Make sure system zlib is used
-%{__rm} -r zlib
 
 %build
-cp -f /usr/share/automake/config.* .
-CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
-%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
 
-%{__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
@@ -93,18 +88,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.1.*
-%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/CCACHE_*
+%{_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}/c++
-%attr(755,root,root) %{_libdir}/cc
-%attr(755,root,root) %{_libdir}/g++
-%attr(755,root,root) %{_libdir}/gcc
-%attr(755,root,root) %{_libdir}/%{_target_cpu}-pld-linux-g++
-%attr(755,root,root) %{_libdir}/%{_target_cpu}-pld-linux-gcc
+/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.678285 seconds and 4 git commands to generate.