File cross-mingw32-binutils.spec of Package cross-mingw32-binutils

# norootforbuild

%define	_prefix	/opt/cross

%define binutils_version 2.18.50
%define mingw32_binutils_version 20080109-2
%define mingw32_binutils_rpmvers %{expand:%(echo %{mingw32_binutils_version} | tr - _)} 

Name:           cross-mingw32-binutils
BuildRequires:  gcc-c++ bison flex texinfo
BuildRequires:  cross-mingw32-filesystem
Requires:       cross-mingw32-filesystem
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}-%{mingw32_binutils_version}-src.tar.gz
Group:          Development/Tools/Building
Autoreqprov:    on
Version:        %{binutils_version}_%{mingw32_binutils_rpmvers}
Release:        1
Summary:        MinGW Windows binutils
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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} \
  --mandir=%{_mandir} \
  --infodir=%{_infodir} \
  --prefix=%{_prefix}
#
make %{?jobs:-j%jobs} all

%install
cd build
make DESTDIR=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT%{_infodir}
rm -rf $RPM_BUILD_ROOT%{_libdir}
rm -rf $RPM_BUILD_ROOT%{_includedir}
rm -f $RPM_BUILD_ROOT%{_bindir}/*-c++filt
> ../binutils.lang

%clean
rm -rf $RPM_BUILD_ROOT

%files -f binutils.lang
%defattr(-,root,root)
%{_mandir}/man1/*
%{_bindir}/%{_mingw32_target}-*
%{_prefix}/%{_mingw32_target}/bin
%{_prefix}/%{_mingw32_target}/lib/ldscripts
openSUSE Build Service is sponsored by