smock: Document how to use it without httpd
[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.3
21 Release:        2%{?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-0.15.beta1
41 BuildRequires:  m4
42 BuildRequires:  gawk
43
44 # Installing this should pull in ocamlfind (native binary).
45 Requires:       ocaml-findlib
46
47 # Early versions were accidentally misnamed.
48 Obsoletes:      mingw32-findlib <= 1.2.2-5
49
50
51 %description
52 Objective CAML package manager and build helper.
53
54
55 %prep
56 %setup -q -n findlib-%{version}
57
58
59 %build
60 %{_mingw32_target}-ocamlopt -version
61 %{_mingw32_target}-ocamlopt -where
62 (cd tools/extract_args && make)
63 tools/extract_args/extract_args -o src/findlib/ocaml_args.ml \
64   %{_mingw32_target}-ocamlc \
65   %{_mingw32_target}-ocamlcp \
66   %{_mingw32_target}-ocamlmktop \
67   %{_mingw32_target}-ocamlopt \
68   %{_mingw32_target}-ocamldep \
69   %{_mingw32_target}-ocamldoc ||:
70 cat src/findlib/ocaml_args.ml
71 ./configure -config %{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf \
72   -bindir %{_bindir} \
73   -sitelib `%{_mingw32_target}-ocamlopt -where` \
74   -mandir %{_mandir} \
75   -with-toolbox
76 make all
77 make opt
78 rm doc/guide-html/TIMESTAMP
79
80
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84
85 mkdir -p $RPM_BUILD_ROOT%{_bindir}
86 mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml
87
88 make install prefix=$RPM_BUILD_ROOT OCAMLFIND_BIN=$RPM_BUILD_ROOT%{_bindir}
89 mv $RPM_BUILD_ROOT/$RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_bindir}
90
91 # Remove documentation which is already available
92 # in the Fedora native package.
93 rm -r $RPM_BUILD_ROOT%{_mandir}/man[15]/
94
95 # Remove ocamlfind binary - we will use the native version.
96 rm $RPM_BUILD_ROOT%{_bindir}/ocamlfind
97 rm $RPM_BUILD_ROOT%{_bindir}/safe_camlp4
98
99 # Remove findlib & num-top libs: if anything uses these we can
100 # add them back later.
101 rm -r $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/findlib
102 rm -r $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/num-top
103
104 # XXX topfind gets installed as %{_libdir}/ocaml - not sure why
105 # but delete it anyway.
106 rm $RPM_BUILD_ROOT%{_libdir}/ocaml
107
108 # Override /etc/%{_mingw32_target}-ocamlfind.conf with our
109 # own version.
110 rm $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
111 sed \
112   -e 's,@libdir@,%{_libdir},g' \
113   -e 's,@target@,%{_mingw32_target},g' \
114   < %{SOURCE1000} \
115   > $RPM_BUILD_ROOT%{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
116
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121
122 %files
123 %defattr(-,root,root)
124 %config %{_sysconfdir}/%{_mingw32_target}-ocamlfind.conf
125 %{_libdir}/%{_mingw32_target}-ocaml/bigarray/META
126 %{_libdir}/%{_mingw32_target}-ocaml/camlp4/META
127 %{_libdir}/%{_mingw32_target}-ocaml/dbm/META
128 %{_libdir}/%{_mingw32_target}-ocaml/dynlink/META
129 %{_libdir}/%{_mingw32_target}-ocaml/graphics/META
130 %{_libdir}/%{_mingw32_target}-ocaml/labltk/META
131 %{_libdir}/%{_mingw32_target}-ocaml/num/META
132 %{_libdir}/%{_mingw32_target}-ocaml/stdlib/META
133 %{_libdir}/%{_mingw32_target}-ocaml/str/META
134 %{_libdir}/%{_mingw32_target}-ocaml/threads/META
135 %{_libdir}/%{_mingw32_target}-ocaml/unix/META
136
137
138 %changelog
139 * Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-2
140 - Rebuild for mingw32-gcc 4.4
141
142 * Sun Nov 23 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.3-1
143 - New upstream release 1.2.3.
144 - Rebuild against the latest OCaml cross-compiler.
145
146 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-8
147 - Force rebuild against latest OCaml compiler.
148
149 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-7
150 - Use ocamlc now that we have it.
151 - Rename package correctly.
152 - Pull in ocamlfind binary.
153
154 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-3
155 - Initial RPM release.