--- /dev/null
+--- Makefile.orig 2008-11-15 22:09:17.000000000 +0000
++++ Makefile 2008-11-15 22:10:32.000000000 +0000
+@@ -2,7 +2,7 @@
+ # http://tech.motion-twin.com
+ .SUFFIXES : .ml .mli .cmo .cmx .cmi .mll .mly
+
+-INSTALLDIR=`ocamlc -where`
++INSTALLDIR=`ocamlopt -where`
+ CFLAGS=
+ LFLAGS= -a
+ LIBS=
+@@ -33,13 +33,13 @@
+ ocamlc xml-light.cma test.ml -o test.exe
+
+ test_opt.exe: xml-light.cmxa
+- ocamlopt xml-light.cmxa test.ml -o test_opt.exe
++ i686-pc-mingw32-ocamlopt xml-light.cmxa test.ml -o test_opt.exe
+
+ xml-light.cma: xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo
+ ocamlc -o xml-light.cma $(LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo
+
+ xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx
+- ocamlopt -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx
++ i686-pc-mingw32-ocamlopt -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx
+
+ dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi
+
+@@ -84,10 +84,10 @@
+ ocamlc $(CFLAGS) -c $<
+
+ .ml.cmx:
+- ocamlopt $(CFLAGS) -c $<
++ i686-pc-mingw32-ocamlopt $(CFLAGS) -c $<
+
+ .mli.cmi:
+- ocamlc $(CFLAGS) $<
++ i686-pc-mingw32-ocamlopt $(CFLAGS) $<
+
+ .mll.ml:
+ ocamllex $<
--- /dev/null
+%define __strip %{_mingw32_strip}
+%define __objdump %{_mingw32_objdump}
+%define _use_internal_dependency_generator 0
+%define __find_requires %{_mingw32_findrequires}
+%define __find_provides %{_mingw32_findprovides}
+
+Name: mingw32-ocaml-xml-light
+Version: 2.2.cvs20070817
+Release: 1%{?dist}
+Summary: MinGW Windows minimal XML parser and printer for OCaml
+
+License: LGPLv2+
+Group: Development/Libraries
+
+URL: http://tech.motion-twin.com/xmllight.html
+Source0: xml-light-%{version}.tar.gz
+
+# Patches for MinGW:
+Patch1000: mingw32-ocaml-xml-light-2.2-build.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+
+BuildRequires: mingw32-filesystem >= 35
+BuildRequires: mingw32-gcc
+BuildRequires: mingw32-binutils
+BuildRequires: mingw32-ocaml
+
+
+%description
+Xml-Light is a minimal XML parser & printer for OCaml. It provides
+functions to parse an XML document into an OCaml data structure, work
+with it, and print it back to an XML document. It support also DTD
+parsing and checking, and is entirely written in OCaml, hence it does
+not require additional C library.
+
+
+%prep
+%setup -q -c -n %{name}-%{version}
+
+%patch1000 -p0
+
+
+%build
+make opt
+sed -e 's/@VERSION@/%{VERSION}/' < META.in > META
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/xml-light
+
+install xml-light.cmxa xml-light.a *.mli *.cmi *.cmx \
+ $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/xml-light
+install META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/xml-light
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root)
+%{_libdir}/%{_mingw32_target}-ocaml/xml-light/
+
+
+%changelog
+* Sat Nov 15 2008 Richard W.M. Jones <rjones@redhat.com> - 2.2cvs20070817-1
+- Initial RPM release.