Added ocaml-csv
[fedora-mingw.git] / ocaml-csv / mingw32-ocaml-csv.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 Name:           mingw32-ocaml-csv
8 Version:        1.1.7
9 Release:        1%{?dist}
10 Summary:        MinGW Windows OCaml library for reading and writing CSV files
11
12 License:        LGPLv2+
13 Group:          Development/Libraries
14
15 URL:            http://merjis.com/developers/csv
16 Source0:        http://merjis.com/_file/ocaml-csv-%{version}.tar.gz
17
18 # Patches from native Fedora package:
19 Patch0:         csv-extlib.patch
20 Patch1:         csv-install.patch
21
22 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
23 BuildArch:      noarch
24
25 BuildRequires:  mingw32-filesystem >= 35
26 BuildRequires:  mingw32-gcc
27 BuildRequires:  mingw32-binutils
28 BuildRequires:  mingw32-ocaml
29 BuildRequires:  mingw32-ocaml-extlib
30
31
32 %description
33 This OCaml library can read and write CSV files, including all
34 extensions used by Excel - eg. quotes, newlines, 8 bit characters in
35 fields, quote-0 etc.
36
37 The library comes with a handy command line tool called csvtool for
38 handling CSV files from shell scripts.
39
40
41 %prep
42 %setup -q -n ocaml-csv-%{version}
43
44 %patch0 -p0
45 %patch1 -p1
46
47
48 %build
49 %{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa -c csv.mli
50 %{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa -c csv.ml
51 %{_mingw32_target}-ocamlopt -a -o csv.cmxa csv.cmx
52 %{_mingw32_target}-ocamlopt -I +extlib extLib.cmxa csv.cmxa csvtool.ml \
53   -o csvtool.exe
54
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58
59 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
60 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
61
62 install csv.cmxa *.a *.mli *.cmi *.cmx \
63   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
64 install META $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/csv
65
66 install csvtool.exe $RPM_BUILD_ROOT%{_mingw32_bindir}
67
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72
73 %files
74 %defattr(-,root,root)
75 %{_mingw32_bindir}/csvtool.exe
76 %{_libdir}/%{_mingw32_target}-ocaml/csv
77
78
79 %changelog
80 * Sat Nov 15 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-1
81 - Initial RPM release.