Added binutils.
[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:        2%{?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 # Install puts a second copy of all the executables under the MinGW
60 # root (/usr/i686-pc-mingw/bin/*).  I'm not sure why it does this,
61 # but it doesn't seem to be necessary.
62 rm -rf $RPM_BUILD_ROOT%{_prefix}/i686-pc-mingw32/bin
63
64
65 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68
69 %files
70 %defattr(-,root,root)
71 %{_mandir}/man1/*
72 %{_bindir}/i686-pc-mingw32-*
73 %{_prefix}/i686-pc-mingw32/lib/ldscripts
74
75
76 %changelog
77 * Mon Jul  7 2008 Richard W.M. Jones <rjones@redhat.com> - 2.18.50_20080109_2-2
78 - Initial RPM release, largely based on earlier work from several sources.