7f05cca67c7d6865722be1a2678ea865910b7ef5
[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 ulimit -s unlimited
48
49 cd curses
50
51 make \
52   OCAMLC=%{_mingw32_target}-ocamlopt \
53   OCAMLOPT=%{_mingw32_target}-ocamlopt \
54   OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \
55   CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt
56
57 cat > META <<EOF
58 name = "curses"
59 version = "%{version}"
60 description = "OCaml bindings for ncurses"
61 requires = ""
62 archive(byte) = "mlcurses.cma"
63 archive(native) = "mlcurses.cmxa"
64 EOF
65
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69
70 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
71 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
72 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
73
74 pushd curses
75 install mlcurses.cmxa mlcurses.a *.cmi *.cmx *.mli \
76   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
77 # XXX Not really clear if this file is necessary.
78 install dllmlcurses.dll \
79   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
80 popd
81
82
83 %clean
84 rm -rf $RPM_BUILD_ROOT
85
86
87 %files
88 %defattr(-,root,root)
89 %{_libdir}/%{_mingw32_target}-ocaml/curses/
90 %{_libdir}/%{_mingw32_target}-ocaml/stublibs/dllmlcurses.dll
91
92
93 %changelog
94 * Thu Nov 13 2008 Your Name <you@example.com> - 1.2.3-1
95 - Initial RPM release.