Blame SPECS/libnbd.spec

90b936
# If we should verify tarball signature with GPGv2.
90b936
%global verify_tarball_signature 1
90b936
90b936
# If there are patches which touch autotools files, set this to 1.
6aa05d
%global patches_touch_autotools 1
90b936
90b936
# The source directory.
362730
%global source_directory 1.6-stable
90b936
90b936
Name:           libnbd
362730
Version:        1.6.0
6aa05d
Release:        5%{?dist}
90b936
Summary:        NBD client library in userspace
90b936
90b936
License:        LGPLv2+
90b936
URL:            https://github.com/libguestfs/libnbd
90b936
90b936
Source0:        http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz
90b936
Source1:        http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz.sig
90b936
# Keyring used to verify tarball signature.  This contains the single
90b936
# key from here:
90b936
# https://pgp.key-server.io/pks/lookup?search=rjones%40redhat.com&fingerprint=on&op=vindex
90b936
Source2:       libguestfs.keyring
90b936
362730
# Maintainer script which helps with handling patches.
362730
Source3:        copy-patches.sh
362730
362730
# Patches come from this upstream branch:
6aa05d
# https://github.com/libguestfs/libnbd/tree/rhel-8.6
362730
362730
# Patches.
362730
Patch0001:     0001-copy-copy-nbd-to-sparse-file.sh-Skip-test-unless-nbd.patch
362730
Patch0002:     0002-generator-Refactor-CONNECT.START-state.patch
362730
Patch0003:     0003-generator-Print-a-better-error-message-if-connect-2-.patch
362730
Patch0004:     0004-opt_go-Tolerate-unplanned-server-death.patch
362730
Patch0005:     0005-security-Document-assignment-of-CVE-2021-20286.patch
6aa05d
Patch0006:     0006-copy-Pass-in-dummy-variable-rather-than-errno-to-cal.patch
6aa05d
Patch0007:     0007-copy-CVE-2022-0485-Fail-nbdcopy-if-NBD-read-or-write.patch
362730
90b936
%if 0%{patches_touch_autotools}
90b936
BuildRequires: autoconf, automake, libtool
90b936
%endif
90b936
90b936
%if 0%{verify_tarball_signature}
90b936
BuildRequires:  gnupg2
90b936
%endif
90b936
90b936
# For the core library.
90b936
BuildRequires:  gcc
90b936
BuildRequires:  /usr/bin/pod2man
90b936
BuildRequires:  gnutls-devel
90b936
BuildRequires:  libxml2-devel
90b936
90b936
# For nbdfuse.
90b936
BuildRequires:  fuse, fuse-devel
90b936
90b936
# For the Python 3 bindings.
90b936
BuildRequires:  python3-devel
90b936
90b936
# For the OCaml bindings.
90b936
BuildRequires:  ocaml
90b936
BuildRequires:  ocaml-findlib-devel
362730
BuildRequires:  ocaml-ocamldoc
90b936
90b936
# Only for building the examples.
90b936
BuildRequires:  glib2-devel
90b936
362730
# For bash-completion.
362730
BuildRequires:  bash-completion
362730
90b936
# Only for running the test suite.
362730
BuildRequires:  coreutils
362730
BuildRequires:  gcc-c++
90b936
BuildRequires:  gnutls-utils
362730
#BuildRequires:  jq
90b936
%ifnarch %{ix86}
90b936
BuildRequires:  nbdkit
362730
BuildRequires:  nbdkit-data-plugin
362730
#BuildRequires:  nbdkit-eval-plugin
362730
BuildRequires:  nbdkit-memory-plugin
362730
BuildRequires:  nbdkit-null-plugin
362730
BuildRequires:  nbdkit-pattern-plugin
362730
BuildRequires:  nbdkit-sh-plugin
362730
#BuildRequires:  nbdkit-sparse-random-plugin
362730
#BuildRequires:  nbd
90b936
BuildRequires:  qemu-img
90b936
%endif
362730
BuildRequires:  util-linux
90b936
90b936
90b936
%description
90b936
NBD — Network Block Device — is a protocol for accessing Block Devices
90b936
(hard disks and disk-like things) over a Network.
90b936
90b936
This is the NBD client library in userspace, a simple library for
90b936
writing NBD clients.
90b936
90b936
The key features are:
90b936
90b936
 * Synchronous and asynchronous APIs, both for ease of use and for
