4 %bcond_without ocaml # Ocaml bindings
5 %bcond_without ocaml_opt # native optimized binaries
7 # not yet available on x32 (ocaml 4.02.1), update when upstream will support it
8 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
9 %undefine with_ocaml_opt
12 Summary: NBD client library in userspace
13 Summary(pl.UTF-8): Biblioteka klienta NBD w przestrzeni użytkownika
19 Source0: https://download.libguestfs.org/libnbd/1.6-stable/%{name}-%{version}.tar.gz
20 # Source0-md5: dee634a684171133110432186b738853
21 URL: https://github.com/libguestfs/libnbd
22 BuildRequires: bash-completion-devel >= 2.0
23 BuildRequires: glib2-devel >= 2.0
24 BuildRequires: gnutls-devel >= 3.3.0
26 BuildRequires: libfuse-devel
27 BuildRequires: libstdc++-devel
28 BuildRequires: libxml2-devel >= 2.0
31 BuildRequires: ocaml-findlib
32 BuildRequires: ocaml-ocamldoc
34 BuildRequires: perl-tools-pod
35 BuildRequires: pkgconfig
36 BuildRequires: python3-devel >= 1:3.2
37 BuildRequires: rpm-build >= 4.6
38 BuildRequires: util-linux
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 # The Python module happens to be called lib*.so. Don't scan it and
42 # have a bogus "Provides: libnbdmod.*".
43 %define _noautoprovfiles %{py3_sitedir}/libnbdmod.*
46 NBD - Network Block Device - is a protocol for accessing Block Devices
47 (hard disks and disk-like things) over a Network.
49 This is the NBD client library in userspace, a simple library for
53 - Synchronous and asynchronous APIs, both for ease of use and for
54 writing non-blocking, multithreaded clients.
56 - Minimal dependencies for the basic library.
57 - Well-documented, stable API.
58 - Bindings in several programming languages.
60 %description -l pl.UTF-8
61 NBD - Network Block Device - to protokół pozwalający na dostęp do
62 urządzeń blokowych (dysków twardych i rzeczy dyskopodobnych) po sieci.
64 Ten pakiet zawiera bibliotekę klienta NBD w przestrzeni użytkownika -
65 prostą bibliotekę do pisania klientów NBD.
68 - API synchroniczne i asynchroniczne, zarówno w celu ułatwienia
69 użycia, jak i pisania nieblokujących, wielowątkowych klientów
71 - minimalne zależności dla podstawowej biblioteki
72 - dobrze udokumentowane, stabilne API
73 - wiązania do kilku języków programowania
76 Summary: Development headers for NBD library
77 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki NBD
78 License: LGPL v2+ and BSD
79 Group: Development/Libraries
80 Requires: %{name} = %{version}-%{release}
83 This package contains development headers for NBD library.
85 %description devel -l pl.UTF-8
86 Ten pakiet zawiera pliki nagłówkowe biblioteki NBD.
88 %package -n ocaml-%{name}
89 Summary: OCaml language bindings for NBD library
90 Summary(pl.UTF-8): Wiązania OCamla do biblioteki NBD
92 Requires: %{name} = %{version}-%{release}
94 %description -n ocaml-%{name}
95 This package contains OCaml language bindings for NBD library.
97 %description -n ocaml-%{name} -l pl.UTF-8
98 Ten pakiet zawiera wiązania OCamla do biblioteki NBD.
100 %package -n ocaml-%{name}-devel
101 Summary: OCaml language development package for NBD library
102 Summary(pl.UTF-8): Pakiet programistyczny wiązań OCamla do biblioteki NBD
103 Group: Development/Libraries
104 Requires: ocaml-%{name} = %{version}-%{release}
106 %description -n ocaml-%{name}-devel
107 This package contains OCaml language development package for NBD
108 library. Install this if you want to compile OCaml software which uses
111 %description -n ocaml-%{name}-devel -l pl.UTF-8
112 Pakiet programistyczny wiązań OCamla do biblioteki NBD. Należy go
113 zainstalować, aby móc kompilować programy w OCamlu wykorzystujące NBD.
115 %package -n python3-%{name}
116 Summary: Python 3 bindings for NBD library
117 Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki NBD
118 Group: Libraries/Python
119 Requires: %{name} = %{version}-%{release}
121 %description -n python3-%{name}
122 This package contains Python 3 bindings for NBD library.
124 %description -n python3-%{name} -l pl.UTF-8
125 Ten pakiet zawiera wiązania Pythona do biblioteki NBD.
128 Summary: FUSE support for NBD library
129 Summary(pl.UTF-8): Obsługa FUSE do biblioteki NBD
130 License: LGPL v2+ and BSD
131 Group: Applications/System
132 Requires: %{name} = %{version}-%{release}
134 %description -n nbdfuse
135 This package contains FUSE support for NBD library.
137 %description -n nbdfuse -l pl.UTF-8
138 Ten pakiet zawiera obsługę FUSE do biblioteki NBD.
140 %package -n bash-completion-%{name}
141 Summary: Bash tab-completion for NBD utilities
142 Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla narzędzi NBD
143 Group: Applications/Shells
144 Requires: %{name} = %{version}-%{release}
145 Requires: bash-completion >= 2.0
146 Obsoletes: libnbd-bash-completion < 1.6.2
149 %description -n bash-completion-%{name}
150 Install this package if you want intelligent bash tab-completion for
151 NBD utilities (nbdcopy, nbdfuse, nbdinfo, nbdsh).
153 %description -n bash-completion-%{name} -l pl.UTF
154 Ten pakiet należy zainstalować, aby uzyskać inteligentne dopełnianie
155 parametrów dla narzędzi NBD (nbdcopy, nbdfuse, nbdinfo, nbdsh).
162 PYTHON=%{__python3} \
165 %{__enable_disable ocaml} \
168 --with-python-installdir=%{py3_sitedir} \
169 --with-tls-priority=@LIBNBD,SYSTEM
174 rm -rf $RPM_BUILD_ROOT
177 DESTDIR=$RPM_BUILD_ROOT
179 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
180 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
182 # Delete libtool crap.
183 find $RPM_BUILD_ROOT -name '*.la' -delete
185 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.owner
187 # Delete the golang man page since we're not distributing the bindings.
188 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3*
191 rm -rf $RPM_BUILD_ROOT
193 %post -p /sbin/ldconfig
194 %postun -p /sbin/ldconfig
197 %defattr(644,root,root,755)
198 %doc README SECURITY TODO
199 %attr(755,root,root) %{_bindir}/nbdcopy
200 %attr(755,root,root) %{_bindir}/nbdinfo
201 %attr(755,root,root) %{_libdir}/libnbd.so.*.*.*
202 %ghost %{_libdir}/libnbd.so.0
203 %{_mandir}/man1/nbdcopy.1*
204 %{_mandir}/man1/nbdinfo.1*
207 %defattr(644,root,root,755)
208 %doc examples/{LICENSE-FOR-EXAMPLES,*.c}
210 %{_includedir}/libnbd.h
211 %{_pkgconfigdir}/libnbd.pc
212 %{_mandir}/man3/libnbd.3*
213 %{_mandir}/man1/libnbd-release-notes-1.*.1*
214 %{_mandir}/man3/libnbd-security.3*
215 %{_mandir}/man3/nbd_*.3*
218 %files -n ocaml-%{name}
219 %defattr(644,root,root,755)
220 %dir %{_libdir}/ocaml/nbd
221 %{_libdir}/ocaml/nbd/META
222 %{_libdir}/ocaml/nbd/NBD.cmi
223 %{_libdir}/ocaml/nbd/mlnbd.cma
224 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllmlnbd.so
226 %files -n ocaml-%{name}-devel
227 %defattr(644,root,root,755)
228 %doc ocaml/examples/{LICENSE-FOR-EXAMPLES,*.ml}
229 %{_libdir}/ocaml/nbd/NBD.mli
230 %{_libdir}/ocaml/nbd/libmlnbd.a
231 %if %{with ocaml_opt}
232 %{_libdir}/ocaml/nbd/NBD.cmx
233 %{_libdir}/ocaml/nbd/mlnbd.a
234 %{_libdir}/ocaml/nbd/mlnbd.cmxa
236 %{_mandir}/man3/libnbd-ocaml.3*
237 %{_mandir}/man3/NBD.3*
238 %{_mandir}/man3/NBD.*.3*
241 %files -n python3-%{name}
242 %defattr(644,root,root,755)
243 %attr(755,root,root) %{_bindir}/nbdsh
244 %attr(755,root,root) %{py3_sitedir}/libnbdmod.cpython-*.so
245 %{py3_sitedir}/nbd.py
246 %{py3_sitedir}/nbdsh.py
247 %{py3_sitedir}/__pycache__/nbd.cpython-*.py[co]
248 %{py3_sitedir}/__pycache__/nbdsh.cpython-*.py[co]
249 %{_mandir}/man1/nbdsh.1*
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/nbdfuse
254 %{_mandir}/man1/nbdfuse.1*
256 %files -n bash-completion-%{name}
257 %defattr(644,root,root,755)
258 %{bash_compdir}/nbdcopy
259 %{bash_compdir}/nbdfuse
260 %{bash_compdir}/nbdinfo
261 %{bash_compdir}/nbdsh