%define name colorgcc %define version 1.3.2 %define release %mkrel 13 Summary: GCC output colorizer Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 Patch0: colorgcc-1.3.2-mdkconf.patch Patch1: colorgcc-1.3.2-handle-translated-output.patch License: GPL Group: Development/C Url: http://www.schlueters.de/colorgcc.html Requires: gcc Obsoletes: gcc2.96-colorgcc Obsoletes: gcc-colorgcc <= 4.2.1 Provides: gcc-colorgcc <= 4.2.1 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description ColorGCC is a Perl wrapper to colorize the output of compilers with warning and error messages matching the GCC output format. This package is configured to run with the associated system compiler. If you want to use it for another compiler (e.g. gcc 2.96), you may have to define gccVersion: 2.96 and uncomment the respective compiler paths in %{_sysconfdir}/colorgccrc for a system-wide effect, or in ~/.colorgccrc for your user only. %prep %setup -q %patch0 -p1 -b .mdkconf %patch1 -p1 -b .i18n cat <<'EOF' > colorgcc.sh case ":${PATH}:" in :: ) PATH=%{_datadir}/%{name} export PATH ;; *:%{_datadir}/%{name}:* ) : Already set ;; * ) PATH=%{_datadir}/%{name}:$PATH export PATH ;; esac EOF cat <<'EOF' > colorgcc.csh if ( $?PATH ) then switch (:${PATH}:) case *":%{_datadir}/%{name}:"* : breaksw default : setenv PATH %{_datadir}/%{name}:$PATH breaksw endsw else setenv PATH %{_datadir}/%{name} endif EOF %build %install rm -rf %{buildroot} install -D -m 755 colorgcc %{buildroot}%{_bindir}/colorgcc install -D -m 644 colorgccrc %{buildroot}%{_sysconfdir}/colorgccrc install -D -m 644 colorgcc.sh %{buildroot}%{_sysconfdir}/profile.d/20colorgcc.sh install -D -m 644 colorgcc.csh %{buildroot}%{_sysconfdir}/profile.d/20colorgcc.csh # nb: prefixing colorgcc.sh by "20" so that it is sourced before 80icecream.sh install -d %{buildroot}%{_datadir}/%{name} ln -s ../../bin/colorgcc %{buildroot}%{_datadir}/%{name}/colorgcc for i in gcc cc g++ c++ gfortran gcj; do ln -s colorgcc %{buildroot}%{_datadir}/%{name}/$i done %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc COPYING CREDITS ChangeLog %config(noreplace) %{_sysconfdir}/colorgccrc %{_sysconfdir}/profile.d/* %{_bindir}/colorgcc %{_datadir}/colorgcc %changelog * Fri Jan 11 2013 umeabot <umeabot> 1.3.2-13.mga3 + Revision: 348062 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sun May 15 2011 pterjan <pterjan> 1.3.2-12.mga1 + Revision: 98918 - Rebuild for fixed find-requires * Fri Feb 04 2011 ahmad <ahmad> 1.3.2-11.mga1 + Revision: 46812 - imported package colorgcc