File djgpp-binutils.spec of Package djgpp-binutils

%define binutils_version 2.20.1
#%define djgpp_binutils_version %{binutils_version}-20090820
#%define djgpp_binutils_rpmvers %{expand:%(echo %{djgpp_binutils_version} | tr - _)} 

Name:           djgpp-binutils
Version:        %{binutils_version}
Release:        0
Summary:        DJGPP MS-DOS 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
Patch0:         binutils-2.20-coffcode.patch
Patch1:         binutils-2.20-linker_script.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#!BuildIgnore: post-build-checks  

BuildRequires:  flex
BuildRequires:  bison
BuildRequires:  texinfo
BuildRequires:  djgpp-filesystem >= 38

# NB: This must be left in.
Requires:       djgpp-filesystem >= 38


%description
DJGPP MS-DOS binutils (utilities like 'strip', 'as', 'ld') which
understand Windows executables and DLLs.


%prep
%setup -q -n binutils-%{binutils_version}

%patch0 -p1 -b .coffcode
%patch1 -p1 -b .linker_script


%build
mkdir -p build
cd build
CFLAGS="$RPM_OPT_FLAGS" \
../configure \
  --build=%_build --host=%_host \
  --target=%{_djgpp_target} \
  --verbose --disable-nls \
  --without-included-gettext \
  --disable-werror \
  --with-sysroot=%{_djgpp_sysroot} \
  --prefix=%{_prefix} --bindir=%{_bindir} \
  --includedir=%{_includedir} --libdir=%{_libdir} \
  --mandir=%{_mandir} --infodir=%{_infodir}

make %{?_smp_mflags} 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 ld nm objcopy objdump ranlib strip; do
  rm -f ${RPM_BUILD_ROOT}%{_bindir}/%{_djgpp_target}-$i;
  ln -s %{_prefix}/%{_djgpp_target}/bin/$i ${RPM_BUILD_ROOT}%{_bindir}/%{_djgpp_target}-$i;
done

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%{_mandir}/man1/*
%{_bindir}/%{_djgpp_target}-*
%{_prefix}/%{_djgpp_target}/bin
%{_prefix}/%{_djgpp_target}/lib/ldscripts


%changelog
openSUSE Build Service is sponsored by