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