File cross-mips-elf-gcc.spec of Package cross-mips-elf-gcc

%define target mips-elf

Summary: GNU compiler suite to build programs for %{target}
Name: cross-%{target}-gcc
Version: 4.8.4
Release: 0
License: GPL-2.0
Group: Development/Libraries/Cross
URL: http://ftp.gnu.org/gnu/gcc
BuildRequires:	cross-%{target}-binutils mpfr-devel gmp-devel mpc-devel
BuildRequires:  cross-%{target}-gcc-bootstrap cross-%{target}-newlib-devel
BuildRequires:  gcc-c++
Source0: http://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-%{version}.tar.bz2
Patch1:	compile-fixes
Patch2:	fix-includes-fixed
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
AutoReqProv: off
Requires:  cross-%{target}-binutils
Recommends:cross-%{target}-newlib-devel

%description 
GNU compiler suite to build programs for %{target} .

%prep
%setup -q -n gcc-%{version}
%patch1 -p1
%patch2 -p1

%build
mkdir build && cd build
export CFLAGS="$RPM_OPT_FLAGS"
../configure --prefix=/opt/cross --build=`arch`-suse-linux --target=%{target} --enable-languages=c,c++ \
             --with-newlib --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp

make all

%install
make -C build DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT/opt/cross/info $RPM_BUILD_ROOT/opt/cross/lib*/libiberty.a
#rm -rf $RPM_BUILD_ROOT/opt/cross/man $RPM_BUILD_ROOT/opt/cross/share/locale
rm -rf $RPM_BUILD_ROOT/opt/cross/share/info/dir

%clean
rm -rf $RPM_BUILD_ROOT

# Silence the totally braindead rpmlint. At least partially.
%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%defattr(-,root,root,-)
/opt/cross

%changelog
* Mon Apr 20 2009 Torsten Duwe <duwe@suse.de> - kernel-headers
- Initial build.