Elementary mistake.
[fedora-mingw.git] / ocaml / mingw32-ocaml.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-ocaml
8 Version:        3.11.0+beta1
9 Release:        1%{?dist}
10 Summary:        Objective Caml MinGW cross-compiler and programming environment
11
12 License:        QPL and (LGPLv2+ with exceptions)
13 Group:          Development/Libraries
14 URL:            http://caml.inria.fr/
15 Source0:        http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-%{version}.tar.bz2
16 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
17
18 BuildArch:      noarch
19
20 BuildRequires:  mingw32-filesystem >= 30
21 BuildRequires:  mingw32-gcc
22 BuildRequires:  mingw32-binutils
23
24
25 %description
26 Objective Caml is a high-level, strongly-typed, functional and
27 object-oriented programming language from the ML family of languages.
28
29 This package is an OCaml cross-compiler which runs natively on Fedora
30 and produces Windows native executables.
31
32
33 %prep
34 %setup -q -n ocaml-%{version}
35
36
37 %build
38 # Remember that we're _not_ cross-compiling OCaml itself, we're trying
39 # to build a Fedora native OCaml compiler (ocamlopt) which just has
40 # the back-end part modified to generate Windows binaries.  So we
41 # build as normal on a Unix system, but we make sure that ocamlopt
42 # will use the Windows codegen and the MinGW assembler and linker.
43
44 CFLAGS="$RPM_OPT_FLAGS" \
45 ./configure \
46   -bindir %{_bindir} \
47   -libdir %{_libdir}/ocaml \
48   -x11lib %{_libdir} \
49   -x11include %{_includedir} \
50   -mandir %{_mandir}/man1 \
51   -cc %{_mingw32_cc} \
52   -as %{_mingw32_as}
53
54 # ./configure creates the following files:
55 #     config/Makefile - containing mainly paths and names of build tools
56 #     config/m.h - containing the machine description
57 #     config/s.h - containing the environment / API description
58
59 # Overwrite the generated m.h & s.h with the ones from Windows NT.
60 cp config/m-nt.h config/m.h
61 cp config/s-nt.h config/s.h
62
63 make world bootstrap opt opt.opt
64
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 make DESTDIR=$RPM_BUILD_ROOT install
69
70 # Remove static libraries but DON'T remove *.dll.a files.
71 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libfoo.a
72
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77
78 %files
79 %defattr(-,root,root)
80 %{_mingw32_bindir}/foo.dll
81 %{_mingw32_libdir}/foo.dll.a
82 # etc.
83
84
85 %changelog
86 * Fri Nov 14 2008 Richard W.M. Jones <rjones@redhat.com> - 3.11.0+beta1-1
87 - Initial RPM release.