822a4c4
%global _hardened_build 1
822a4c4
89736ec
%ifarch %{arm} %{ix86} x86_64 ppc %{power64}
89736ec
%global have_libguestfs 1
89736ec
%endif
89736ec
822a4c4
Name:           nbdkit
f831942
Version:        1.1.9
5101c50
Release:        2%{?dist}
822a4c4
Summary:        NBD server
822a4c4
822a4c4
License:        BSD
822a4c4
URL:            https://github.com/libguestfs/nbdkit
822a4c4
Source0:        http://libguestfs.org/download/nbdkit/%{name}-%{version}.tar.gz
822a4c4
5101c50
Patch1:         0001-streaming-Update-the-buf-pointer-when-doing-partial-.patch
5101c50
822a4c4
BuildRequires:  /usr/bin/pod2man
89736ec
%if 0%{?have_libguestfs}
e90cb03
BuildRequires:  libguestfs-devel
89736ec
%endif
822a4c4
BuildRequires:  libvirt-devel
822a4c4
BuildRequires:  xz-devel
822a4c4
BuildRequires:  zlib-devel
c5f47c4
BuildRequires:  libcurl-devel
7d11988
BuildRequires:  perl-devel
17988a9
BuildRequires:  perl(ExtUtils::Embed)
adaec4f
BuildRequires:  python-devel
822a4c4
822a4c4
822a4c4
%description
822a4c4
NBD is a protocol for accessing block devices (hard disks and
822a4c4
disk-like things) over the network.
822a4c4
822a4c4
'nbdkit' is a toolkit for creating NBD servers.
822a4c4
822a4c4
The key features are:
822a4c4
822a4c4
* Multithreaded NBD server written in C with good performance.
822a4c4
822a4c4
* Well-documented, simple plugin API with a stable ABI guarantee.
54a0400
  Allows you to export "unconventional" block devices easily.
822a4c4
822a4c4
* Liberal license (BSD) allows nbdkit to be linked to proprietary
822a4c4
  libraries or included in proprietary code.
