Packages moved to Fedora.
[fedora-mingw.git] / ocaml-extlib / mingw32-ocaml-extlib.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-extlib
8 Version:        1.5.1
9 Release:        4%{?dist}
10 Summary:        MinGW Windows port of OCaml ExtLib
11
12 License:        LGPLv2+ with exceptions
13 Group:          Development/Libraries
14
15 URL:            http://code.google.com/p/ocaml-extlib/
16 Source0:        http://ocaml-extlib.googlecode.com/files/extlib-%{version}.tar.gz
17
18 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
19 BuildArch:      noarch
20
21 BuildRequires:  mingw32-filesystem >= 35
22 BuildRequires:  mingw32-gcc
23 BuildRequires:  mingw32-binutils
24 BuildRequires:  mingw32-ocaml >= 3.11.0-0.15.beta1
25
26
27 %description
28 ExtLib is a project aiming at providing a complete - yet small -
29 standard library for the OCaml programming language. The purpose of
30 this library is to add new functions to OCaml Standard Library
31 modules, to modify some functions in order to get better performances
32 or more safety (tail-recursive) but also to provide new modules which
33 should be useful for the average OCaml programmer.
34
35
36 %prep
37 %setup -q -n extlib-%{version}
38
39 # Files in the archive have spurious +x mode.
40 chmod 0644 *
41
42 # and DOS line endings.
43 for f in *.ml *.mli README.txt LICENSE; do \
44   %{__sed} -i 's/\r//' $f;
45 done
46
47
48 %build
49 # Extlib build system is on crack and unusable for cross-compiling.
50 # We ignore it completely and do the build steps by hand.  This
51 # list of modules should match the list in 'install.ml'.
52 %define modules enum bitSet dynArray extArray extHashtbl extList extString global IO option pMap std uChar uTF8 base64 unzip refList optParse dllist
53
54 i686-pc-mingw32-ocamlopt -c \
55   $(for f in %{modules}; do echo $f.mli; done)
56 i686-pc-mingw32-ocamlopt -c \
57   $(for f in %{modules}; do echo $f.ml; done)
58 i686-pc-mingw32-ocamlopt -a -o extLib.cmxa \
59   $(for f in %{modules}; do echo $f.cmx; done)
60
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64
65 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
66 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/extlib
67
68 install $(for f in %{modules}; do echo $f.mli $f.cmx $f.cmi; done) \
69   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/extlib
70 install extLib.cmxa extLib.a \
71   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/extlib
72 install META.txt \
73   $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/extlib/META
74
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79
80 %files
81 %defattr(-,root,root)
82 %{_libdir}/%{_mingw32_target}-ocaml/extlib
83
84
85 %changelog
86 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 1.5.1-4
87 - Rebuild for mingw32-gcc 4.4
88
89 * Sun Nov 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.5.1-3
90 - Rebuild with latest OCaml cross-compiler.
91
92 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.5.1-2
93 - Force rebuild against latest OCaml compiler.
94
95 * Sat Nov 15 2008 Richard W.M. Jones <rjones@redhat.com> - 1.5.1-1
96 - Initial RPM release.