]> git.pld-linux.org Git - packages/libnbd.git/blob - libnbd.spec
7941c31c2506a3c88f17c25835d8f6effb27587d
[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.6.2
16 Release:        3
17 License:        LGPL v2+
18 Group:          Libraries
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
25 BuildRequires:  jq
26 BuildRequires:  libfuse-devel
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:  util-linux
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
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.*
44
45 %description
46 NBD - Network Block Device - is a protocol for accessing Block Devices
47 (hard disks and disk-like things) over a Network.
48
49 This is the NBD client library in userspace, a simple library for
50 writing NBD clients.
51
52 The key features are:
53  - Synchronous and asynchronous APIs, both for ease of use and for
54    writing non-blocking, multithreaded clients.
55  - High performance.
56  - Minimal dependencies for the basic library.
57  - Well-documented, stable API.
58  - Bindings in several programming languages.
59
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.
63
64 Ten pakiet zawiera bibliotekę klienta NBD w przestrzeni użytkownika -
65 prostą bibliotekę do pisania klientów NBD.
66
67 Główne cechy to:
68 - API synchroniczne i asynchroniczne, zarówno w celu ułatwienia
69   użycia, jak i pisania nieblokujących, wielowątkowych klientów
70 - wysoka wydajność
71 - minimalne zależności dla podstawowej biblioteki
72 - dobrze udokumentowane, stabilne API
73 - wiązania do kilku języków programowania
74
75 %package devel
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}
81
82 %description devel
83 This package contains development headers for NBD library.
84
85 %description devel -l pl.UTF-8
86 Ten pakiet zawiera pliki nagłówkowe biblioteki NBD.
87
88 %package -n ocaml-%{name}
89 Summary:        OCaml language bindings for NBD library
90 Summary(pl.UTF-8):      Wiązania OCamla do biblioteki NBD
91 Group:          Libraries
92 Requires:       %{name} = %{version}-%{release}
93
94 %description -n ocaml-%{name}
95 This package contains OCaml language bindings for NBD library.
96
97 %description -n ocaml-%{name} -l pl.UTF-8
98 Ten pakiet zawiera wiązania OCamla do biblioteki NBD.
99
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}
105
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
109 NBD.
110
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.
114
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}
120
121 %description -n python3-%{name}
122 This package contains Python 3 bindings for NBD library.
123
124 %description -n python3-%{name} -l pl.UTF-8
125 Ten pakiet zawiera wiązania Pythona do biblioteki NBD.
126
127 %package -n nbdfuse
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}
133
134 %description -n nbdfuse
135 This package contains FUSE support for NBD library.
136
137 %description -n nbdfuse -l pl.UTF-8
138 Ten pakiet zawiera obsługę FUSE do biblioteki NBD.
139
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
147 BuildArch:      noarch
148
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).
152
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).
156
157 %prep
158 %setup -q
159
160 %build
161 %configure \
162         PYTHON=%{__python3} \
163         --enable-fuse \
164         --disable-golang \
165         %{__enable_disable ocaml} \
166         --enable-python \
167         --disable-static \
168         --with-python-installdir=%{py3_sitedir} \
169         --with-tls-priority=@LIBNBD,SYSTEM
170
171 %{__make}
172
173 %install
174 rm -rf $RPM_BUILD_ROOT
175
176 %{__make} install \
177         DESTDIR=$RPM_BUILD_ROOT
178
179 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
180 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
181
182 # Delete libtool crap.
183 find $RPM_BUILD_ROOT -name '*.la' -delete
184
185 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.owner
186
187 # Delete the golang man page since we're not distributing the bindings.
188 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3*
189
190 %clean
191 rm -rf $RPM_BUILD_ROOT
192
193 %post   -p /sbin/ldconfig
194 %postun -p /sbin/ldconfig
195
196 %files
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*
205
206 %files devel
207 %defattr(644,root,root,755)
208 %doc examples/{LICENSE-FOR-EXAMPLES,*.c}
209 %{_libdir}/libnbd.so
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*
216
217 %if %{with ocaml}
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
225
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
235 %endif
236 %{_mandir}/man3/libnbd-ocaml.3*
237 %{_mandir}/man3/NBD.3*
238 %{_mandir}/man3/NBD.*.3*
239 %endif
240
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*
250
251 %files -n nbdfuse
252 %defattr(644,root,root,755)
253 %attr(755,root,root) %{_bindir}/nbdfuse
254 %{_mandir}/man1/nbdfuse.1*
255
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
This page took 0.086832 seconds and 2 git commands to generate.