]> git.pld-linux.org Git - packages/libnbd.git/blame - libnbd.spec
- added ublk support
[packages/libnbd.git] / libnbd.spec
CommitLineData
85160e2b 1# TODO: golang support
bc21fabc
JB
2#
3# Conditional build:
9fb82411 4%bcond_without ocaml # Ocaml bindings
bc21fabc 5%bcond_without ocaml_opt # native optimized binaries
85160e2b 6%bcond_without ublk # ublksrv support
bc21fabc
JB
7
8# not yet available on x32 (ocaml 4.02.1), update when upstream will support it
9%ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
10%undefine with_ocaml_opt
11%endif
12
ad92033b 13Summary: NBD client library in userspace
08c044b9 14Summary(pl.UTF-8): Biblioteka klienta NBD w przestrzeni użytkownika
ad92033b 15Name: libnbd
30a536c1 16Version: 1.16.2
6fd94a73 17Release: 1
ad92033b 18License: LGPL v2+
08c044b9 19Group: Libraries
30a536c1
JB
20Source0: https://download.libguestfs.org/libnbd/1.16-stable/%{name}-%{version}.tar.gz
21# Source0-md5: 4dd9b0e5ac6a7f3fa95cf750db4aaa2f
ad92033b 22URL: https://github.com/libguestfs/libnbd
30a536c1
JB
23BuildRequires: autoconf >= 2.50
24BuildRequires: automake
25BuildRequires: bash-completion-devel >= 1:2.0
08c044b9
JB
26BuildRequires: glib2-devel >= 2.0
27BuildRequires: gnutls-devel >= 3.3.0
ad92033b 28BuildRequires: jq
c0484994 29BuildRequires: libfuse3-devel >= 3
ad92033b 30BuildRequires: libstdc++-devel
30a536c1 31BuildRequires: libtool >= 2:2
08c044b9 32BuildRequires: libxml2-devel >= 2.0
9fb82411 33%if %{with ocaml}
ad92033b
AM
34BuildRequires: ocaml
35BuildRequires: ocaml-findlib
36BuildRequires: ocaml-ocamldoc
9fb82411 37%endif
08c044b9
JB
38BuildRequires: perl-tools-pod
39BuildRequires: pkgconfig
40BuildRequires: python3-devel >= 1:3.2
41BuildRequires: rpm-build >= 4.6
866babf3 42BuildRequires: rpmbuild(macros) >= 1.673
85160e2b 43%{?with_ublk:BuildRequires: ubdsrv-devel}
ad92033b 44BuildRequires: util-linux
08c044b9 45BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
ad92033b
AM
46
47# The Python module happens to be called lib*.so. Don't scan it and
48# have a bogus "Provides: libnbdmod.*".
08c044b9 49%define _noautoprovfiles %{py3_sitedir}/libnbdmod.*
ad92033b
AM
50
51%description
52NBD - Network Block Device - is a protocol for accessing Block Devices
53(hard disks and disk-like things) over a Network.
54
55This is the NBD client library in userspace, a simple library for
56writing NBD clients.
57
58The key features are:
ad92033b
AM
59 - Synchronous and asynchronous APIs, both for ease of use and for
60 writing non-blocking, multithreaded clients.
ad92033b 61 - High performance.
ad92033b 62 - Minimal dependencies for the basic library.
ad92033b 63 - Well-documented, stable API.
ad92033b
AM
64 - Bindings in several programming languages.
65
08c044b9
JB
66%description -l pl.UTF-8
67NBD - Network Block Device - to protokół pozwalający na dostęp do
68urządzeń blokowych (dysków twardych i rzeczy dyskopodobnych) po sieci.
69
70Ten pakiet zawiera bibliotekę klienta NBD w przestrzeni użytkownika -
71prostą bibliotekę do pisania klientów NBD.
72
73Główne cechy to:
74- API synchroniczne i asynchroniczne, zarówno w celu ułatwienia
75 użycia, jak i pisania nieblokujących, wielowątkowych klientów
76- wysoka wydajność
77- minimalne zależności dla podstawowej biblioteki
78- dobrze udokumentowane, stabilne API
79- wiązania do kilku języków programowania
80
ad92033b 81%package devel
08c044b9
JB
82Summary: Development headers for NBD library
83Summary(pl.UTF-8): Pliki nagłówkowe biblioteki NBD
84License: LGPL v2+ and BSD
85Group: Development/Libraries
ad92033b
AM
86Requires: %{name} = %{version}-%{release}
87
88%description devel
08c044b9
JB
89This package contains development headers for NBD library.
90
91%description devel -l pl.UTF-8
92Ten pakiet zawiera pliki nagłówkowe biblioteki NBD.
ad92033b
AM
93
94%package -n ocaml-%{name}
08c044b9
JB
95Summary: OCaml language bindings for NBD library
96Summary(pl.UTF-8): Wiązania OCamla do biblioteki NBD
97Group: Libraries
ad92033b
AM
98Requires: %{name} = %{version}-%{release}
99
100%description -n ocaml-%{name}
08c044b9
JB
101This package contains OCaml language bindings for NBD library.
102
103%description -n ocaml-%{name} -l pl.UTF-8
104Ten pakiet zawiera wiązania OCamla do biblioteki NBD.
ad92033b
AM
105
106%package -n ocaml-%{name}-devel
08c044b9
JB
107Summary: OCaml language development package for NBD library
108Summary(pl.UTF-8): Pakiet programistyczny wiązań OCamla do biblioteki NBD
109Group: Development/Libraries
ad92033b
AM
110Requires: ocaml-%{name} = %{version}-%{release}
111
112%description -n ocaml-%{name}-devel
08c044b9
JB
113This package contains OCaml language development package for NBD
114library. Install this if you want to compile OCaml software which uses
115NBD.
116
117%description -n ocaml-%{name}-devel -l pl.UTF-8
118Pakiet programistyczny wiązań OCamla do biblioteki NBD. Należy go
119zainstalować, aby móc kompilować programy w OCamlu wykorzystujące NBD.
ad92033b
AM
120
121%package -n python3-%{name}
08c044b9
JB
122Summary: Python 3 bindings for NBD library
123Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki NBD
124Group: Libraries/Python
ad92033b 125Requires: %{name} = %{version}-%{release}
ad92033b
AM
126
127%description -n python3-%{name}
08c044b9
JB
128This package contains Python 3 bindings for NBD library.
129
130%description -n python3-%{name} -l pl.UTF-8
131Ten pakiet zawiera wiązania Pythona do biblioteki NBD.
ad92033b
AM
132
133%package -n nbdfuse
08c044b9
JB
134Summary: FUSE support for NBD library
135Summary(pl.UTF-8): Obsługa FUSE do biblioteki NBD
136License: LGPL v2+ and BSD
137Group: Applications/System
ad92033b
AM
138Requires: %{name} = %{version}-%{release}
139
140%description -n nbdfuse
08c044b9
JB
141This package contains FUSE support for NBD library.
142
143%description -n nbdfuse -l pl.UTF-8
144Ten pakiet zawiera obsługę FUSE do biblioteki NBD.
ad92033b 145
08c044b9
JB
146%package -n bash-completion-%{name}
147Summary: Bash tab-completion for NBD utilities
148Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla narzędzi NBD
149Group: Applications/Shells
ad92033b 150Requires: %{name} = %{version}-%{release}
30a536c1 151Requires: bash-completion >= 1:2.0
08c044b9 152Obsoletes: libnbd-bash-completion < 1.6.2
ad92033b
AM
153BuildArch: noarch
154
08c044b9 155%description -n bash-completion-%{name}
ad92033b 156Install this package if you want intelligent bash tab-completion for
08c044b9
JB
157NBD utilities (nbdcopy, nbdfuse, nbdinfo, nbdsh).
158
159%description -n bash-completion-%{name} -l pl.UTF
160Ten pakiet należy zainstalować, aby uzyskać inteligentne dopełnianie
161parametrów dla narzędzi NBD (nbdcopy, nbdfuse, nbdinfo, nbdsh).
ad92033b
AM
162
163%prep
164%setup -q
165
166%build
5557902f
JB
167%{__libtoolize}
168%{__aclocal} -I m4
169%{__autoconf}
170%{__autoheader}
171%{__automake}
ad92033b
AM
172%configure \
173 PYTHON=%{__python3} \
ad92033b 174 --enable-fuse \
08c044b9 175 --disable-golang \
9fb82411 176 %{__enable_disable ocaml} \
08c044b9
JB
177 --enable-python \
178 --disable-static \
85160e2b 179 %{!?with_ublk:--disable-ublk} \
08c044b9
JB
180 --with-python-installdir=%{py3_sitedir} \
181 --with-tls-priority=@LIBNBD,SYSTEM
ad92033b
AM
182
183%{__make}
184
185%install
186rm -rf $RPM_BUILD_ROOT
187
188%{__make} install \
189 DESTDIR=$RPM_BUILD_ROOT
190
08c044b9
JB
191%py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
192%py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
193
ad92033b
AM
194# Delete libtool crap.
195find $RPM_BUILD_ROOT -name '*.la' -delete
196
9f50be2f 197%if %{with ocaml}
08c044b9 198%{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.owner
9f50be2f 199%endif
08c044b9 200
ad92033b 201# Delete the golang man page since we're not distributing the bindings.
08c044b9 202%{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3*
ad92033b
AM
203
204%clean
205rm -rf $RPM_BUILD_ROOT
206
08c044b9
JB
207%post -p /sbin/ldconfig
208%postun -p /sbin/ldconfig
209
ad92033b
AM
210%files
211%defattr(644,root,root,755)
30a536c1 212%doc README.md SECURITY TODO
ad92033b 213%attr(755,root,root) %{_bindir}/nbdcopy
30a536c1 214%attr(755,root,root) %{_bindir}/nbddump
ad92033b 215%attr(755,root,root) %{_bindir}/nbdinfo
08c044b9
JB
216%attr(755,root,root) %{_libdir}/libnbd.so.*.*.*
217%ghost %{_libdir}/libnbd.so.0
ad92033b 218%{_mandir}/man1/nbdcopy.1*
30a536c1 219%{_mandir}/man1/nbddump.1*
ad92033b 220%{_mandir}/man1/nbdinfo.1*
85160e2b
JB
221%if %{with ublk}
222%attr(755,root,root) %{_bindir}/nbdublk
223%{_mandir}/man1/nbdublk.1*
224%endif
ad92033b
AM
225
226%files devel
227%defattr(644,root,root,755)
bc21fabc 228%doc examples/{LICENSE-FOR-EXAMPLES,*.c}
ad92033b 229%{_libdir}/libnbd.so
08c044b9 230%{_includedir}/libnbd.h
ad92033b
AM
231%{_pkgconfigdir}/libnbd.pc
232%{_mandir}/man3/libnbd.3*
233%{_mandir}/man1/libnbd-release-notes-1.*.1*
234%{_mandir}/man3/libnbd-security.3*
235%{_mandir}/man3/nbd_*.3*
236
9fb82411 237%if %{with ocaml}
ad92033b
AM
238%files -n ocaml-%{name}
239%defattr(644,root,root,755)
08c044b9
JB
240%dir %{_libdir}/ocaml/nbd
241%{_libdir}/ocaml/nbd/META
242%{_libdir}/ocaml/nbd/NBD.cmi
15018d3c 243%{_libdir}/ocaml/nbd/mlnbd.cma
08c044b9 244%attr(755,root,root) %{_libdir}/ocaml/stublibs/dllmlnbd.so
ad92033b
AM
245
246%files -n ocaml-%{name}-devel
247%defattr(644,root,root,755)
bc21fabc 248%doc ocaml/examples/{LICENSE-FOR-EXAMPLES,*.ml}
08c044b9
JB
249%{_libdir}/ocaml/nbd/NBD.mli
250%{_libdir}/ocaml/nbd/libmlnbd.a
bc21fabc
JB
251%if %{with ocaml_opt}
252%{_libdir}/ocaml/nbd/NBD.cmx
08c044b9
JB
253%{_libdir}/ocaml/nbd/mlnbd.a
254%{_libdir}/ocaml/nbd/mlnbd.cmxa
bc21fabc 255%endif
ad92033b
AM
256%{_mandir}/man3/libnbd-ocaml.3*
257%{_mandir}/man3/NBD.3*
258%{_mandir}/man3/NBD.*.3*
9fb82411 259%endif
ad92033b
AM
260
261%files -n python3-%{name}
262%defattr(644,root,root,755)
08c044b9
JB
263%attr(755,root,root) %{_bindir}/nbdsh
264%attr(755,root,root) %{py3_sitedir}/libnbdmod.cpython-*.so
ad92033b
AM
265%{py3_sitedir}/nbd.py
266%{py3_sitedir}/nbdsh.py
08c044b9
JB
267%{py3_sitedir}/__pycache__/nbd.cpython-*.py[co]
268%{py3_sitedir}/__pycache__/nbdsh.cpython-*.py[co]
ad92033b
AM
269%{_mandir}/man1/nbdsh.1*
270
271%files -n nbdfuse
272%defattr(644,root,root,755)
273%attr(755,root,root) %{_bindir}/nbdfuse
274%{_mandir}/man1/nbdfuse.1*
275
08c044b9 276%files -n bash-completion-%{name}
ad92033b 277%defattr(644,root,root,755)
ad92033b 278%{bash_compdir}/nbdcopy
30a536c1 279%{bash_compdir}/nbddump
ad92033b
AM
280%{bash_compdir}/nbdfuse
281%{bash_compdir}/nbdinfo
282%{bash_compdir}/nbdsh
30a536c1 283%{bash_compdir}/nbdublk
This page took 0.176641 seconds and 4 git commands to generate.