822a4c4
822a4c4
You probably want to install one of more plugins (%{name}-plugin-*).
822a4c4
822a4c4
To develop plugins, install the %{name}-devel package and start by
822a4c4
reading the nbdkit(1) and nbdkit-plugin(3) manual pages.
822a4c4
822a4c4
c5f47c4
%package plugin-curl
c5f47c4
Summary:        HTTP/FTP/SSH (cURL) plugin for %{name}
c5f47c4
License:        BSD
c5f47c4
c5f47c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
c5f47c4
c5f47c4
c5f47c4
%description plugin-curl
c5f47c4
This package contains cURL (HTTP/FTP/SSH) support for %{name}.
c5f47c4
c5f47c4
822a4c4
%package plugin-examples
822a4c4
Summary:        Example plugins for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description plugin-examples
822a4c4
This package contains example plugins for %{name}.
822a4c4
822a4c4
822a4c4
%package plugin-file
822a4c4
Summary:        File serving plugin for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description plugin-file
822a4c4
This package is a file serving plugin for %{name}.
822a4c4
822a4c4
89736ec
%if 0%{?have_libguestfs}
e90cb03
%package plugin-guestfs
e90cb03
Summary:        libguestfs plugin for %{name}
e90cb03
License:        BSD
e90cb03
e90cb03
Requires:       %{name}%{?_isa} = %{version}-%{release}
e90cb03
e90cb03
e90cb03
%description plugin-guestfs
e90cb03
This package is a libguestfs plugin for %{name}.
89736ec
%endif
e90cb03
e90cb03
822a4c4
%package plugin-gzip
822a4c4
Summary:        GZip file serving plugin for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description plugin-gzip
822a4c4
This package is a gzip file serving plugin for %{name}.
822a4c4
822a4c4
822a4c4
%package plugin-libvirt
822a4c4
Summary:        Libvirt plugin for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description plugin-libvirt
822a4c4
This package is a libvirt plugin for %{name}.  It lets you access
822a4c4
libvirt guest disks readonly.  It is implemented using the libvirt
822a4c4
virDomainBlockPeek API.
822a4c4
822a4c4
7d11988
%package plugin-perl
7d11988
Summary:        Perl plugin for %{name}
7d11988
License:        BSD
7d11988
7d11988
Requires:       %{name}%{?_isa} = %{version}-%{release}
7d11988
7d11988
7d11988
%description plugin-perl
7d11988
This package lets you write Perl plugins for %{name}.
7d11988
7d11988
adaec4f
%package plugin-python
adaec4f
Summary:        Python plugin for %{name}
adaec4f
License:        BSD
adaec4f
adaec4f
Requires:       %{name}%{?_isa} = %{version}-%{release}
adaec4f
adaec4f
adaec4f
%description plugin-python
adaec4f
This package lets you write Python plugins for %{name}.
adaec4f
adaec4f
f831942
%package plugin-streaming
f831942
Summary:        Streaming file serving plugin for %{name}
f831942
License:        BSD
f831942
f831942
Requires:       %{name}%{?_isa} = %{version}-%{release}
f831942
f831942
f831942
%description plugin-streaming
f831942
This package is a streaming plugin for %{name}.
f831942
f831942
822a4c4
%package plugin-xz
822a4c4
Summary:        XZ file serving plugin for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description plugin-xz
822a4c4
This package is a xz file serving plugin for %{name}.
822a4c4
822a4c4
822a4c4
%package devel
822a4c4
Summary:        Development files and documentation for %{name}
822a4c4
License:        BSD
822a4c4
822a4c4
Requires:       %{name}%{?_isa} = %{version}-%{release}
822a4c4
822a4c4
822a4c4
%description devel
822a4c4
This package contains development files and documentation
822a4c4
for %{name}.  Install this package if you want to develop
822a4c4
plugins for %{name}.
822a4c4
822a4c4
822a4c4
%prep
822a4c4
%setup -q
822a4c4
5101c50
%patch1 -p1
5101c50
822a4c4
822a4c4
%build
822a4c4
# Force immediate binding for hardened build for plugins.
822a4c4
# https://bugzilla.redhat.com/show_bug.cgi?id=977446#c13
822a4c4
export LDFLAGS="$LDFLAGS -Wl,-z,now"
822a4c4
%configure --disable-static
822a4c4
make %{?_smp_mflags}
822a4c4
822a4c4
822a4c4
%install
822a4c4
%make_install
822a4c4
822a4c4
# Delete libtool crap.
822a4c4
find $RPM_BUILD_ROOT -name '*.la' -delete
822a4c4
822a4c4
e90cb03
%check
479fe8e
# Workaround for broken libvirt (RHBZ#1138604).
479fe8e
mkdir -p $HOME/.cache/libvirt
479fe8e
7647dbf
# libguestfs 1.20 in Fedora 18 doesn't support NBD client protocol, so
7647dbf
# the tests cannot be run.
fc4520f
%if 0%{?fedora} >= 19
89736ec
# Unlikely that libguestfs will work on ARM and PPC, so don't try running the
fc4520f
# tests there.
89736ec
%ifnarch %{arm} ppc %{power64}
e90cb03
make check
7647dbf
%endif
fc4520f
%endif
e90cb03
e90cb03
822a4c4
%files
822a4c4
%doc LICENSE README
822a4c4
%{_sbindir}/nbdkit
822a4c4
%dir %{_libdir}/%{name}
822a4c4
%dir %{_libdir}/%{name}/plugins
822a4c4
%{_mandir}/man1/nbdkit.1*
822a4c4
822a4c4
c5f47c4
%files plugin-curl
c5f47c4
%doc LICENSE README
c5f47c4
%{_libdir}/%{name}/plugins/nbdkit-curl-plugin.so
c5f47c4
%{_mandir}/man1/nbdkit-curl-plugin.1*
c5f47c4
c5f47c4
822a4c4
%files plugin-examples
822a4c4
%doc LICENSE README
822a4c4
%{_libdir}/%{name}/plugins/nbdkit-example*-plugin.so
822a4c4
%{_mandir}/man1/nbdkit-example*-plugin.1*
822a4c4
822a4c4
822a4c4
%files plugin-file
822a4c4
%doc LICENSE README
822a4c4
%{_libdir}/%{name}/plugins/nbdkit-file-plugin.so
822a4c4
%{_mandir}/man1/nbdkit-file-plugin.1*
822a4c4
822a4c4
89736ec
%if 0%{?have_libguestfs}
e90cb03
%files plugin-guestfs
e90cb03
%doc LICENSE README
e90cb03
%{_libdir}/%{name}/plugins/nbdkit-guestfs-plugin.so
e90cb03
%{_mandir}/man1/nbdkit-guestfs-plugin.1*
89736ec
%endif
e90cb03
e90cb03
822a4c4
%files plugin-gzip
822a4c4
%doc LICENSE README
822a4c4
%{_libdir}/%{name}/plugins/nbdkit-gzip-plugin.so
822a4c4
%{_mandir}/man1/nbdkit-gzip-plugin.1*
822a4c4
822a4c4
822a4c4
%files plugin-libvirt
822a4c4
%doc LICENSE README
822a4c4
%{_libdir}/%{name}/plugins/nbdkit-libvirt-plugin.so
822a4c4
%{_mandir}/man1/nbdkit-libvirt-plugin.1*
822a4c4
822a4c4
7d11988
%files plugin-perl
7d11988
%doc LICENSE README
7d11988
%{_libdir}/%{name}/plugins/nbdkit-perl-plugin.so
adaec4f
%{_mandir}/man3/nbdkit-perl-plugin.3*
adaec4f
adaec4f
adaec4f
%files plugin-python
adaec4f
%doc LICENSE README
adaec4f
%{_libdir}/%{name}/plugins/nbdkit-python-plugin.so
adaec4f
%{_mandir}/man3/nbdkit-python-plugin.3*
7d11988
7d11988
f831942
%files plugin-streaming
f831942
%doc LICENSE README
f831942
%{_libdir}/%{name}/plugins/nbdkit-streaming-plugin.so
f831942
%{_mandir}/man1/nbdkit-streaming-plugin.1*
f831942
f831942
822a4c4
%files plugin-xz
822a4c4
%doc LICENSE README
822a4c4
%{_libdir}/%{name}/plugins/nbdkit-xz-plugin.so
822a4c4
%{_mandir}/man1/nbdkit-xz-plugin.1*
822a4c4
822a4c4
822a4c4
%files devel
822a4c4
%doc LICENSE README TODO
822a4c4
# Include the source of the example plugins in the documentation.
822a4c4
%doc plugins/example*/*.c
7d11988
%doc plugins/perl/example.pl
adaec4f
%doc plugins/python/example.py
822a4c4
%{_includedir}/nbdkit-plugin.h
822a4c4
%{_mandir}/man3/nbdkit-plugin.3*
822a4c4
822a4c4
822a4c4
%changelog
5101c50
* Tue Oct 14 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.9-2
f831942
- New upstream version 1.1.9.
f831942
- Add the streaming plugin.
5101c50
- Include fix for streaming plugin in 1.1.9.
f831942
479fe8e
* Wed Sep 10 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.8-4
a6ef6c2
- Rebuild for updated Perl in Rawhide.
479fe8e
- Workaround for broken libvirt (RHBZ#1138604).
a6ef6c2
d37de2e
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.8-2
d37de2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
d37de2e
c5f47c4
* Sat Jun 21 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.8-1
c5f47c4
- New upstream version 1.1.8.
c5f47c4
- Add support for cURL, and new nbdkit-plugin-curl package.
c5f47c4
6056e46
* Fri Jun 20 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.7-1
6056e46
- New upstream version 1.1.7.
6056e46
- Remove patches which are now all upstream.
6056e46
01cfedc
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-5
01cfedc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
01cfedc
89736ec
* Thu Mar 06 2014 Dan HorĂ¡k <dan[at]danny.cz> - 1.1.6-4
89736ec
- libguestfs is available only on selected arches
89736ec
0bd3ff7
* Fri Feb 21 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-3
fe5a3ca
- Backport some upstream patches, fixing a minor bug and adding more tests.
fe5a3ca
- Enable the tests since kernel bug is fixed.
fe5a3ca
a410b8a
* Sun Feb 16 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.6-1
a410b8a
- New upstream version 1.1.6.
a410b8a
17988a9
* Sat Feb 15 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.5-2
adaec4f
- New upstream version 1.1.5.
adaec4f
- Enable the new Python plugin.
adaec4f
- Perl plugin man page moved to section 3.
17988a9
- Perl now requires ExtUtils::Embed.
adaec4f
7d11988
* Mon Feb 10 2014 Richard W.M. Jones <rjones@redhat.com> - 1.1.4-1
7d11988
- New upstream version 1.1.4.
7d11988
- Enable the new Perl plugin.
7d11988
32ebeb9
* Sun Aug  4 2013 Richard W.M. Jones <rjones@redhat.com> - 1.1.3-1
32ebeb9
- New upstream version 1.1.3 which fixes some test problems.
54a0400
- Disable tests because Rawhide kernel is broken (RHBZ#991808).
54a0400
- Remove a single quote from description which confused emacs.
0640b32
- Remove patch, now upstream.
54a0400
f722cd3
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.2-4
f722cd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f722cd3
b626755
* Sun Jul 21 2013 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-3
b626755
- Fix segfault when IPv6 client is used (RHBZ#986601).
b626755
7647dbf
* Tue Jul 16 2013 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-2
b405800
- New development version 1.1.2.
7647dbf
- Disable the tests on Fedora <= 18.
b405800
e90cb03
* Tue Jun 25 2013 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-1
e90cb03
- New development version 1.1.1.
e90cb03
- Add libguestfs plugin.
e90cb03
- Run the test suite.
e90cb03
822a4c4
* Mon Jun 24 2013 Richard W.M. Jones <rjones@redhat.com> - 1.0.0-4
822a4c4
- Initial release.