Better linking of ocaml-curses library.
[fedora-mingw.git] / ocaml-curses / mingw32-ocaml-curses.spec
index b6b8a8f..e027f5e 100644 (file)
@@ -9,7 +9,7 @@
 
 Name:           mingw32-ocaml-curses
 Version:        0.1
-Release:        1%{?dist}
+Release:        4%{?dist}
 Summary:        MinGW Windows OCaml bindings for ncurses
 
 License:        LGPLv2+
@@ -28,7 +28,8 @@ BuildArch:      noarch
 BuildRequires:  mingw32-filesystem >= 35
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-binutils
-BuildRequires:  mingw32-ocaml >= 3.11.0+beta1-6
+BuildRequires:  mingw32-ocaml >= 3.11.0+beta1-9
+BuildRequires:  mingw32-ocaml-findlib
 BuildRequires:  mingw32-pdcurses
 
 
@@ -44,13 +45,15 @@ OCaml bindings for curses.
 
 
 %build
+ulimit -s unlimited
+
 cd curses
 
 make \
   OCAMLC=%{_mingw32_target}-ocamlopt \
   OCAMLOPT=%{_mingw32_target}-ocamlopt \
   OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \
-  CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt
+  CURSES="" opt
 
 cat > META <<EOF
 name = "curses"
@@ -65,16 +68,13 @@ EOF
 %install
 rm -rf $RPM_BUILD_ROOT
 
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
+export OCAMLFIND_CONF=%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
+export DESTDIR=$RPM_BUILD_ROOT
+export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
 
+mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
 pushd curses
-install mlcurses.cmxa mlcurses.a *.cmi *.cmx *.mli \
-  $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/curses
-# XXX Not really clear if this file is necessary.
-install dllmlcurses.dll \
-  $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs
+ocamlfind install curses META *.cmi *.cmx *.cmxa *.a *.mli
 popd
 
 
@@ -85,9 +85,16 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root)
 %{_libdir}/%{_mingw32_target}-ocaml/curses/
-%{_libdir}/%{_mingw32_target}-ocaml/stublibs/dllmlcurses.dll
 
 
 %changelog
-* Thu Nov 13 2008 Your Name <you@example.com> - 1.2.3-1
-- Initial RPM release.
+* Mon Nov 17 2008 Richard W.M. Jones <rjones@redhat.com> - 0.1-4
+- libmlcurses.a contained a copy of pdcurses.dll.a in error.
+
+* Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.1-3
+- Use ocamlfind to install in the correct location.
+- Install the META file.
+- Fix the version number in changelog.
+
+* Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.1-2
+- Initial release.