- Use ocamlc now that we have it.
[fedora-mingw.git] / ocaml-findlib / mingw32-ocaml-findlib.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 %define debug_package %{nil}
8
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.
13 #
14 # To use ocamlfind with the MinGW META files, do:
15 #
16 # OCAMLFIND_CONF=/etc/i686-pc-mingw32-ocamlfind.conf \
17 #   ocamlfind cmd ...
18
19 Name:           mingw32-ocaml-findlib
20 Version:        1.2.2
21 Release:        6%{?dist}
22 Summary:        MinGW Windows Objective CAML package manager and build helper
23
24 License:        BSD
25 Group:          Development/Libraries
26
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
30
31 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
32 BuildArch:      noarch
33
34 BuildRequires:  mingw32-filesystem >= 35
35 BuildRequires:  mingw32-gcc
36 BuildRequires:  mingw32-binutils
37 BuildRequires:  ocaml
38 BuildRequires:  ocaml-camlp4-devel
39 BuildRequires:  ocaml-labltk-devel
40 BuildRequires:  mingw32-ocaml >= 3.11.0+beta1-8
41 BuildRequires:  m4
42 BuildRequires:  gawk
43
44 # Early versions were accidentally misnamed.
45 Obsoletes:      mingw32-findlib <= 1.2.2-5
46
47
48 %description
49 Objective CAML package manager and build helper.
50
51
52 %prep
53 %setup -q -n findlib-%{version}
54
55
56 %build
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 \
69   -bindir %{_bindir} \
70   -sitelib `%{_mingw32_target}-ocamlopt -where` \
71   -mandir %{_mandir} \
72   -with-toolbox
73 make all
74 make opt
75 rm doc/guide-html/TIMESTAMP
76
77
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81
82 mkdir -p $RPM_BUILD_ROOT%{_bindir}
83 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
84
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}
87
88 # Remove documentation which is already available
89 # in the Fedora native package.
90 rm -r $RPM_BUILD_ROOT%{_mandir}/man[15]/
91
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
95
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
100
101 # XXX topfind gets installed as %{_libdir}/ocaml - not sure why
102 # but delete it anyway.
103 rm $RPM_BUILD_ROOT%{_libdir}/ocaml
104
105 # Override /etc/%{_mingw32_target}-ocamlfind.conf with our
106 # own version.
107 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
108 sed \
109   -e 's,@libdir@,%{_libdir},g' \
110   -e 's,@target@,%{_mingw32_target},g' \
111   < %{SOURCE1000} \
112   > $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
113
114
115 %clean
116 rm -rf $RPM_BUILD_ROOT
117
118
119 %files
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
133
134
135 %changelog
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.
139
140 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
141 - Initial RPM release.