90b936
   writing non-blocking, multithreaded clients.
90b936
90b936
 * High performance.
90b936
90b936
 * Minimal dependencies for the basic library.
90b936
90b936
 * Well-documented, stable API.
90b936
90b936
 * Bindings in several programming languages.
90b936
90b936
90b936
%package devel
90b936
Summary:        Development headers for %{name}
90b936
License:        LGPLv2+ and BSD
90b936
Requires:       %{name}%{?_isa} = %{version}-%{release}
90b936
90b936
90b936
%description devel
90b936
This package contains development headers for %{name}.
90b936
90b936
90b936
%package -n ocaml-%{name}
90b936
Summary:        OCaml language bindings for %{name}
90b936
Requires:       %{name}%{?_isa} = %{version}-%{release}
90b936
90b936
90b936
%description -n ocaml-%{name}
90b936
This package contains OCaml language bindings for %{name}.
90b936
90b936
90b936
%package -n ocaml-%{name}-devel
90b936
Summary:        OCaml language development package for %{name}
90b936
Requires:       ocaml-%{name}%{?_isa} = %{version}-%{release}
90b936
90b936
90b936
%description -n ocaml-%{name}-devel
90b936
This package contains OCaml language development package for
90b936
%{name}.  Install this if you want to compile OCaml software which
90b936
uses %{name}.
90b936
90b936
90b936
%package -n python3-%{name}
90b936
Summary:        Python 3 bindings for %{name}
90b936
Requires:       %{name}%{?_isa} = %{version}-%{release}
90b936
%{?python_provide:%python_provide python3-%{name}}
90b936
90b936
# The Python module happens to be called lib*.so.  Don't scan it and
90b936
# have a bogus "Provides: libnbdmod.*".
90b936
%global __provides_exclude_from ^%{python3_sitearch}/lib.*\\.so
90b936
90b936
90b936
%description -n python3-%{name}
90b936
python3-%{name} contains Python 3 bindings for %{name}.
90b936
90b936
90b936
%package -n nbdfuse
90b936
Summary:        FUSE support for %{name}
90b936
License:        LGPLv2+ and BSD
90b936
Requires:       %{name}%{?_isa} = %{version}-%{release}
90b936
90b936
90b936
%description -n nbdfuse
90b936
This package contains FUSE support for %{name}.
90b936
90b936
362730
%package bash-completion
362730
Summary:       Bash tab-completion for %{name}
362730
BuildArch:     noarch
362730
Requires:      bash-completion >= 2.0
362730
# Don't use _isa here because it's a noarch package.  This dependency
362730
# is just to ensure that the subpackage is updated along with libnbd.
362730
Requires:      %{name} = %{version}-%{release}
362730
362730
362730
%description bash-completion
362730
Install this package if you want intelligent bash tab-completion
362730
for %{name}.
362730
362730
90b936
%prep
90b936
%if 0%{verify_tarball_signature}
90b936
tmphome="$(mktemp -d)"
90b936
gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
90b936
%endif
90b936
%autosetup -p1
90b936
%if 0%{patches_touch_autotools}
90b936
autoreconf -i
90b936
%endif
90b936
90b936
90b936
%build
90b936
%configure \
90b936
    --disable-static \
90b936
    --with-tls-priority=@LIBNBD,SYSTEM \
90b936
    PYTHON=%{__python3} \
90b936
    --enable-python \
90b936
    --enable-ocaml \
362730
    --enable-fuse \
362730
    --disable-golang
90b936
90b936
make %{?_smp_mflags}
90b936
90b936
90b936
%install
90b936
%make_install
90b936
90b936
# Delete libtool crap.
90b936
find $RPM_BUILD_ROOT -name '*.la' -delete
90b936
362730
# Delete the golang man page since we're not distributing the bindings.
362730
rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3*
362730
90b936
90b936
%check
90b936
# interop/structured-read.sh fails with the old qemu-nbd in Fedora 29,
90b936
# so disable it there.
90b936
%if 0%{?fedora} <= 29
90b936
rm interop/structured-read.sh
90b936
touch interop/structured-read.sh
90b936
chmod +x interop/structured-read.sh
90b936
%endif
90b936
90b936
# All fuse tests fail in Koji with:
90b936
# fusermount: entry for fuse/test-*.d not found in /etc/mtab
90b936
# for unknown reasons but probably related to the Koji environment.
90b936
for f in fuse/test-*.sh; do
90b936
    rm $f
