"Second copy" of binutils actually needed.
[fedora-mingw.git] / binutils / mingw-binutils.spec
1 %define binutils_version 2.18.50
2 %define mingw_binutils_version 20080109-2
3 %define mingw_binutils_rpmvers %{expand:%(echo %{mingw_binutils_version} | tr - _)} 
4
5 Name:           mingw-binutils
6 Version:        %{binutils_version}_%{mingw_binutils_rpmvers}
7 Release:        3%{?dist}
8 Summary:        MinGW Windows binutils
9
10 License:        GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+
11 Group:          Development/Libraries
12 URL:            http://www.mingw.org/
13 Source0:        http://dl.sourceforge.net/sourceforge/mingw/binutils-%{binutils_version}-%{mingw_binutils_version}-src.tar.gz
14 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
15
16 BuildRequires:  flex
17 BuildRequires:  bison
18 BuildRequires:  texinfo
19
20
21 %description
22 MinGW Windows binutils (utilities like 'strip', 'as', 'ld') which
23 understand Windows executables and DLLs.
24
25
26 %prep
27 %setup -q -n binutils-%{binutils_version}
28
29
30 %build
31 mkdir -p build
32 cd build
33 CFLAGS="$RPM_OPT_FLAGS" \
34 ../configure \
35   --build=%_build --host=%_host \
36   --target=i686-pc-mingw32 \
37   --verbose --disable-nls \
38   --without-included-gettext \
39   --disable-win32-registry \
40   --disable-werror \
41   --with-sysroot=%{_prefix}/i686-pc-mingw32/sys-root \
42   --prefix=%{_prefix} --bindir=%{_bindir} \
43   --includedir=%{_includedir} --libdir=%{_libdir} \
44   --mandir=%{_mandir} --infodir=%{_infodir}
45
46 make all
47
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51
52 cd build
53 make DESTDIR=$RPM_BUILD_ROOT install
54
55 # These files conflict with ordinary binutils.
56 rm -rf $RPM_BUILD_ROOT%{_infodir}
57 rm -f ${RPM_BUILD_ROOT}%{_libdir}/libiberty*
58
59
60 %clean
61 rm -rf $RPM_BUILD_ROOT
62
63
64 %files
65 %defattr(-,root,root)
66 %{_mandir}/man1/*
67 %{_bindir}/i686-pc-mingw32-*
68 %{_prefix}/i686-pc-mingw32/bin/*
69 %{_prefix}/i686-pc-mingw32/lib/ldscripts
70
71
72 %changelog
73 * Mon Jul  7 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-3
74 - Initial RPM release, largely based on earlier work from several sources.