From 022c5a8fbb914166fcaeeb775f73cfa504a57e88 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Added ocaml-csv --- .hgignore | 1 + ocaml-csv/csv-extlib.patch | 32 ++++++++++++++++ ocaml-csv/csv-install.patch | 15 ++++++++ ocaml-csv/mingw32-ocaml-csv.spec | 81 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 ocaml-csv/csv-extlib.patch create mode 100644 ocaml-csv/csv-install.patch create mode 100644 ocaml-csv/mingw32-ocaml-csv.spec diff --git a/.hgignore b/.hgignore index f1cee45..63c8b53 100644 --- 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 index 0000000..96e10b0 --- /dev/null +++ b/ocaml-csv/csv-extlib.patch @@ -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 index 0000000..477b2cf --- /dev/null +++ b/ocaml-csv/csv-install.patch @@ -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 index 0000000..0cf54c6 --- /dev/null +++ b/ocaml-csv/mingw32-ocaml-csv.spec @@ -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 - 1.1.7-1 +- Initial RPM release. -- 1.8.3.1