1 # TODO: build current htmlman (make -C doc htmlman/index.html, requires hevea and hacha)
4 %bcond_without ocaml_opt # native optimized binaries (bytecode is always built)
6 # not yet available on x32 (ocaml 4.02.1), update when upstream will support it
7 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
8 %undefine with_ocaml_opt
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
13 %define shortversion %(echo %{version} | tr -d .)
17 License: QPL v1.0 (compiler), LGPL v2 (library)
19 #Source0Download: https://github.com/xavierleroy/camlidl/releases
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
23 # Source1-md5: b7c7dad3ba62ddcc0f687bdebe295126
26 URL: https://github.com/xavierleroy/camlidl
27 BuildRequires: ocaml >= 1:4.03
28 Obsoletes: ocaml-camlidl < 1.05-3
29 %requires_eq ocaml-runtime
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
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.
40 This package contains files needed to run bytecode executables using
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
48 OCamla. Może być również użyty do komunikacji z innymi językami, jeśli
49 tylko mają one dobrze zdefiniowany interfejs C.
51 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
52 używających tej biblioteki.
55 Summary: IDL binding for OCaml - development part
56 Summary(pl.UTF-8): Wiązania IDL dla OCamla - część programistyczna
57 Group: Development/Libraries
58 Requires: %{name} = %{version}-%{release}
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
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.
69 This package contains files needed to develop OCaml programs using
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
77 OCamla. Może być również użyty do komunikacji z innymi językami, jeśli
78 tylko mają one dobrze zdefiniowany interfejs C.
80 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
84 %setup -q -a 1 -n camlidl-camlidl%{shortversion}
88 ln -s Makefile.unix config/Makefile
91 %{__make} -j1 -C compiler \
92 CPP="%{__cc} -E -x c" \
93 CFLAGS="%{rpmcflags} -fPIC"
95 %{__make} -j1 -C lib com.cma %{?with_ocaml_opt:com.cmxa} \
96 CPP="%{__cc} -E -x c" \
97 CFLAGS="%{rpmcflags} -fPIC"
99 %{__make} -j1 -C runtime \
100 CPP="%{__cc} -E -x c" \
101 CFLAGS="%{rpmcflags} -fPIC"
103 %{__make} -j1 -C tools \
104 CPP="%{__cc} -E -x c" \
105 CFLAGS="%{rpmcflags} -fPIC"
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/ocaml/{stublibs,idl},%{_includedir}/caml}
110 # header is installed via this symlink
111 ln -sf ../../include/caml $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
114 DESTDIR=$RPM_BUILD_ROOT \
116 OCAMLLIB=%{_libdir}/ocaml \
117 %{!?with_ocaml_opt:NATIVELIB=""}
119 # fix install to subdir
120 %{__mv} $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma,a%{?with_ocaml_opt:,cmxa}},idl}
122 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 cp -a tests/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
124 # remove Windows examples
125 %{__rm} -r $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/{comp,dispatch}
127 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/idl/META <<EOF
129 version = "%{version}"
131 archive(byte) = "com.cma"
132 archive(native) = "com.cmxa"
135 ln -sr $RPM_BUILD_ROOT%{_libdir}/ocaml/{idl,camlidl}
137 # symlink belongs to ocaml package
138 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
141 rm -rf $RPM_BUILD_ROOT
144 %defattr(644,root,root,755)
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
152 %defattr(644,root,root,755)
154 %attr(755,root,root) %{_bindir}/camlidl
156 %{_libdir}/ocaml/camlidl
157 %{_libdir}/ocaml/idl/com.cmi
158 %if %{with ocaml_opt}
159 %{_libdir}/ocaml/idl/com.a
160 %{_libdir}/ocaml/idl/com.cmxa
162 %{_libdir}/ocaml/idl/libcamlidl.a
163 %{_includedir}/caml/camlidlruntime.h
164 %{_examplesdir}/%{name}-%{version}