Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 8cd8bf731bd51ff4bb6375a9163efbf5 > files > 2

ccache-2.4-20mdv2010.0.src.rpm

Name:		ccache
Version:	2.4
Release:	%mkrel 20
Group:		Development/Other
Summary:	Compiler Cache
License:	GPL
URL:		http://ccache.samba.org/
Source0:	%{name}-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

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

To enable ccache's default use, the system admin should modify 
%{_sysconfdir}/sysconfig/ccache to "yes". If its default use is not 
enabled and you wish to use it, simply add %{_prefix}/%{_lib}/ccache/bin/ to 
the start of your \$PATH

%prep
%setup -q

%build
%configure2_5x
%make

%__cat <<EOF > %{name}.sh

if [ -f /etc/sysconfig/ccache ]; then
    . /etc/sysconfig/ccache
fi
if [ "\$USE_CCACHE_DEFAULT" = "yes" ]; then
    if [ -z \`echo "\$PATH" | grep "%_libdir/ccache/bin"\` ]; then
        export PATH="%_libdir/ccache/bin:\$PATH"
    fi
fi
EOF

%__cat << EOF > %{name}.csh

if ( -f /etc/sysconfig/ccache ) then
    eval \`sed -n 's/^\([^#]*\)=\([^#]*\)/set \1=\2;/p' < /etc/sysconfig/ccache\`
endif
if ( "\$USE_CCACHE_DEFAULT" == "yes" ) then
    if ( "\$path" !~ *%_libdir/ccache/bin* ) then
        setenv path = ( %_libdir/ccache/bin \$path )
    endif
endif
EOF

%install
%__rm -rf %{buildroot}
%__install -dm 755 %{buildroot}{%{_bindir},%{_libdir}/ccache/bin,%{_mandir}/man1}
%__install -pm 755 ccache %{buildroot}%{_bindir}
%__install -pm 644 ccache.1 %{buildroot}%{_mandir}/man1
%__install -dm 755 %{buildroot}%{_sysconfdir}/profile.d
%__install -pm 755 %{name}.sh %{name}.csh %{buildroot}%{_sysconfdir}/profile.d
rm -f %{name}-%{version}.compilers
pref=`gcc -dumpmachine`

create_compiler() {
%__cat <<EOF > %{buildroot}%{_prefix}/%{_lib}/ccache/bin/$1
#!/bin/sh
if [ ! -x %_bindir/$1 ]; then
	echo Error: compiler $1 does not exist. >&2
	exit 127
fi
PATH=%_bindir:\$PATH
if [ -f /etc/sysconfig/ccache ]; then
	. /etc/sysconfig/ccache
	if [ "\$USE_CCACHE_WITH_ICECREAM" = "yes" ]; then
	PATH=%{_libdir}/icecc/bin:\$PATH
	fi
fi

ccache ${1} "\$@"
EOF
echo "%attr(0755,root,root) %{_libdir}/ccache/bin/$1" >> %{name}-%{version}.compilers
}

for name in gcc g++ c++; do
 for comp in $name $pref-$name ${pref/manbo/mandriva}-$name; do
  # check for backports that have no manbo:
  [ -e "%{buildroot}%{_libdir}/ccache/bin/$comp" ] || create_compiler $comp
 done
done
create_compiler cc

%__mkdir_p %{buildroot}%{_sysconfdir}/sysconfig/
%__cat <<EOF > %{buildroot}/%{_sysconfdir}/sysconfig/%{name}
# Should we add the ccache compiler symlinks to PATH
# yes|no
# Please note that if added to \$PATH the user can still disable 
# it with CCACHE_DISABLE
# If not enabled by default, the user can add %{_libdir}/ccache/bin/
# to their \$PATH
USE_CCACHE_DEFAULT="no"

# Enable icecream integration
USE_CCACHE_WITH_ICECREAM="no"

EOF

%clean
rm -rf %{buildroot}

%files -f %{name}-%{version}.compilers
%defattr(-,root,root)
%doc README
%dir %{_libdir}/ccache
%dir %{_libdir}/ccache/bin
%{_bindir}/ccache
%{_mandir}/man1/ccache.1*
%{_sysconfdir}/profile.d/*
%config(noreplace) %{_sysconfdir}/sysconfig/*





%changelog
* Mon Jun 22 2009 Wanderlei Cavassin <cavassin@mandriva.com.br> 2.4-19mdv2010.0
+ Revision: 388073
- remove shell bang to avoid uneeded dependencies (fixes mdv #51777)

* Thu Aug 07 2008 Thierry Vignaud <tvignaud@mandriva.com> 2.4-19mdv2009.0
+ Revision: 266473
- rebuild early 2009.0 package (before pixel changes)

* Wed Apr 23 2008 Helio Chissini de Castro <helio@mandriva.com> 2.4-18mdv2009.0
+ Revision: 196994
- Moving ccache binary to bin to allow make install as root works

* Sat Mar 15 2008 Anssi Hannula <anssi@mandriva.org> 2.4-17mdv2008.1
+ Revision: 188046
- add mandriva variants of manbo g++ and c++

* Sat Mar 15 2008 Anssi Hannula <anssi@mandriva.org> 2.4-16mdv2008.1
+ Revision: 188036
- update compiler scripts to match current manbo-adapted compilers
- check the compiler existence before continuing to avoid fork bombs

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Mon Oct 22 2007 Marcelo Ricardo Leitner <mrl@mandriva.com> 2.4-15mdv2008.1
+ Revision: 101148
- Rebuild


* Tue Sep 05 2006 Helio Chissini de Castro <helio@mandriva.com>
+ 2006-09-05 04:51:58 (59927)
- Fix ccache test for compiler to avoid infinite recursion

* Mon Sep 04 2006 Helio Chissini de Castro <helio@mandriva.com>
+ 2006-09-04 15:17:30 (59788)
- Fixed paths for icecream new builddir
- Added proper compiler detection
- MOve to svn

* Mon Sep 04 2006 Helio Chissini de Castro <helio@mandriva.com>
+ 2006-09-04 14:42:07 (59779)
- import ccache-2.4-12mdv2007.0

* Mon May 29 2006 Anssi Hannula <anssi@mandriva.org> 2.4-12mdv2007.0
- modify PATH instead of using COMPILERDIR in compiler scripts (fix #21409)

* Mon May 29 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 2.4-11mdv2007.0
- add {gcc,g++}-4.1.1 to compiler list
- %%{1}mdv2007.0
- fix executable-marked-as-config-file
- utf-8

* Thu Sep 01 2005 David Walluck <walluck@mandriva.org> 2.4-10mdk
- fix icecream location on x86_64
- fix script-without-shellbang

* Mon Jun 27 2005 Helio Chissini de Castro <helio@mandriva.com> 2.4-9mdk
- Fix recursive call on ccache when USE_ICECREAM_WITH_CCACHE=no. Thanks to Olav
  Vitters <olav@bkor.dhs.org>

* Mon Jun 27 2005 Helio Chissini de Castro <helio@mandriva.com> 2.4-8mdk
- Fixed typo on profile script PATH

* Fri Jun 24 2005 Helio Chissini de Castro <helio@mandriva.com> 2.4-7mdk
- Avoid use the PATH on cluster, which leads to a /home/$USER path.
- When user not set to use icecream, compiler always point to wrong path

* Tue Mar 22 2005 Helio Chissini de Castro <helio@conectiva.com.br> 2.4-6mdk
- Fixed invalid recursive path

* Mon Feb 28 2005 Helio Chissini de Castro <helio@conetciva.com.br> 2.4-5mdk
- Add wrappers to enable integration with icecream. This wrappers remove the 
- necessity of triggers on post and postun.
- Ghost removed, since wrappers are real files now

* Wed Feb 02 2005 Nick Brown <nickbrown@mandrake.org> 2.4-4mdk
- Update compiler lists

* Sun Sep 26 2004 David Walluck <walluck@mandrake.org> 2.4-3mdk
- fix ccache.sh

* Sun Sep 26 2004 David Walluck <walluck@mandrake.org> 2.4-2mdk
- changed test in ccache.sh slightly
- macros everywhere

* Fri Sep 17 2004 Nick Brown <nickbrown@mandrake.org> 2.4-1mdk
- 2.4

* Mon Sep 13 2004 Nick Brown <nickbrown@mandrake.org> 2.3-10mdk
- instructions on package use

* Sun Sep 12 2004 Nick Brown <nickbrown@mandrake.org> 2.3-9mdk
- Update package and compiler lists

* Tue Sep 07 2004 Nick Brown <nickbrown@mandrake.org> 2.3-8mdk
- Revert last change at request of ghibo@mandrakesoft.com

* Tue Sep 07 2004 Nick Brown <nickbrown@mandrake.org> 2.3-7mdk
- Enable by default

* Sun Aug 29 2004 Nick Brown <nickbrown@mandrake.org> 2.3-6mdk
- Fix typo in ccache.csh

* Tue Aug 24 2004 Nick Brown <nickbrown@mandrake.org> 2.3-5mdk
- Check sysconfig

* Wed Aug 18 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.3-4mdk
- Don't let ccache.sh|csh profile scripts use ccache links before
  default un-ccached compiler.

* Tue Aug 17 2004 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.3-3mdk
- Added ccache in /usr/bin for backward compatibility.

* Fri Aug 13 2004 Nick Brown <nickbroon@blueyonder.co.uk> 2.3-2mdk
- As the fedora package, add dynamic support for compilers

* Fri Dec 12 2003 Olivier Thauvin <thauvin@aerov.jussieu.fr> 2.3-1mdk
- 2.3