90b936
    touch $f
90b936
    chmod +x $f
90b936
done
90b936
362730
# info/info-map-base-allocation-json.sh fails because of a bug in
362730
# jq 1.5 in RHEL 8 (fixed in later versions).
362730
rm info/info-map-base-allocation-json.sh
362730
touch info/info-map-base-allocation-json.sh
362730
chmod +x info/info-map-base-allocation-json.sh
362730
90b936
make %{?_smp_mflags} check || {
90b936
    for f in $(find -name test-suite.log); do
90b936
        echo
90b936
        echo "==== $f ===="
90b936
        cat $f
90b936
    done
90b936
    exit 1
90b936
  }
90b936
90b936
90b936
%files
90b936
%doc README
90b936
%license COPYING.LIB
362730
%{_bindir}/nbdcopy
362730
%{_bindir}/nbdinfo
90b936
%{_libdir}/libnbd.so.*
362730
%{_mandir}/man1/nbdcopy.1*
362730
%{_mandir}/man1/nbdinfo.1*
90b936
90b936
90b936
%files devel
90b936
%doc TODO examples/*.c
90b936
%license examples/LICENSE-FOR-EXAMPLES
90b936
%{_includedir}/libnbd.h
90b936
%{_libdir}/libnbd.so
90b936
%{_libdir}/pkgconfig/libnbd.pc
90b936
%{_mandir}/man3/libnbd.3*
90b936
%{_mandir}/man1/libnbd-release-notes-1.*.1*
90b936
%{_mandir}/man3/libnbd-security.3*
90b936
%{_mandir}/man3/nbd_*.3*
90b936
90b936
90b936
%files -n ocaml-%{name}
90b936
%{_libdir}/ocaml/nbd
90b936
%exclude %{_libdir}/ocaml/nbd/*.a
90b936
%exclude %{_libdir}/ocaml/nbd/*.cmxa
90b936
%exclude %{_libdir}/ocaml/nbd/*.cmx
90b936
%exclude %{_libdir}/ocaml/nbd/*.mli
90b936
%{_libdir}/ocaml/stublibs/dllmlnbd.so
90b936
%{_libdir}/ocaml/stublibs/dllmlnbd.so.owner
90b936
90b936
90b936
%files -n ocaml-%{name}-devel
90b936
%doc ocaml/examples/*.ml
90b936
%license ocaml/examples/LICENSE-FOR-EXAMPLES
90b936
%{_libdir}/ocaml/nbd/*.a
90b936
%{_libdir}/ocaml/nbd/*.cmxa
90b936
%{_libdir}/ocaml/nbd/*.cmx
90b936
%{_libdir}/ocaml/nbd/*.mli
90b936
%{_mandir}/man3/libnbd-ocaml.3*
362730
%{_mandir}/man3/NBD.3*
362730
%{_mandir}/man3/NBD.*.3*
90b936
90b936
90b936
%files -n python3-%{name}
90b936
%{python3_sitearch}/libnbdmod*.so
90b936
%{python3_sitearch}/nbd.py
90b936
%{python3_sitearch}/nbdsh.py
90b936
%{python3_sitearch}/__pycache__/nbd*.py*
90b936
%{_bindir}/nbdsh
90b936
%{_mandir}/man1/nbdsh.1*
90b936
90b936
90b936
%files -n nbdfuse
90b936
%{_bindir}/nbdfuse
90b936
%{_mandir}/man1/nbdfuse.1*
90b936
90b936
362730
%files bash-completion
362730
%dir %{_datadir}/bash-completion/completions
362730
%{_datadir}/bash-completion/completions/nbdcopy
362730
%{_datadir}/bash-completion/completions/nbdfuse
362730
%{_datadir}/bash-completion/completions/nbdinfo
362730
%{_datadir}/bash-completion/completions/nbdsh
362730
362730
90b936
%changelog
6aa05d
* Mon Feb  7 2022 Richard W.M. Jones <rjones@redhat.com> - 1.6.0-5.el8
6aa05d
- Fix CVE-2022-0485: Fail nbdcopy if NBD read or write fails
6aa05d
  resolves: rhbz#2045718
6aa05d
362730
* Thu Sep 2 2021 Danilo C. L. de Paula <ddepaula@redhat.com> - 1.6.0-4.el8
362730
- Resolves: bz#2000225
362730
  (Rebase virt:rhel module:stream based on AV-8.6)
362730
1084a3
* Mon Jul 13 2020 Danilo C. L. de Paula <ddepaula@redhat.com> - 1.2.2
1084a3
- Resolves: bz#1844296
1084a3
(Upgrade components in virt:rhel module:stream for RHEL-8.3 release)
1084a3
90b936
* Wed Feb  5 2020 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-1
90b936
- New stable release 1.2.2.
90b936
90b936
* Tue Dec  3 2019 Richard W.M. Jones <rjones@redhat.com> - 1.2.1-1
90b936
- New stable release 1.2.1.
90b936
90b936
* Thu Nov 14 2019 Richard W.M. Jones <rjones@redhat.com> - 1.2.0-1
90b936
- New stable release 1.2.0.
90b936
90b936
* Wed Oct  9 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-1
90b936
- New upstream version 1.0.3.
90b936
- Contains fix for remote code execution vulnerability.
90b936
- Add new libnbd-security(3) man page.
90b936
90b936
* Tue Sep 17 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-1
90b936
- New upstream version 1.0.2.
90b936
- Remove patches which are upstream.
90b936
- Contains fix for NBD Protocol Downgrade Attack (CVE-2019-14842).
90b936
- Fix previous commit message.
90b936
90b936
* Thu Sep 12 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-2
90b936
- Add upstream patch to fix nbdsh (for nbdkit tests).
90b936
- Fix interop tests on slow machines.
90b936
90b936
* Sun Sep 08 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-1
90b936
- New stable version 1.0.1.
90b936
90b936
* Wed Aug 28 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.0-1
90b936
- New upstream version 1.0.0.
90b936
90b936
* Wed Aug 21 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.9-2
90b936
- Rebuilt for Python 3.8
90b936
90b936
* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.9-1
90b936
- New upstream version 0.9.9.
90b936
90b936
* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-4
90b936
- Fix nbdkit dependencies so we're actually running the tests.
90b936
- Add glib2-devel BR so we build the glib main loop example.
90b936
- Add upstream patch to fix test error:
90b936
  nbd_connect_unix: getlogin: No such device or address
90b936
- Fix test failure on 32 bit.
90b936
90b936
* Tue Aug 20 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-3
90b936
- Bump and rebuild to fix releng brokenness.
90b936
  https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/2LIDI33G3IEIPYSCCIP6WWKNHY7XZJGQ/
90b936
90b936
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.8-2
90b936
- Rebuilt for Python 3.8
90b936
90b936
* Thu Aug 15 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-1
90b936
- New upstream version 0.9.8.
90b936
- Package the new nbd_*(3) man pages.
90b936
90b936
* Mon Aug  5 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.7-1
90b936
- New upstream version 0.9.7.
90b936
- Add libnbd-ocaml(3) man page.
90b936
90b936
* Sat Aug  3 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.6-2
90b936
- Add all upstream patches since 0.9.6 was released.
90b936
- Package the ocaml bindings into a subpackage.
90b936
90b936
* Tue Jul 30 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.6-1
90b936
- New upstream verison 0.9.6.
90b936
90b936
* Fri Jul 26 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.9-1
90b936
- New upstream version 0.1.9.
90b936
90b936
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
90b936
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
90b936
90b936
* Wed Jul 17 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.8-1
90b936
- New upstream version 0.1.8.
90b936
90b936
* Tue Jul 16 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.7-1
90b936
- New upstream version 0.1.7.
90b936
90b936
* Wed Jul  3 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.6-1
90b936
- New upstream version 0.1.6.
90b936
90b936
* Thu Jun 27 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.5-1
90b936
- New upstream version 0.1.5.
90b936
90b936
* Sun Jun 09 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.4-1
90b936
- New upstream version 0.1.4.
90b936
90b936
* Sun Jun  2 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.2-2
90b936
- Enable libxml2 for NBD URI support.
90b936
90b936
* Thu May 30 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.2-1
90b936
- New upstream version 0.1.2.
90b936
90b936
* Tue May 28 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.1-1
90b936
- Fix license in man pages and examples.
90b936
- Add nbdsh(1) man page.
90b936
- Include the signature and keyring even if validation is disabled.
90b936
- Update devel subpackage license.
90b936
- Fix old FSF address in Python tests.
90b936
- Filter Python provides.
90b936
- Remove executable permission on the tar.gz.sig file.
90b936
- Initial release.