- Use ocamlfind to install in the correct location.
[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:        3%{?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-9
32 BuildRequires:  mingw32-ocaml-findlib
33 BuildRequires:  mingw32-pdcurses
34
35
36 %description
37 OCaml bindings for curses.
38
39
40 %prep
41 %setup -q -c -n %{name}-%{alphatag}
42
43 %patch1000 -p1
44 %patch1001 -p1
45
46
47 %build
48 ulimit -s unlimited
49
50 cd curses
51
52 make \
53   OCAMLC=%{_mingw32_target}-ocamlopt \
54   OCAMLOPT=%{_mingw32_target}-ocamlopt \
55   OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \
56   CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt
57
58 cat > META <<EOF
59 name = "curses"
60 version = "%{version}"
61 description = "OCaml bindings for ncurses"
62 requires = ""
63 archive(byte) = "mlcurses.cma"
64 archive(native) = "mlcurses.cmxa"
65 EOF
66
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70
71 export OCAMLFIND_CONF=%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
72 export DESTDIR=$RPM_BUILD_ROOT
73 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
74
75 mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
76 pushd curses
77 ocamlfind install curses META *.cmi *.cmx *.cmxa *.a *.mli
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
89
90 %changelog
91 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.1-3
92 - Use ocamlfind to install in the correct location.
93 - Install the META file.
94 - Fix the version number in changelog.
95
96 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.1-2
97 - Initial release.