Moved to Fedora.
[fedora-mingw.git] / darwinx-gcc / darwinx-gcc.spec
1 %define gcc_major 4
2 %define gcc_minor 2
3 %define apple_build 5566
4
5 Name:           darwinx-gcc
6 Version:        %{gcc_major}.%{gcc_minor}
7 Release:        0.%{apple_build}.1%{?dist}
8 Summary:        Darwin (Mac OS X) GCC cross-compiler
9
10 License:        GPLv2+
11 Group:          Development/Libraries
12
13 URL:            http://www.opensource.apple.com/darwinsource/
14 Source0:        http://www.opensource.apple.com/darwinsource/tarballs/other/gcc_%{gcc_major}%{gcc_minor}-%{apple_build}.tar.gz
15
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17 BuildArch:      noarch
18
19 BuildRequires:  darwinx-filesystem >= 1
20 BuildRequires:  darwinx-odcctools
21 BuildRequires:  darwinx-headers
22
23
24 %description
25 This is a GCC-based cross-compiler which creates Darwin (Mac OS X)
26 programs.  This is a port of Apple's GCC %{gcc_major}.%{gcc_minor} from Xcode
27 (build %{apple_build}).
28
29
30 %prep
31 %setup -q -n gcc_%{gcc_major}%{gcc_minor}-%{apple_build}
32
33
34 %build
35
36 languages="c,c++,objc,obj-c++"
37
38 for arch in powerpc i386; do
39   mkdir build-${arch}
40   pushd build-${arch}
41
42   CC="%{__cc} ${RPM_OPT_FLAGS}" \
43   ../configure \
44     --prefix=%{_prefix} \
45     --bindir=%{_bindir} \
46     --includedir=%{_includedir} \
47     --libdir=%{_libdir} \
48     --mandir=%{_mandir} \
49     --infodir=%{_infodir} \
50     --datadir=%{_datadir} \
51     --build=%_build --host=%_host \
52     --target=${arch}-apple-darwin8 \
53     --verbose \
54     --without-newlib \
55     --disable-multilib \
56     --with-system-zlib \
57     --disable-nls --without-included-gettext \
58     --disable-win32-registry \
59     --enable-languages="$languages" $optargs
60
61 #    --with-sysroot=%{_prefix}/$arch-apple-darwin8
62
63   make %{?_smp_mflags}
64
65   popd
66 done
67
68 exit 1
69
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 make DESTDIR=$RPM_BUILD_ROOT install
74
75 # Remove static libraries but DON'T remove *.dll.a files.
76 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libfoo.a
77
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82
83 %files
84 %defattr(-,root,root)
85 %doc LICENSE
86 %{_mingw32_bindir}/foo.dll
87 %{_mingw32_libdir}/foo.dll.a
88 # etc.
89
90
91 %changelog
92 * Fri Jan 23 2009 Your Name <you@example.com> - 1.2.3-1
93 - Initial RPM release.