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