3 %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
6 # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
7 %undefine with_ocaml_opt
10 %define ocaml_ver 1:3.09.2
11 Summary: CamlIDL is a stub code generator and COM binding for Objective Caml
12 Summary(pl.UTF-8): Wiązania IDL dla OCamla
16 License: QPL v1.0 (compiler), LGPL v2 (library)
18 Source0: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.tar.gz
19 # Source0-md5: 4cfb863bc3cbdc1af2502042c45cc675
20 Source1: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.doc.html.tar.gz
21 # Source1-md5: b7c7dad3ba62ddcc0f687bdebe295126
23 URL: http://caml.inria.fr/pub/old_caml_site/camlidl/
24 BuildRequires: ocaml >= %{ocaml_ver}
25 Obsoletes: ocaml-camlidl < 1.05-3
26 %requires_eq ocaml-runtime
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Camlidl is a stub code generator for Objective Caml. It generates stub
31 code for interfacing Caml with C from an IDL description of the C
32 functions. Thus, Camlidl automates the most tedious task in
33 interfacing C libraries with Caml programs. It can also be used to
34 interface Caml programs with other languages, as long as those
35 languages have a well-defined C interface.
37 This package contains files needed to run bytecode executables using
40 %description -l pl.UTF-8
41 Camlidl jest generatorem kodu łączącego C z OCamlem. Pozwala on na
42 automatyczne tworzenie funkcji, które będą mogły być wywoływane z
43 OCamla na podstawie opisu IDL. Automatyzuje więc najbardziej
44 niewdzięczne aspekty odwoływania się do bibliotek napisanych w C z
45 OCamla. Może być również użyty do komunikacji z innymi językami jeśli
46 tylko mają one dobrze zdefiniowany interfejs C.
48 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
49 używających tej biblioteki.
52 Summary: IDL binding for OCaml - development part
53 Summary(pl.UTF-8): Wiązania IDL dla OCamla - cześć programistyczna
54 Group: Development/Libraries
55 Requires: %{name} = %{version}-%{release}
59 Camlidl is a stub code generator for Objective Caml. It generates stub
60 code for interfacing Caml with C from an IDL description of the C
61 functions. Thus, Camlidl automates the most tedious task in
62 interfacing C libraries with Caml programs. It can also be used to
63 interface Caml programs with other languages, as long as those
64 languages have a well-defined C interface.
66 This package contains files needed to develop OCaml programs using
69 %description devel -l pl.UTF-8
70 Camlidl jest generatorem kodu łączącego C z OCamlem. Pozwala on na
71 automatyczne tworzenie funkcji, które będą mogły być wywoływane z
72 OCamla na podstawie opisu IDL. Automatyzuje więc najbardziej
73 niewdzięczne aspekty odwoływania się do bibliotek napisanych w C z
74 OCamla. Może być również użyty do komunikacji z innymi językami jeśli
75 tylko mają one dobrze zdefiniowany interfejs C.
77 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
81 %setup -q -a 1 -n camlidl-%{version}
84 ln -s Makefile.unix config/Makefile
86 # NOTE: make opt to produce camlidl.opt won't work here, there is no such
87 # target even. That's bacause there is array.ml module in camlidl so
88 # it produces array.o and array.o is also in standard library. And C linker
92 %{__make} -j1 -C compiler \
93 CPP="%{__cc} -E -x c" \
94 CFLAGS="%{rpmcflags} -fPIC"
96 %{__make} -j1 -C lib com.cma %{?with_ocaml_opt:com.cmxa} \
97 CPP="%{__cc} -E -x c" \
98 CFLAGS="%{rpmcflags} -fPIC"
100 %{__make} -j1 -C runtime \
101 CPP="%{__cc} -E -x c" \
102 CFLAGS="%{rpmcflags} -fPIC"
104 %{__make} -j1 -C tools \
105 CPP="%{__cc} -E -x c" \
106 CFLAGS="%{rpmcflags} -fPIC"
108 ocamlmklib -o com lib/*.cm[xo] runtime/*.o
111 rm -rf $RPM_BUILD_ROOT
112 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml/idl,%{_includedir}/caml}
113 ln -sf ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
116 %{!?with_ocaml_opt:NATIVELIB=""} \
117 BINDIR=$RPM_BUILD_ROOT%{_bindir} \
118 OCAMLLIB=$RPM_BUILD_ROOT%{_libdir}/ocaml
120 # fix install to subdir
121 mv $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma%{?with_ocaml_opt:,cmxa,a}},idl}
123 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
124 install -p dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
126 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127 cp -a tests/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
128 # remove Windows examples
129 %{__rm} -r $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{comp,dispatch}
131 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl
132 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl/META <<EOF
134 version = "%{version}"
136 archive(byte) = "com.cma"
137 archive(native) = "com.cmxa"
142 rm -rf $RPM_BUILD_ROOT
145 %defattr(644,root,root,755)
146 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
149 %defattr(644,root,root,755)
150 %doc htmlman LICENSE README Changes
151 %attr(755,root,root) %{_bindir}/camlidl
152 %dir %{_libdir}/ocaml/idl
153 %{_libdir}/ocaml/idl/*.cm[ixa]*
154 %if %{with ocaml_opt}
155 %{_libdir}/ocaml/idl/*.a
157 %{_libdir}/ocaml/site-lib/camlidl
158 %{_libdir}/ocaml/caml
159 %{_includedir}/caml/camlidlruntime.h
160 %{_examplesdir}/%{name}-%{version}