]> git.pld-linux.org Git - packages/ocaml-libvirt.git/blob - ocaml-libvirt.spec
82563e0f8890d08b704ec12ff69323ccfab061e5
[packages/ocaml-libvirt.git] / ocaml-libvirt.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 Summary:        libvirt binding for OCaml
11 Summary(pl.UTF-8):      Wiązania libvirt dla OCamla
12 Name:           ocaml-libvirt
13 Version:        0.6.1.5
14 Release:        2
15 License:        LGPL v2+
16 Group:          Libraries
17 Source0:        https://libvirt.org/sources/ocaml/%{name}-%{version}.tar.gz
18 # Source0-md5:  4b5ec3b6eb93ca18e02433f04806f0ed
19 Patch0:         0001-block_peek-memory_peek-Use-bytes-for-return-buffer.patch
20 Patch1:         0001-Make-const-the-return-value-of-caml_named_value.patch
21 Patch2:         0002-String_val-returns-const-char-in-OCaml-4.10.patch
22 Patch3:         0003-Don-t-try-to-memcpy-into-a-String_val.patch
23 URL:            https://libvirt.org/ocaml/
24 BuildRequires:  libvirt-devel >= 1.2.8
25 BuildRequires:  ocaml >= 3.04-7
26 BuildRequires:  ocaml-findlib
27 BuildRequires:  perl-base
28 BuildRequires:  pkgconfig
29 Requires:       libvirt >= 1.2.8
30 %requires_eq    ocaml-runtime
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 ocaml-libvirt is a complete set of OCaml bindings around libvirt,
35 exposing all known libvirt functionality to OCaml programs.
36
37 This package contains files needed to run bytecode executables using
38 the library.
39
40 %description -l pl.UTF-8
41 ocaml-libvirt to kompletny zestaw wiązań OCamla do libvirt,
42 udostępniający całą znaną funkcjonalność libvirt programom w OCamlu.
43
44 Ten pakiet zawiera binaria potrzebne do uruchamiania programów
45 używających tej biblioteki.
46
47 %package devel
48 Summary:        libvirt binding for OCaml - development part
49 Summary(pl.UTF-8):      Wiązania libvirt dla OCamla - cześć programistyczna
50 Group:          Development/Libraries
51 Requires:       %{name} = %{version}-%{release}
52 %requires_eq    ocaml
53
54 %description devel
55 ocaml-libvirt is a complete set of OCaml bindings around libvirt,
56 exposing all known libvirt functionality to OCaml programs.
57
58 This package contains files needed to develop OCaml programs using
59 the library.
60
61 %description devel -l pl.UTF-8
62 ocaml-libvirt to kompletny zestaw wiązań OCamla do libvirt,
63 udostępniający całą znaną funkcjonalność libvirt programom w OCamlu.
64
65 Ten pakiet zawiera pliki niezbędne do tworzenia programów używających
66 biblioteki.
67
68 %prep
69 %setup -q
70 %patch0 -p1
71 %patch1 -p1
72 %patch2 -p1
73 %patch3 -p1
74
75 %build
76 %configure
77
78 # parallel build triggers makefile races
79 %{__make} -j1 all %{?with_ocaml_opt:opt} \
80         CC="%{__cc}"
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/{site-lib,stublibs}
85
86 %{__make} install%{?with_ocaml_opt:-opt}%{!?with_ocaml_opt:-byte} \
87         OCAMLFIND_INSTFLAGS="-destdir $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib"
88
89 %{__mv} $RPM_BUILD_ROOT%{_libdir}/ocaml/{site-lib/libvirt,stublibs}/dllmllibvirt.so
90
91 # packaged as %doc
92 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/libvirt/*.mli
93
94 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
95 cp -p examples/*.ml $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %files
101 %defattr(644,root,root,755)
102 %doc ChangeLog README TODO.libvirt
103 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllmllibvirt.so
104
105 %files devel
106 %defattr(644,root,root,755)
107 %doc libvirt/libvirt*.mli
108 %dir %{_libdir}/ocaml/site-lib/libvirt
109 %{_libdir}/ocaml/site-lib/libvirt/META
110 %{_libdir}/ocaml/site-lib/libvirt/libvirt*.cmi
111 %{_libdir}/ocaml/site-lib/libvirt/libmllibvirt.a
112 %{_libdir}/ocaml/site-lib/libvirt/mllibvirt.cma
113 %if %{with ocaml_opt}
114 %{_libdir}/ocaml/site-lib/libvirt/libvirt*.cmx
115 %{_libdir}/ocaml/site-lib/libvirt/mllibvirt.a
116 %{_libdir}/ocaml/site-lib/libvirt/mllibvirt.cmxa
117 %endif
118 %{_examplesdir}/%{name}-%{version}
This page took 0.096175 seconds and 2 git commands to generate.