]> git.pld-linux.org Git - packages/ocaml-idl.git/blob - ocaml-idl.spec
- added ocaml_opt patch
[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 %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
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
13 Name:           ocaml-idl
14 Version:        1.05
15 Release:        9
16 License:        QPL v1.0 (compiler), LGPL v2 (library)
17 Group:          Libraries
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
22 Patch0:         no-opt.patch
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)
28
29 %description
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.
36
37 This package contains files needed to run bytecode executables using
38 this library.
39
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.
47
48 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
49 używających tej biblioteki.
50
51 %package devel
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}
56 %requires_eq    ocaml
57
58 %description devel
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.
65
66 This package contains files needed to develop OCaml programs using
67 this library.
68
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.
76
77 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
78 tej biblioteki.
79
80 %prep
81 %setup -q -a 1 -n camlidl-%{version}
82 %patch0 -p1
83
84 ln -s Makefile.unix config/Makefile
85
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
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 \
105         CPP="%{__cc} -E -x c" \
106         CFLAGS="%{rpmcflags} -fPIC"
107
108 ocamlmklib -o com lib/*.cm[xo] runtime/*.o
109
110 %install
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
114
115 %{__make} install \
116         %{!?with_ocaml_opt:NATIVELIB=""} \
117         BINDIR=$RPM_BUILD_ROOT%{_bindir} \
118         OCAMLLIB=$RPM_BUILD_ROOT%{_libdir}/ocaml
119
120 # fix install to subdir
121 mv $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma%{?with_ocaml_opt:,cmxa,a}},idl}
122
123 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
124 install -p dll*.so $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs
125
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}
130
131 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl
132 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/camlidl/META <<EOF
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)
146 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
147
148 %files devel
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
156 %endif
157 %{_libdir}/ocaml/site-lib/camlidl
158 %{_libdir}/ocaml/caml
159 %{_includedir}/caml/camlidlruntime.h
160 %{_examplesdir}/%{name}-%{version}
This page took 0.085224 seconds and 3 git commands to generate.