]> git.pld-linux.org Git - packages/ocaml-idl.git/blob - ocaml-idl.spec
- typo
[packages/ocaml-idl.git] / ocaml-idl.spec
1 # TODO: build current htmlman (make -C doc htmlman/index.html, requires hevea and hacha)
2 #
3 # Conditional build:
4 %bcond_without  ocaml_opt       # native optimized binaries (bytecode is always built)
5
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
9 %endif
10
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:        5
17 License:        QPL v1.0 (compiler), LGPL v2 (library)
18 Group:          Libraries
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
24 Patch0:         no-opt.patch
25 Patch1:         DESTDIR.patch
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)
31
32 %description
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.
39
40 This package contains files needed to run bytecode executables using
41 this library.
42
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.
50
51 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
52 używających tej biblioteki.
53
54 %package devel
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}
59 %requires_eq    ocaml
60
61 %description devel
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.
68
69 This package contains files needed to develop OCaml programs using
70 this library.
71
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.
79
80 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
81 tej biblioteki.
82
83 %prep
84 %setup -q -a 1 -n camlidl-camlidl%{shortversion}
85 %patch0 -p1
86 %patch1 -p1
87
88 ln -s Makefile.unix config/Makefile
89
90 %build
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 \
104         CPP="%{__cc} -E -x c" \
105         CFLAGS="%{rpmcflags} -fPIC"
106
107 %install
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
112
113 %{__make} install \
114         DESTDIR=$RPM_BUILD_ROOT \
115         BINDIR=%{_bindir} \
116         OCAMLLIB=%{_libdir}/ocaml \
117         %{!?with_ocaml_opt:NATIVELIB=""}
118
119 # fix install to subdir
120 %{__mv} $RPM_BUILD_ROOT%{_libdir}/ocaml/{*.{cm[ix],cma,a%{?with_ocaml_opt:,cmxa}},idl}
121
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}
126
127 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/idl/META <<EOF
128 requires = ""
129 version = "%{version}"
130 directory = "+idl"
131 archive(byte) = "com.cma"
132 archive(native) = "com.cmxa"
133 linkopts = ""
134 EOF
135 ln -sr $RPM_BUILD_ROOT%{_libdir}/ocaml/{idl,camlidl}
136
137 # symlink belongs to ocaml package
138 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/caml
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %files
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
150
151 %files devel
152 %defattr(644,root,root,755)
153 %doc htmlman
154 %attr(755,root,root) %{_bindir}/camlidl
155 # compat symlink
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
161 %endif
162 %{_libdir}/ocaml/idl/libcamlidl.a
163 %{_includedir}/caml/camlidlruntime.h
164 %{_examplesdir}/%{name}-%{version}
This page took 0.085672 seconds and 4 git commands to generate.