Bump all spec releases for mass rebuild to mingw32-gcc 4.4
[fedora-mingw.git] / ocaml-curses / mingw32-ocaml-curses.spec
index 8557de8..90d06ec 100644 (file)
@@ -4,23 +4,16 @@
 %define __find_requires %{_mingw32_findrequires}
 %define __find_provides %{_mingw32_findprovides}
 
-# For versioning, please see the native Fedora package.
-%define alphatag 20020319
-
 Name:           mingw32-ocaml-curses
-Version:        0.1
-Release:        2%{?dist}
+Version:        1.0.3
+Release:        6%{?dist}
 Summary:        MinGW Windows OCaml bindings for ncurses
 
 License:        LGPLv2+
 Group:          Development/Libraries
 
 URL:            http://savannah.nongnu.org/projects/ocaml-tmk/
-Source0:        ocaml-curses-%{alphatag}.tar.gz
-
-# Patches for MinGW:
-Patch1000:      mingw32-ocaml-curses-0.1-build.patch
-Patch1001:      mingw32-ocaml-curses-0.1-win32-functions.patch
+Source0:        http://download.savannah.gnu.org/releases/ocaml-tmk/ocaml-curses-%{version}.tar.gz
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
@@ -28,56 +21,57 @@ BuildArch:      noarch
 BuildRequires:  mingw32-filesystem >= 35
 BuildRequires:  mingw32-gcc
 BuildRequires:  mingw32-binutils
-BuildRequires:  mingw32-ocaml >= 3.11.0+beta1-9
+BuildRequires:  mingw32-ocaml >= 3.11.0-0.15.beta1
+BuildRequires:  mingw32-ocaml-findlib
 BuildRequires:  mingw32-pdcurses
 
+# Upstream package doesn't come with a configure script so
+# we have to rebuild it.
+BuildRequires:  autoconf, automake, libtool
+
+Requires:       mingw32-pdcurses
+
 
 %description
 OCaml bindings for curses.
 
 
 %prep
-%setup -q -c -n %{name}-%{alphatag}
+%setup -q -n ocaml-curses-%{version}
 
-%patch1000 -p1
-%patch1001 -p1
+autoreconf
 
 
 %build
 ulimit -s unlimited
 
-cd curses
+%{_mingw32_configure}
 
-make \
-  OCAMLC=%{_mingw32_target}-ocamlopt \
+make all opt \
+  OCAMLC=%{_mingw32_target}-ocamlc \
   OCAMLOPT=%{_mingw32_target}-ocamlopt \
   OCAMLMKLIB=%{_mingw32_target}-ocamlmklib \
-  CURSES=%{_mingw32_libdir}/pdcurses.dll.a opt
+  OCAMLMKLIB_FLAGS="-L%{_mingw32_libdir}" \
+  CLIBS="" \
+  all opt
 
-cat > META <<EOF
-name = "curses"
-version = "%{version}"
-description = "OCaml bindings for ncurses"
-requires = ""
-archive(byte) = "mlcurses.cma"
-archive(native) = "mlcurses.cmxa"
-EOF
+# Build the test program just to check that everything is OK.
+%{_mingw32_target}-ocamlopt -I . \
+  -o test.opt \
+  curses.cmxa \
+  test.ml \
+  -cclib "-lpdcurses"
 
 
 %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
 
-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
-popd
+mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
+ocamlfind install curses META *.cmi *.cmx *.cmxa *.a *.mli
 
 
 %clean
@@ -87,9 +81,35 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root)
 %{_libdir}/%{_mingw32_target}-ocaml/curses/
-%{_libdir}/%{_mingw32_target}-ocaml/stublibs/dllmlcurses.dll
 
 
 %changelog
-* Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-2
+* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-6
+- Rebuild for mingw32-gcc 4.4
+
+* Sat Jan 24 2009 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-5
+- Force rebuild.
+
+* Sun Nov 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-4
+- Rebuild against newest OCaml cross-compiler.
+
+* Sat Nov 22 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-3
+- Rebuild against new pdcurses.
+
+* Mon Nov 17 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-2
+- Runtime requires PDCurses library.
+
+* Mon Nov 17 2008 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-1
+- New upstream version 1.0.3 with proper support for Windows
+  and PDCurses.
+
+* 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.