]>
Commit | Line | Data |
---|---|---|
661a7a0c | 1 | # TODO: build current htmlman (make -C doc htmlman/index.html, requires hevea and hacha) |
ff869cfc JR |
2 | # |
3 | # Conditional build: | |
661a7a0c | 4 | %bcond_without ocaml_opt # native optimized binaries (bytecode is always built) |
ff869cfc | 5 | |
0f71ee8c | 6 | # not yet available on x32 (ocaml 4.02.1), update when upstream will support it |
661a7a0c | 7 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 |
ff869cfc JR |
8 | %undefine with_ocaml_opt |
9 | %endif | |
10 | ||
0f71ee8c JB |
11 | Summary: CamlIDL - stub code generator and COM binding for OCaml |
12 | Summary(pl.UTF-8): CamlIDL - generator kodu zaślepek oraz wiązania COM dla OCamla | |
602c3e8a | 13 | %define shortversion %(echo %{version} | tr -d .) |
48dce474 | 14 | Name: ocaml-idl |
602c3e8a | 15 | Version: 1.09 |
462f78ac | 16 | Release: 5 |
487fb0f5 | 17 | License: QPL v1.0 (compiler), LGPL v2 (library) |
ebc04232 | 18 | Group: Libraries |
661a7a0c | 19 | #Source0Download: https://github.com/xavierleroy/camlidl/releases |
602c3e8a JR |
20 | Source0: https://github.com/xavierleroy/camlidl/archive/camlidl%{shortversion}/camlidl-%{version}.tar.gz |
21 | # Source0-md5: 50a7348c14ce7448a35efa96b98018af | |
22 | Source1: http://caml.inria.fr/distrib/bazar-ocaml/camlidl-1.05.doc.html.tar.gz | |
f24cc87a | 23 | # Source1-md5: b7c7dad3ba62ddcc0f687bdebe295126 |
ff869cfc | 24 | Patch0: no-opt.patch |
602c3e8a | 25 | Patch1: DESTDIR.patch |
661a7a0c JB |
26 | URL: https://github.com/xavierleroy/camlidl |
27 | BuildRequires: ocaml >= 1:4.03 | |
487fb0f5 | 28 | Obsoletes: ocaml-camlidl < 1.05-3 |
48dce474 MM |
29 | %requires_eq ocaml-runtime |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
4a13f6ed ER |
33 | Camlidl is a stub code generator for Objective Caml. It generates stub |
34 | code for interfacing Caml with C from an IDL description of the C | |
48dce474 MM |
35 | functions. Thus, Camlidl automates the most tedious task in |
36 | interfacing C libraries with Caml programs. It can also be used to | |
37 | interface Caml programs with other languages, as long as those | |
38 | languages have a well-defined C interface. | |
39 | ||
b81cfd40 | 40 | This package contains files needed to run bytecode executables using |
48dce474 MM |
41 | this library. |
42 | ||
eee79846 JR |
43 | %description -l pl.UTF-8 |
44 | Camlidl jest generatorem kodu łączącego C z OCamlem. Pozwala on na | |
45 | automatyczne tworzenie funkcji, które będą mogły być wywoływane z | |
46 | OCamla na podstawie opisu IDL. Automatyzuje więc najbardziej | |
47 | niewdzięczne aspekty odwoływania się do bibliotek napisanych w C z | |
0f71ee8c | 48 | OCamla. Może być również użyty do komunikacji z innymi językami, jeśli |
eee79846 | 49 | tylko mają one dobrze zdefiniowany interfejs C. |
48dce474 | 50 | |
eee79846 JR |
51 | Pakiet ten zawiera binaria potrzebne do uruchamiania programów |
52 | używających tej biblioteki. | |
48dce474 MM |
53 | |
54 | %package devel | |
55 | Summary: IDL binding for OCaml - development part | |
03cc6736 | 56 | Summary(pl.UTF-8): Wiązania IDL dla OCamla - część programistyczna |
48dce474 MM |
57 | Group: Development/Libraries |
58 | Requires: %{name} = %{version}-%{release} | |
661a7a0c | 59 | %requires_eq ocaml |
48dce474 MM |
60 | |
61 | %description devel | |
4a13f6ed ER |
62 | Camlidl is a stub code generator for Objective Caml. It generates stub |
63 | code for interfacing Caml with C from an IDL description of the C | |
48dce474 MM |
64 | functions. Thus, Camlidl automates the most tedious task in |
65 | interfacing C libraries with Caml programs. It can also be used to | |
66 | interface Caml programs with other languages, as long as those | |
67 | languages have a well-defined C interface. | |
68 | ||
b81cfd40 | 69 | This package contains files needed to develop OCaml programs using |
48dce474 MM |
70 | this library. |
71 | ||
eee79846 JR |
72 | %description devel -l pl.UTF-8 |
73 | Camlidl jest generatorem kodu łączącego C z OCamlem. Pozwala on na | |
74 | automatyczne tworzenie funkcji, które będą mogły być wywoływane z | |
75 | OCamla na podstawie opisu IDL. Automatyzuje więc najbardziej | |
76 | niewdzięczne aspekty odwoływania się do bibliotek napisanych w C z | |
0f71ee8c | 77 | OCamla. Może być również użyty do komunikacji z innymi językami, jeśli |
eee79846 | 78 | tylko mają one dobrze zdefiniowany interfejs C. |
48dce474 | 79 | |
eee79846 | 80 | Pakiet ten zawiera pliki niezbędne do tworzenia programów używających |
48dce474 MM |
81 | tej biblioteki. |
82 | ||
83 | %prep | |
602c3e8a | 84 | %setup -q -a 1 -n camlidl-camlidl%{shortversion} |
ff869cfc | 85 | %patch0 -p1 |
76c03e96 | 86 | %patch1 -p1 |
48dce474 | 87 | |
487fb0f5 ER |
88 | ln -s Makefile.unix config/Makefile |
89 | ||
48dce474 | 90 | %build |
ff869cfc JR |
91 | %{__make} -j1 -C compiler \ |
92 | CPP="%{__cc} -E -x c" \ | |
93 | CFLAGS="%{rpmcflags} -fPIC" | |
94 | ||
95 | %{__make} -j1 -C lib com.cma %{?with_ocaml_opt:com.cmxa} \ | |
96 | CPP="%{__cc} -E -x c" \ | |
97 | CFLAGS="%{rpmcflags} -fPIC" | |
98 | ||
99 | %{__make} -j1 -C runtime \ | |
100 | CPP="%{__cc} -E -x c" \ | |
101 | CFLAGS="%{rpmcflags} -fPIC" | |
102 | ||
103 | %{__make} -j1 -C tools \ | |
487fb0f5 | 104 | CPP="%{__cc} -E -x c" \ |
4a13f6ed | 105 | CFLAGS="%{rpmcflags} -fPIC" |
ff869cfc | 106 | |
48dce474 MM |
107 | %install |
108 | rm -rf $RPM_BUILD_ROOT | |
602c3e8a | 109 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml/{stublibs,idl},%{_includedir}/caml} |
661a7a0c | 110 | # header is installed via this symlink |
487fb0f5 ER |
111 | ln -sf ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml |
112 | ||
113 | %{__make} install \ | |
602c3e8a JR |
114 | DESTDIR=$RPM_BUILD_ROOT \ |
115 | BINDIR=%{_bindir} \ | |
116 | OCAMLLIB=%{_libdir}/ocaml \ | |
117 | %{!?with_ocaml_opt:NATIVELIB=""} | |
48dce474 | 118 | |
487fb0f5 | 119 | # fix install to subdir |
0f71ee8c | 120 | %{__mv} $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma,a%{?with_ocaml_opt:,cmxa}},idl} |
48dce474 | 121 | |
48dce474 | 122 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
487fb0f5 | 123 | cp -a tests/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
48dce474 | 124 | # remove Windows examples |
487fb0f5 | 125 | %{__rm} -r $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{comp,dispatch} |
48dce474 | 126 | |
dbad7f89 | 127 | cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/idl/META <<EOF |
48dce474 MM |
128 | requires = "" |
129 | version = "%{version}" | |
130 | directory = "+idl" | |
131 | archive(byte) = "com.cma" | |
132 | archive(native) = "com.cmxa" | |
133 | linkopts = "" | |
134 | EOF | |
42a8822d | 135 | ln -sr $RPM_BUILD_ROOT%{_libdir}/ocaml/{idl,camlidl} |
48dce474 | 136 | |
661a7a0c JB |
137 | # symlink belongs to ocaml package |
138 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/caml | |
139 | ||
48dce474 MM |
140 | %clean |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
143 | %files | |
144 | %defattr(644,root,root,755) | |
661a7a0c JB |
145 | %doc Changes LICENSE README |
146 | %dir %{_libdir}/ocaml/idl | |
147 | %{_libdir}/ocaml/idl/META | |
148 | %{_libdir}/ocaml/idl/com.cma | |
149 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcamlidl.so | |
48dce474 MM |
150 | |
151 | %files devel | |
152 | %defattr(644,root,root,755) | |
661a7a0c | 153 | %doc htmlman |
63eb2b1c | 154 | %attr(755,root,root) %{_bindir}/camlidl |
661a7a0c | 155 | # compat symlink |
c54b92ea | 156 | %{_libdir}/ocaml/camlidl |
0f71ee8c JB |
157 | %{_libdir}/ocaml/idl/com.cmi |
158 | %if %{with ocaml_opt} | |
159 | %{_libdir}/ocaml/idl/com.a | |
160 | %{_libdir}/ocaml/idl/com.cmxa | |
161 | %endif | |
162 | %{_libdir}/ocaml/idl/libcamlidl.a | |
487fb0f5 ER |
163 | %{_includedir}/caml/camlidlruntime.h |
164 | %{_examplesdir}/%{name}-%{version} |