Added mingw32-ocaml-curses.
[fedora-mingw.git] / ocaml-curses / mingw32-ocaml-curses.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 # For versioning, please see the native Fedora package.
8 %define alphatag 20020319
9
10 Name:           mingw32-ocaml-curses
11 Version:        0.1
12 Release:        1%{?dist}
13 Summary:        MinGW Windows OCaml bindings for ncurses
14
15 License:        LGPLv2+
16 Group:          Development/Libraries
17
18 URL:            http://savannah.nongnu.org/projects/ocaml-tmk/
19 Source0:        ocaml-curses-%{alphatag}.tar.gz
20
21 # Patches for MinGW:
22 Patch1000:      mingw32-ocaml-curses-0.1-build.patch
23 Patch1001:      mingw32-ocaml-curses-0.1-win32-functions.patch
24
25 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
26 BuildArch:      noarch
27
28 BuildRequires:  mingw32-filesystem >= 35
29 BuildRequires:  mingw32-gcc
30 BuildRequires:  mingw32-binutils
31 BuildRequires:  mingw32-ocaml >= 3.11.0+beta1-6
32 BuildRequires:  mingw32-pdcurses
33
34
35 %description
36 OCaml bindings for curses.
37
38
39 %prep
40 %setup -q -c -n %{name}-%{alphatag}
41
42 %patch1000 -p1
43 %patch1001 -p1
44
45
46 %build
47 cd curses
48
49 make \
50   OCAMLC=%{_mingw32_target}-ocamlopt \
51   OCAMLOPT=%{_mingw32_target}-ocamlopt \
52   OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \
53   CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt
54
55 cat > META <<EOF
56 name = "curses"
57 version = "%{version}"
58 description = "OCaml bindings for ncurses"
59 requires = ""
60 archive(byte) = "mlcurses.cma"
61 archive(native) = "mlcurses.cmxa"
62 EOF
63
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67
68 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
69 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
70 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
71
72 pushd curses
73 install mlcurses.cmxa mlcurses.a *.cmi *.cmx *.mli \
74   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
75 # XXX Not really clear if this file is necessary.
76 install dllmlcurses.dll \
77   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
78 popd
79
80
81 %clean
82 rm -rf $RPM_BUILD_ROOT
83
84
85 %files
86 %defattr(-,root,root)
87 %{_libdir}/%{_mingw32_target}-ocaml/curses/
88 %{_libdir}/%{_mingw32_target}-ocaml/stublibs/dllmlcurses.dll
89
90
91 %changelog
92 * Thu Nov 13 2008 Your Name <you@example.com> - 1.2.3-1
93 - Initial RPM release.