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