]>
Commit | Line | Data |
---|---|---|
ff869cfc JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) | |
4 | ||
5 | %ifarch x32 | |
6 | # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it | |
7 | %undefine with_ocaml_opt | |
8 | %endif | |
9 | ||
e82b6925 | 10 | %define ocaml_ver 1:3.09.2 |
487fb0f5 | 11 | Summary: CamlIDL is a stub code generator and COM binding for Objective Caml |
703c2f16 | 12 | Summary(pl.UTF-8): Wiązania IDL dla OCamla |
48dce474 | 13 | Name: ocaml-idl |
f24cc87a | 14 | Version: 1.05 |
ff869cfc | 15 | Release: 9 |
487fb0f5 | 16 | License: QPL v1.0 (compiler), LGPL v2 (library) |
ebc04232 | 17 | Group: Libraries |
48dce474 | 18 | Source0: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.tar.gz |
f24cc87a | 19 | # Source0-md5: 4cfb863bc3cbdc1af2502042c45cc675 |
48dce474 | 20 | Source1: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-%{version}.doc.html.tar.gz |
f24cc87a | 21 | # Source1-md5: b7c7dad3ba62ddcc0f687bdebe295126 |
ff869cfc | 22 | Patch0: no-opt.patch |
487fb0f5 | 23 | URL: http://caml.inria.fr/pub/old_caml_site/camlidl/ |
4a13f6ed | 24 | BuildRequires: ocaml >= %{ocaml_ver} |
487fb0f5 | 25 | Obsoletes: ocaml-camlidl < 1.05-3 |
48dce474 MM |
26 | %requires_eq ocaml-runtime |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
4a13f6ed ER |
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 | |
48dce474 MM |
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. | |
36 | ||
b81cfd40 | 37 | This package contains files needed to run bytecode executables using |
48dce474 MM |
38 | this library. |
39 | ||
eee79846 JR |
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. | |
48dce474 | 47 | |
eee79846 JR |
48 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów |
49 | używających tej biblioteki. | |
48dce474 MM |
50 | |
51 | %package devel | |
52 | Summary: IDL binding for OCaml - development part | |
703c2f16 | 53 | Summary(pl.UTF-8): Wiązania IDL dla OCamla - cześć programistyczna |
48dce474 MM |
54 | Group: Development/Libraries |
55 | Requires: %{name} = %{version}-%{release} | |
56 | %requires_eq ocaml | |
57 | ||
58 | %description devel | |
4a13f6ed ER |
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 | |
48dce474 MM |
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. | |
65 | ||
b81cfd40 | 66 | This package contains files needed to develop OCaml programs using |
48dce474 MM |
67 | this library. |
68 | ||
eee79846 JR |
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. | |
48dce474 | 76 | |
eee79846 | 77 | Pakiet ten zawiera pliki niezbędne do tworzenia programów używających |
48dce474 MM |
78 | tej biblioteki. |
79 | ||
80 | %prep | |
81 | %setup -q -a 1 -n camlidl-%{version} | |
ff869cfc | 82 | %patch0 -p1 |
48dce474 | 83 | |
487fb0f5 ER |
84 | ln -s Makefile.unix config/Makefile |
85 | ||
48dce474 MM |
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 | |
89 | # chokes. | |
90 | ||
91 | %build | |
ff869cfc JR |
92 | %{__make} -j1 -C compiler \ |
93 | CPP="%{__cc} -E -x c" \ | |
94 | CFLAGS="%{rpmcflags} -fPIC" | |
95 | ||
96 | %{__make} -j1 -C lib com.cma %{?with_ocaml_opt:com.cmxa} \ | |
97 | CPP="%{__cc} -E -x c" \ | |
98 | CFLAGS="%{rpmcflags} -fPIC" | |
99 | ||
100 | %{__make} -j1 -C runtime \ | |
101 | CPP="%{__cc} -E -x c" \ | |
102 | CFLAGS="%{rpmcflags} -fPIC" | |
103 | ||
104 | %{__make} -j1 -C tools \ | |
487fb0f5 | 105 | CPP="%{__cc} -E -x c" \ |
4a13f6ed | 106 | CFLAGS="%{rpmcflags} -fPIC" |
ff869cfc | 107 | |
48dce474 MM |
108 | ocamlmklib -o com lib/*.cm[xo] runtime/*.o |
109 | ||
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
487fb0f5 ER |
112 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml/idl,%{_includedir}/caml} |
113 | ln -sf ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml | |
114 | ||
115 | %{__make} install \ | |
ff869cfc | 116 | %{!?with_ocaml_opt:NATIVELIB=""} \ |
487fb0f5 ER |
117 | BINDIR=$RPM_BUILD_ROOT%{_bindir} \ |
118 | OCAMLLIB=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
48dce474 | 119 | |
487fb0f5 | 120 | # fix install to subdir |
ff869cfc | 121 | mv $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma%{?with_ocaml_opt:,cmxa,a}},idl} |
48dce474 | 122 | |
487fb0f5 ER |
123 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs |
124 | install -p dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs | |
48dce474 MM |
125 | |
126 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
487fb0f5 | 127 | cp -a tests/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
48dce474 | 128 | # remove Windows examples |
487fb0f5 | 129 | %{__rm} -r $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{comp,dispatch} |
48dce474 | 130 | |
c8c99e7b MM |
131 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl |
132 | cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl/META <<EOF | |
48dce474 MM |
133 | requires = "" |
134 | version = "%{version}" | |
135 | directory = "+idl" | |
136 | archive(byte) = "com.cma" | |
137 | archive(native) = "com.cmxa" | |
138 | linkopts = "" | |
139 | EOF | |
140 | ||
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
144 | %files | |
145 | %defattr(644,root,root,755) | |
63eb2b1c | 146 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so |
48dce474 MM |
147 | |
148 | %files devel | |
149 | %defattr(644,root,root,755) | |
150 | %doc htmlman LICENSE README Changes | |
63eb2b1c | 151 | %attr(755,root,root) %{_bindir}/camlidl |
487fb0f5 | 152 | %dir %{_libdir}/ocaml/idl |
48dce474 | 153 | %{_libdir}/ocaml/idl/*.cm[ixa]* |
ff869cfc | 154 | %if %{with ocaml_opt} |
48dce474 | 155 | %{_libdir}/ocaml/idl/*.a |
ff869cfc | 156 | %endif |
0002521f | 157 | %{_libdir}/ocaml/site-lib/camlidl |
487fb0f5 ER |
158 | %{_libdir}/ocaml/caml |
159 | %{_includedir}/caml/camlidlruntime.h | |
160 | %{_examplesdir}/%{name}-%{version} |