]>
Commit | Line | Data |
---|---|---|
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 | 13 | Summary: NBD client library in userspace |
08c044b9 | 14 | Summary(pl.UTF-8): Biblioteka klienta NBD w przestrzeni użytkownika |
ad92033b | 15 | Name: libnbd |
30a536c1 | 16 | Version: 1.16.2 |
6fd94a73 | 17 | Release: 1 |
ad92033b | 18 | License: LGPL v2+ |
08c044b9 | 19 | Group: Libraries |
30a536c1 JB |
20 | Source0: https://download.libguestfs.org/libnbd/1.16-stable/%{name}-%{version}.tar.gz |
21 | # Source0-md5: 4dd9b0e5ac6a7f3fa95cf750db4aaa2f | |
ad92033b | 22 | URL: https://github.com/libguestfs/libnbd |
30a536c1 JB |
23 | BuildRequires: autoconf >= 2.50 |
24 | BuildRequires: automake | |
25 | BuildRequires: bash-completion-devel >= 1:2.0 | |
08c044b9 JB |
26 | BuildRequires: glib2-devel >= 2.0 |
27 | BuildRequires: gnutls-devel >= 3.3.0 | |
ad92033b | 28 | BuildRequires: jq |
c0484994 | 29 | BuildRequires: libfuse3-devel >= 3 |
ad92033b | 30 | BuildRequires: libstdc++-devel |
30a536c1 | 31 | BuildRequires: libtool >= 2:2 |
08c044b9 | 32 | BuildRequires: libxml2-devel >= 2.0 |
9fb82411 | 33 | %if %{with ocaml} |
ad92033b AM |
34 | BuildRequires: ocaml |
35 | BuildRequires: ocaml-findlib | |
36 | BuildRequires: ocaml-ocamldoc | |
9fb82411 | 37 | %endif |
08c044b9 JB |
38 | BuildRequires: perl-tools-pod |
39 | BuildRequires: pkgconfig | |
40 | BuildRequires: python3-devel >= 1:3.2 | |
41 | BuildRequires: rpm-build >= 4.6 | |
866babf3 | 42 | BuildRequires: rpmbuild(macros) >= 1.673 |
85160e2b | 43 | %{?with_ublk:BuildRequires: ubdsrv-devel} |
ad92033b | 44 | BuildRequires: util-linux |
08c044b9 | 45 | BuildRoot: %{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 | |
52 | NBD - Network Block Device - is a protocol for accessing Block Devices | |
53 | (hard disks and disk-like things) over a Network. | |
54 | ||
55 | This is the NBD client library in userspace, a simple library for | |
56 | writing NBD clients. | |
57 | ||
58 | The 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 |
67 | NBD - Network Block Device - to protokół pozwalający na dostęp do | |
68 | urządzeń blokowych (dysków twardych i rzeczy dyskopodobnych) po sieci. | |
69 | ||
70 | Ten pakiet zawiera bibliotekę klienta NBD w przestrzeni użytkownika - | |
71 | prostą bibliotekę do pisania klientów NBD. | |
72 | ||
73 | Głó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 |
82 | Summary: Development headers for NBD library |
83 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki NBD | |
84 | License: LGPL v2+ and BSD | |
85 | Group: Development/Libraries | |
ad92033b AM |
86 | Requires: %{name} = %{version}-%{release} |
87 | ||
88 | %description devel | |
08c044b9 JB |
89 | This package contains development headers for NBD library. |
90 | ||
91 | %description devel -l pl.UTF-8 | |
92 | Ten pakiet zawiera pliki nagłówkowe biblioteki NBD. | |
ad92033b AM |
93 | |
94 | %package -n ocaml-%{name} | |
08c044b9 JB |
95 | Summary: OCaml language bindings for NBD library |
96 | Summary(pl.UTF-8): Wiązania OCamla do biblioteki NBD | |
97 | Group: Libraries | |
ad92033b AM |
98 | Requires: %{name} = %{version}-%{release} |
99 | ||
100 | %description -n ocaml-%{name} | |
08c044b9 JB |
101 | This package contains OCaml language bindings for NBD library. |
102 | ||
103 | %description -n ocaml-%{name} -l pl.UTF-8 | |
104 | Ten pakiet zawiera wiązania OCamla do biblioteki NBD. | |
ad92033b AM |
105 | |
106 | %package -n ocaml-%{name}-devel | |
08c044b9 JB |
107 | Summary: OCaml language development package for NBD library |
108 | Summary(pl.UTF-8): Pakiet programistyczny wiązań OCamla do biblioteki NBD | |
109 | Group: Development/Libraries | |
ad92033b AM |
110 | Requires: ocaml-%{name} = %{version}-%{release} |
111 | ||
112 | %description -n ocaml-%{name}-devel | |
08c044b9 JB |
113 | This package contains OCaml language development package for NBD |
114 | library. Install this if you want to compile OCaml software which uses | |
115 | NBD. | |
116 | ||
117 | %description -n ocaml-%{name}-devel -l pl.UTF-8 | |
118 | Pakiet programistyczny wiązań OCamla do biblioteki NBD. Należy go | |
119 | zainstalować, aby móc kompilować programy w OCamlu wykorzystujące NBD. | |
ad92033b AM |
120 | |
121 | %package -n python3-%{name} | |
08c044b9 JB |
122 | Summary: Python 3 bindings for NBD library |
123 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki NBD | |
124 | Group: Libraries/Python | |
ad92033b | 125 | Requires: %{name} = %{version}-%{release} |
ad92033b AM |
126 | |
127 | %description -n python3-%{name} | |
08c044b9 JB |
128 | This package contains Python 3 bindings for NBD library. |
129 | ||
130 | %description -n python3-%{name} -l pl.UTF-8 | |
131 | Ten pakiet zawiera wiązania Pythona do biblioteki NBD. | |
ad92033b AM |
132 | |
133 | %package -n nbdfuse | |
08c044b9 JB |
134 | Summary: FUSE support for NBD library |
135 | Summary(pl.UTF-8): Obsługa FUSE do biblioteki NBD | |
136 | License: LGPL v2+ and BSD | |
137 | Group: Applications/System | |
ad92033b AM |
138 | Requires: %{name} = %{version}-%{release} |
139 | ||
140 | %description -n nbdfuse | |
08c044b9 JB |
141 | This package contains FUSE support for NBD library. |
142 | ||
143 | %description -n nbdfuse -l pl.UTF-8 | |
144 | Ten pakiet zawiera obsługę FUSE do biblioteki NBD. | |
ad92033b | 145 | |
08c044b9 JB |
146 | %package -n bash-completion-%{name} |
147 | Summary: Bash tab-completion for NBD utilities | |
148 | Summary(pl.UTF-8): Bashowe uzupełnianie parametrów dla narzędzi NBD | |
149 | Group: Applications/Shells | |
ad92033b | 150 | Requires: %{name} = %{version}-%{release} |
30a536c1 | 151 | Requires: bash-completion >= 1:2.0 |
08c044b9 | 152 | Obsoletes: libnbd-bash-completion < 1.6.2 |
ad92033b AM |
153 | BuildArch: noarch |
154 | ||
08c044b9 | 155 | %description -n bash-completion-%{name} |
ad92033b | 156 | Install this package if you want intelligent bash tab-completion for |
08c044b9 JB |
157 | NBD utilities (nbdcopy, nbdfuse, nbdinfo, nbdsh). |
158 | ||
159 | %description -n bash-completion-%{name} -l pl.UTF | |
160 | Ten pakiet należy zainstalować, aby uzyskać inteligentne dopełnianie | |
161 | parametró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 | |
186 | rm -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. |
195 | find $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 | |
205 | rm -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 |