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}
7 %define debug_package %{nil}
9 # Findlib is a build tool, and we don't need to cross-compile it
10 # (except arguably the findlib library, but no one really uses that).
11 # However we do need the MinGW-specific META files in the right
12 # places, and that is what this package contains.
14 # To use ocamlfind with the MinGW META files, do:
16 # OCAMLFIND_CONF=/etc/i686-pc-mingw32-ocamlfind.conf \
19 Name: mingw32-ocaml-findlib
22 Summary: MinGW Windows Objective CAML package manager and build helper
25 Group: Development/Libraries
27 URL: http://projects.camlcity.org/projects/findlib.html
28 Source0: http://download.camlcity.org/download/findlib-%{version}.tar.gz
29 Source1000: ocamlfind.conf.in
31 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
34 BuildRequires: mingw32-filesystem >= 35
35 BuildRequires: mingw32-gcc
36 BuildRequires: mingw32-binutils
38 BuildRequires: ocaml-camlp4-devel
39 BuildRequires: ocaml-labltk-devel
40 BuildRequires: mingw32-ocaml >= 3.11.0+beta1-8
44 # Early versions were accidentally misnamed.
45 Obsoletes: mingw32-findlib <= 1.2.2-5
49 Objective CAML package manager and build helper.
53 %setup -q -n findlib-%{version}
57 %{_mingw32_target}-ocamlopt -version
58 %{_mingw32_target}-ocamlopt -where
59 (cd tools/extract_args && make)
60 tools/extract_args/extract_args -o src/findlib/ocaml_args.ml \
61 %{_mingw32_target}-ocamlc \
62 %{_mingw32_target}-ocamlcp \
63 %{_mingw32_target}-ocamlmktop \
64 %{_mingw32_target}-ocamlopt \
65 %{_mingw32_target}-ocamldep \
66 %{_mingw32_target}-ocamldoc ||:
67 cat src/findlib/ocaml_args.ml
68 ./configure -config %{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf \
70 -sitelib `%{_mingw32_target}-ocamlopt -where` \
75 rm doc/guide-html/TIMESTAMP
80 rm -rf $RPM_BUILD_ROOT
82 mkdir -p $RPM_BUILD_ROOT%{_bindir}
83 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
85 make install prefix=$RPM_BUILD_ROOT OCAMLFIND_BIN=$RPM_BUILD_ROOT%{_bindir}
86 mv $RPM_BUILD_ROOT/$RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_bindir}
88 # Remove documentation which is already available
89 # in the Fedora native package.
90 rm -r $RPM_BUILD_ROOT%{_mandir}/man[15]/
92 # Remove ocamlfind binary - we will use the native version.
93 rm $RPM_BUILD_ROOT%{_bindir}/ocamlfind
94 rm $RPM_BUILD_ROOT%{_bindir}/safe_camlp4
96 # Remove findlib & num-top libs: if anything uses these we can
97 # add them back later.
98 rm -r $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/findlib
99 rm -r $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/num-top
101 # XXX topfind gets installed as %{_libdir}/ocaml - not sure why
102 # but delete it anyway.
103 rm $RPM_BUILD_ROOT%{_libdir}/ocaml
105 # Override /etc/%{_mingw32_target}-ocamlfind.conf with our
107 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
109 -e 's,@libdir@,%{_libdir},g' \
110 -e 's,@target@,%{_mingw32_target},g' \
112 > $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
116 rm -rf $RPM_BUILD_ROOT
120 %defattr(-,root,root)
121 %config %{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
122 %{_libdir}/%{_mingw32_target}-ocaml/bigarray/META
123 %{_libdir}/%{_mingw32_target}-ocaml/camlp4/META
124 %{_libdir}/%{_mingw32_target}-ocaml/dbm/META
125 %{_libdir}/%{_mingw32_target}-ocaml/dynlink/META
126 %{_libdir}/%{_mingw32_target}-ocaml/graphics/META
127 %{_libdir}/%{_mingw32_target}-ocaml/labltk/META
128 %{_libdir}/%{_mingw32_target}-ocaml/num/META
129 %{_libdir}/%{_mingw32_target}-ocaml/stdlib/META
130 %{_libdir}/%{_mingw32_target}-ocaml/str/META
131 %{_libdir}/%{_mingw32_target}-ocaml/threads/META
132 %{_libdir}/%{_mingw32_target}-ocaml/unix/META
136 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-6
137 - Use ocamlc now that we have it.
138 - Rename package correctly.
140 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
141 - Initial RPM release.