Working GCC package (but still lots of rpmlint errors).
[fedora-mingw.git] / gcc / mingw-gcc.spec
1 Name:           mingw-gcc
2 Version:        4.3.1
3 Release:        1%{?dist}
4 Summary:        MinGW Windows cross-compiler (GCC) for C and C++
5
6 License:        GPLv2+
7 Group:          Development/Libraries
8 URL:            http://www.mingw.org/
9 Source0:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-core-%{version}.tar.bz2
10 Source1:        ftp://ftp.gnu.org/gnu/gcc/gcc-%{version}/gcc-g++-%{version}.tar.bz2
11
12 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
13
14 BuildRequires:  texinfo
15 BuildRequires:  mingw-binutils
16 BuildRequires:  mingw-runtime
17 BuildRequires:  mingw-w32api
18 BuildRequires:  gmp-devel
19 BuildRequires:  mpfr-devel
20 BuildRequires:  libgomp
21
22 Requires:       mingw-binutils
23 Requires:       mingw-runtime
24 Requires:       mingw-w32api
25
26
27 %description
28 MinGW Windows cross-compiler (GCC) for C and C++.
29
30
31 %prep
32 %setup -q -c
33 %setup -q -D -T -a1
34
35
36 %build
37 cd gcc-%{version}
38
39 mkdir -p build
40 cd build
41
42 #languages="c,c++"
43 languages="c"
44 # XXX C++ disabled for now because of a strange GCC bug.
45
46 CC="%{__cc} ${RPM_OPT_FLAGS}" \
47 ../configure \
48   --prefix=%{_prefix} \
49   --bindir=%{_bindir} \
50   --includedir=%{_includedir} \
51   --libdir=%{_libdir} \
52   --mandir=%{_mandir} \
53   --infodir=%{_infodir} \
54   --datadir=%{_datadir} \
55   --build=%_build --host=%_host \
56   --target=i686-pc-mingw32 \
57   --with-gnu-as --with-gnu-ld --verbose \
58   --without-newlib \
59   --disable-multilib \
60   --with-system-zlib \
61   --disable-nls --without-included-gettext \
62   --disable-win32-registry \
63   --enable-version-specific-runtime-libs \
64   --with-sysroot=%{_prefix}/i686-pc-mingw32/sys-root \
65   --enable-languages="$languages" $optargs
66
67 make all
68
69
70 %install
71 rm -rf $RPM_BUILD_ROOT
72
73 cd gcc-%{version}
74 cd build
75 make DESTDIR=$RPM_BUILD_ROOT install
76
77 # These files conflict with existing installed files.
78 rm -rf $RPM_BUILD_ROOT%{_infodir}
79 rm -f $RPM_BUILD_ROOT%{_libdir}/libiberty*
80 rm -f $RPM_BUILD_ROOT%{_mandir}/man7/*
81
82
83 %clean
84 rm -rf $RPM_BUILD_ROOT
85
86
87 %files
88 %defattr(-,root,root)
89 %{_prefix}/i686-pc-mingw32/lib/libiberty.a
90 %{_libdir}/gcc/i686-pc-mingw32
91 %{_libexecdir}/gcc/i686-pc-mingw32
92 %{_bindir}/i686-pc-mingw32-*
93 %{_mandir}/man1/i686-pc-mingw32-*
94
95
96 %changelog
97 * Mon Jul  7 2008 Richard W.M. Jones <rjones@redhat.com> - 4.3.1-1
98 - Initial RPM release, largely based on earlier work from several sources.