Added ocaml-csv
authorRichard W.M. Jones <rjones@redhat.com>
Sat, 15 Nov 2008 21:46:47 +0000 (21:46 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Sat, 15 Nov 2008 21:46:47 +0000 (21:46 +0000)
.hgignore
ocaml-csv/csv-extlib.patch [new file with mode: 0644]
ocaml-csv/csv-install.patch [new file with mode: 0644]
ocaml-csv/mingw32-ocaml-csv.spec [new file with mode: 0644]

index f1cee45..63c8b53 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -80,6 +80,7 @@ ocaml/*.exe
 ocaml/*.cmi
 ocaml/*.cmx
 ocaml/*.o
+ocaml-csv/ocaml-csv-1.1.7.tar.gz
 ocaml-extlib/extlib-1.5.1.tar.gz
 ocaml-extlib/NUL
 ocaml-extlib/test1
diff --git a/ocaml-csv/csv-extlib.patch b/ocaml-csv/csv-extlib.patch
new file mode 100644 (file)
index 0000000..96e10b0
--- /dev/null
@@ -0,0 +1,32 @@
+--- csv.ml.orig        2007-05-29 13:07:33.000000000 +0100
++++ csv.ml     2007-05-29 13:07:44.000000000 +0100
+@@ -45,7 +45,7 @@
+ (* Uncomment the next line to enable Extlib's List function.  These
+  * avoid stack overflows on really huge CSV files.
+  *)
+-(*open ExtList*)
++open ExtList
+ type t = string list list
+--- Makefile.orig      2007-05-29 13:11:36.000000000 +0100
++++ Makefile   2007-05-29 13:11:53.000000000 +0100
+@@ -6,15 +6,15 @@
+ # of file csv.ml.
+ OCAMLCINCS    :=
+-#OCAMLCINCS   := -package extlib
++OCAMLCINCS    := -package extlib
+ OCAMLCFLAGS   := -g
+ OCAMLCLIBS    :=
+-#OCAMLCLIBS   := -linkpkg
++OCAMLCLIBS    := -linkpkg
+ OCAMLOPTINCS  := $(OCAMLCINCS)
+ OCAMLOPTFLAGS :=
+ OCAMLOPTLIBS  :=
+-#OCAMLOPTLIBS := -linkpkg
++OCAMLOPTLIBS  := -linkpkg
+ OBJS          := csv.cmo
+ XOBJS         := $(OBJS:.cmo=.cmx)
diff --git a/ocaml-csv/csv-install.patch b/ocaml-csv/csv-install.patch
new file mode 100644 (file)
index 0000000..477b2cf
--- /dev/null
@@ -0,0 +1,15 @@
+Binary files ocaml-csv-1.1.7.orig/csv.a and ocaml-csv-1.1.7/csv.a differ
+diff -ur ocaml-csv-1.1.7.orig/Makefile ocaml-csv-1.1.7/Makefile
+--- ocaml-csv-1.1.7.orig/Makefile      2008-10-27 22:04:21.000000000 +0000
++++ ocaml-csv-1.1.7/Makefile   2008-10-27 22:06:47.000000000 +0000
+@@ -70,7 +70,8 @@
+ # Build a distribution.
+ install:
+-      ocamlfind install csv csv.{cmi,a,cmxa,cma,cmx} META
++      ocamlfind install csv csv.{cmi,a,cmxa,cma,cmx,mli} META
++      install -m 0755 csvtool $(DESTDIR)/usr/bin
+ dist:
+       $(MAKE) check-manifest
+Only in ocaml-csv-1.1.7.orig: README
diff --git a/ocaml-csv/mingw32-ocaml-csv.spec b/ocaml-csv/mingw32-ocaml-csv.spec
new file mode 100644 (file)
index 0000000..0cf54c6
--- /dev/null
@@ -0,0 +1,81 @@
+%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-csv
+Version:        1.1.7
+Release:        1%{?dist}
+Summary:        MinGW Windows OCaml library for reading and writing CSV files
+
+License:        LGPLv2+
+Group:          Development/Libraries
+
+URL:            http://merjis.com/developers/csv
+Source0:        http://merjis.com/_file/ocaml-csv-%{version}.tar.gz
+
+# Patches from native Fedora package:
+Patch0:         csv-extlib.patch
+Patch1:         csv-install.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
+BuildRequires:  mingw32-ocaml-extlib
+
+
+%description
+This OCaml library can read and write CSV files, including all
+extensions used by Excel - eg. quotes, newlines, 8 bit characters in
+fields, quote-0 etc.
+
+The library comes with a handy command line tool called csvtool for
+handling CSV files from shell scripts.
+
+
+%prep
+%setup -q -n ocaml-csv-%{version}
+
+%patch0 -p0
+%patch1 -p1
+
+
+%build
+%{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa -c csv.mli
+%{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa -c csv.ml
+%{_mingw32_target}-ocamlopt -a -o csv.cmxa csv.cmx
+%{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa csv.cmxa csvtool.ml \
+  -o csvtool.exe
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
+mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
+
+install csv.cmxa *.a *.mli *.cmi *.cmx \
+  $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
+install META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
+
+install csvtool.exe $RPM_BUILD_ROOT%{_mingw32_bindir}
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root)
+%{_mingw32_bindir}/csvtool.exe
+%{_libdir}/%{_mingw32_target}-ocaml/csv
+
+
+%changelog
+* Sat Nov 15 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-1
+- Initial RPM release.