File mingw32-cross-binutils.spec of Package mingw32-cross-binutils
%define binutils_version 2.20.90
#%define mingw32_binutils_version %{binutils_version}-20090820
#%define mingw32_binutils_rpmvers %{expand:%(echo %{mingw32_binutils_version} | tr - _)}
Name: mingw32-cross-binutils
Version: %{binutils_version}
Release: 0
Summary: MinGW Windows binutils
License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
Group: Development/Libraries
URL: http://www.mingw.org/
Source0: http://dl.sourceforge.net/sourceforge/mingw/binutils-%{binutils_version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#!BuildIgnore: post-build-checks
BuildRequires: flex
BuildRequires: bison
BuildRequires: texinfo
BuildRequires: mingw32-filesystem >= 38
# NB: This must be left in.
Requires: mingw32-filesystem >= 38
%description
MinGW Windows binutils (utilities like 'strip', 'as', 'ld') which
understand Windows executables and DLLs.
%prep
%setup -q -n binutils-%{binutils_version}
%build
mkdir -p build
cd build
CFLAGS="$RPM_OPT_FLAGS" \
../configure \
--build=%_build --host=%_host \
--target=%{_mingw32_target} \
--verbose --disable-nls \
--without-included-gettext \
--disable-win32-registry \
--disable-werror \
--with-sysroot=%{_mingw32_sysroot} \
--prefix=%{_prefix} --bindir=%{_bindir} \
--includedir=%{_includedir} --libdir=%{_libdir} \
--mandir=%{_mandir} --infodir=%{_infodir}
make %{?_smp_mflags} all || make all
%install
rm -rf $RPM_BUILD_ROOT
cd build
make DESTDIR=$RPM_BUILD_ROOT install
# These files conflict with ordinary binutils.
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
for i in ar as dlltool ld nm objcopy objdump ranlib strip; do
rm -f ${RPM_BUILD_ROOT}%{_bindir}/%{_mingw32_target}-$i;
ln -s %{_prefix}/%{_mingw32_target}/bin/$i ${RPM_BUILD_ROOT}%{_bindir}/%{_mingw32_target}-$i;
done
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{_mandir}/man1/*
%{_bindir}/%{_mingw32_target}-*
%{_prefix}/%{_mingw32_target}/bin
%{_prefix}/%{_mingw32_target}/lib/ldscripts
%changelog