Blame SPECS/libnbd.spec

a5bbe4
# If we should verify tarball signature with GPGv2.
a5bbe4
%global verify_tarball_signature 1
a5bbe4
a5bbe4
# If there are patches which touch autotools files, set this to 1.
a5bbe4
%global patches_touch_autotools %{nil}
a5bbe4
a5bbe4
# The source directory.
a5bbe4
%global source_directory 1.2-stable
a5bbe4
a5bbe4
Name:           libnbd
a5bbe4
Version:        1.2.2
a5bbe4
Release:        1%{?dist}
a5bbe4
Summary:        NBD client library in userspace
a5bbe4
a5bbe4
License:        LGPLv2+
a5bbe4
URL:            https://github.com/libguestfs/libnbd
a5bbe4
a5bbe4
Source0:        http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz
a5bbe4
Source1:        http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz.sig
a5bbe4
# Keyring used to verify tarball signature.  This contains the single
a5bbe4
# key from here:
a5bbe4
# https://pgp.key-server.io/pks/lookup?search=rjones%40redhat.com&fingerprint=on&op=vindex
a5bbe4
Source2:       libguestfs.keyring
a5bbe4
a5bbe4
%if 0%{patches_touch_autotools}
a5bbe4
BuildRequires: autoconf, automake, libtool
a5bbe4
%endif
a5bbe4
a5bbe4
%if 0%{verify_tarball_signature}
a5bbe4
BuildRequires:  gnupg2
a5bbe4
%endif
a5bbe4
a5bbe4
# For the core library.
a5bbe4
BuildRequires:  gcc
a5bbe4
BuildRequires:  /usr/bin/pod2man
a5bbe4
BuildRequires:  gnutls-devel
a5bbe4
BuildRequires:  libxml2-devel
a5bbe4
a5bbe4
# For nbdfuse.
a5bbe4
BuildRequires:  fuse, fuse-devel
a5bbe4
a5bbe4
# For the Python 3 bindings.
a5bbe4
BuildRequires:  python3-devel
a5bbe4
a5bbe4
# For the OCaml bindings.
a5bbe4
BuildRequires:  ocaml
a5bbe4
BuildRequires:  ocaml-findlib-devel
a5bbe4
a5bbe4
# Only for building the examples.
a5bbe4
BuildRequires:  glib2-devel
a5bbe4
a5bbe4
# Only for running the test suite.
a5bbe4
BuildRequires:  gnutls-utils
a5bbe4
%ifnarch %{ix86}
a5bbe4
BuildRequires:  nbdkit
a5bbe4
#BuildRequires:  nbdkit-memory-plugin
a5bbe4
#BuildRequires:  nbdkit-null-plugin
a5bbe4
#BuildRequires:  nbdkit-pattern-plugin
a5bbe4
#BuildRequires:  nbdkit-sh-plugin
a5bbe4
BuildRequires:  qemu-img
a5bbe4
%endif
a5bbe4
BuildRequires:  gcc-c++
a5bbe4
a5bbe4
a5bbe4
%description
a5bbe4
NBD — Network Block Device — is a protocol for accessing Block Devices
a5bbe4
(hard disks and disk-like things) over a Network.
a5bbe4
a5bbe4
This is the NBD client library in userspace, a simple library for
a5bbe4
writing NBD clients.
a5bbe4
a5bbe4
The key features are:
a5bbe4
a5bbe4
 * Synchronous and asynchronous APIs, both for ease of use and for
a5bbe4
   writing non-blocking, multithreaded clients.
a5bbe4
a5bbe4
 * High performance.
a5bbe4
a5bbe4
 * Minimal dependencies for the basic library.
a5bbe4
a5bbe4
 * Well-documented, stable API.
a5bbe4
a5bbe4
 * Bindings in several programming languages.
a5bbe4
a5bbe4
a5bbe4
%package devel
a5bbe4
Summary:        Development headers for %{name}
a5bbe4
License:        LGPLv2+ and BSD
a5bbe4
Requires:       %{name}%{?_isa} = %{version}-%{release}
a5bbe4
a5bbe4
a5bbe4
%description devel
a5bbe4
This package contains development headers for %{name}.
a5bbe4
a5bbe4
a5bbe4
%package -n ocaml-%{name}
a5bbe4
Summary:        OCaml language bindings for %{name}
a5bbe4
Requires:       %{name}%{?_isa} = %{version}-%{release}
a5bbe4
a5bbe4
a5bbe4
%description -n ocaml-%{name}
a5bbe4
This package contains OCaml language bindings for %{name}.
a5bbe4
a5bbe4
a5bbe4
%package -n ocaml-%{name}-devel
a5bbe4
Summary:        OCaml language development package for %{name}
a5bbe4
Requires:       ocaml-%{name}%{?_isa} = %{version}-%{release}
a5bbe4
a5bbe4
a5bbe4
%description -n ocaml-%{name}-devel
a5bbe4
This package contains OCaml language development package for
a5bbe4
%{name}.  Install this if you want to compile OCaml software which
a5bbe4
uses %{name}.
a5bbe4
a5bbe4
a5bbe4
%package -n python3-%{name}
a5bbe4
Summary:        Python 3 bindings for %{name}
a5bbe4
Requires:       %{name}%{?_isa} = %{version}-%{release}
a5bbe4
%{?python_provide:%python_provide python3-%{name}}
a5bbe4
a5bbe4
# The Python module happens to be called lib*.so.  Don't scan it and
a5bbe4
# have a bogus "Provides: libnbdmod.*".
a5bbe4
%global __provides_exclude_from ^%{python3_sitearch}/lib.*\\.so
a5bbe4
a5bbe4
a5bbe4
%description -n python3-%{name}
a5bbe4
python3-%{name} contains Python 3 bindings for %{name}.
a5bbe4
a5bbe4
a5bbe4
%package -n nbdfuse
a5bbe4
Summary:        FUSE support for %{name}
a5bbe4
License:        LGPLv2+ and BSD
a5bbe4
Requires:       %{name}%{?_isa} = %{version}-%{release}
a5bbe4
a5bbe4
a5bbe4
%description -n nbdfuse
a5bbe4
This package contains FUSE support for %{name}.
a5bbe4
a5bbe4
a5bbe4
%prep
a5bbe4
%if 0%{verify_tarball_signature}
a5bbe4
tmphome="$(mktemp -d)"
a5bbe4
gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
a5bbe4
%endif
a5bbe4
%autosetup -p1
a5bbe4
%if 0%{patches_touch_autotools}
a5bbe4
autoreconf -i
a5bbe4
%endif
a5bbe4
a5bbe4
a5bbe4
%build
a5bbe4
%configure \
a5bbe4
    --disable-static \
a5bbe4
    --with-tls-priority=@LIBNBD,SYSTEM \
a5bbe4
    PYTHON=%{__python3} \
a5bbe4
    --enable-python \
a5bbe4
    --enable-ocaml \
a5bbe4
    --enable-fuse
a5bbe4
a5bbe4
make %{?_smp_mflags}
a5bbe4
a5bbe4
a5bbe4
%install
a5bbe4
%make_install
a5bbe4
a5bbe4
# Delete libtool crap.
a5bbe4
find $RPM_BUILD_ROOT -name '*.la' -delete
a5bbe4
a5bbe4
a5bbe4
%check
a5bbe4
# interop/structured-read.sh fails with the old qemu-nbd in Fedora 29,
a5bbe4
# so disable it there.
a5bbe4
%if 0%{?fedora} <= 29
a5bbe4
rm interop/structured-read.sh
a5bbe4
touch interop/structured-read.sh
a5bbe4
chmod +x interop/structured-read.sh
a5bbe4
%endif
a5bbe4
a5bbe4
# All fuse tests fail in Koji with:
a5bbe4
# fusermount: entry for fuse/test-*.d not found in /etc/mtab
a5bbe4
# for unknown reasons but probably related to the Koji environment.
a5bbe4
for f in fuse/test-*.sh; do
a5bbe4
    rm $f
a5bbe4
    touch $f
a5bbe4
    chmod +x $f
a5bbe4
done
a5bbe4
a5bbe4
make %{?_smp_mflags} check || {
a5bbe4
    for f in $(find -name test-suite.log); do
a5bbe4
        echo
a5bbe4
        echo "==== $f ===="
a5bbe4
        cat $f
a5bbe4
    done
a5bbe4
    exit 1
a5bbe4
  }
a5bbe4
a5bbe4
a5bbe4
%files
a5bbe4
%doc README
a5bbe4
%license COPYING.LIB
a5bbe4
%{_libdir}/libnbd.so.*
a5bbe4
a5bbe4
a5bbe4
%files devel
a5bbe4
%doc TODO examples/*.c
a5bbe4
%license examples/LICENSE-FOR-EXAMPLES
a5bbe4
%{_includedir}/libnbd.h
a5bbe4
%{_libdir}/libnbd.so
a5bbe4
%{_libdir}/pkgconfig/libnbd.pc
a5bbe4
%{_mandir}/man3/libnbd.3*
a5bbe4
%{_mandir}/man1/libnbd-release-notes-1.*.1*
a5bbe4
%{_mandir}/man3/libnbd-security.3*
a5bbe4
%{_mandir}/man3/nbd_*.3*
a5bbe4
a5bbe4
a5bbe4
%files -n ocaml-%{name}
a5bbe4
%{_libdir}/ocaml/nbd
a5bbe4
%exclude %{_libdir}/ocaml/nbd/*.a
a5bbe4
%exclude %{_libdir}/ocaml/nbd/*.cmxa
a5bbe4
%exclude %{_libdir}/ocaml/nbd/*.cmx
a5bbe4
%exclude %{_libdir}/ocaml/nbd/*.mli
a5bbe4
%{_libdir}/ocaml/stublibs/dllmlnbd.so
a5bbe4
%{_libdir}/ocaml/stublibs/dllmlnbd.so.owner
a5bbe4
a5bbe4
a5bbe4
%files -n ocaml-%{name}-devel
a5bbe4
%doc ocaml/examples/*.ml
a5bbe4
%license ocaml/examples/LICENSE-FOR-EXAMPLES
a5bbe4
%{_libdir}/ocaml/nbd/*.a
a5bbe4
%{_libdir}/ocaml/nbd/*.cmxa
a5bbe4
%{_libdir}/ocaml/nbd/*.cmx
a5bbe4
%{_libdir}/ocaml/nbd/*.mli
a5bbe4
%{_mandir}/man3/libnbd-ocaml.3*
a5bbe4
a5bbe4
a5bbe4
%files -n python3-%{name}
a5bbe4
%{python3_sitearch}/libnbdmod*.so
a5bbe4
%{python3_sitearch}/nbd.py
a5bbe4
%{python3_sitearch}/nbdsh.py
a5bbe4
%{python3_sitearch}/__pycache__/nbd*.py*
a5bbe4
%{_bindir}/nbdsh
a5bbe4
%{_mandir}/man1/nbdsh.1*
a5bbe4
a5bbe4
a5bbe4
%files -n nbdfuse
a5bbe4
%{_bindir}/nbdfuse
a5bbe4
%{_mandir}/man1/nbdfuse.1*
a5bbe4
a5bbe4
a5bbe4
%changelog
a5bbe4
* Wed Feb  5 2020 Richard W.M. Jones <rjones@redhat.com> - 1.2.2-1
a5bbe4
- New stable release 1.2.2.
a5bbe4
a5bbe4
* Tue Dec  3 2019 Richard W.M. Jones <rjones@redhat.com> - 1.2.1-1
a5bbe4
- New stable release 1.2.1.
a5bbe4
a5bbe4
* Thu Nov 14 2019 Richard W.M. Jones <rjones@redhat.com> - 1.2.0-1
a5bbe4
- New stable release 1.2.0.
a5bbe4
a5bbe4
* Wed Oct  9 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.3-1
a5bbe4
- New upstream version 1.0.3.
a5bbe4
- Contains fix for remote code execution vulnerability.
a5bbe4
- Add new libnbd-security(3) man page.
a5bbe4
a5bbe4
* Tue Sep 17 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.2-1
a5bbe4
- New upstream version 1.0.2.
a5bbe4
- Remove patches which are upstream.
a5bbe4
- Contains fix for NBD Protocol Downgrade Attack (CVE-2019-14842).
a5bbe4
- Fix previous commit message.
a5bbe4
a5bbe4
* Thu Sep 12 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-2
a5bbe4
- Add upstream patch to fix nbdsh (for nbdkit tests).
a5bbe4
- Fix interop tests on slow machines.
a5bbe4
a5bbe4
* Sun Sep 08 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.1-1
a5bbe4
- New stable version 1.0.1.
a5bbe4
a5bbe4
* Wed Aug 28 2019 Richard W.M. Jones <rjones@redhat.com> - 1.0.0-1
a5bbe4
- New upstream version 1.0.0.
a5bbe4
a5bbe4
* Wed Aug 21 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.9-2
a5bbe4
- Rebuilt for Python 3.8
a5bbe4
a5bbe4
* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.9-1
a5bbe4
- New upstream version 0.9.9.
a5bbe4
a5bbe4
* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-4
a5bbe4
- Fix nbdkit dependencies so we're actually running the tests.
a5bbe4
- Add glib2-devel BR so we build the glib main loop example.
a5bbe4
- Add upstream patch to fix test error:
a5bbe4
  nbd_connect_unix: getlogin: No such device or address
a5bbe4
- Fix test failure on 32 bit.
a5bbe4
a5bbe4
* Tue Aug 20 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-3
a5bbe4
- Bump and rebuild to fix releng brokenness.
a5bbe4
  https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/2LIDI33G3IEIPYSCCIP6WWKNHY7XZJGQ/
a5bbe4
a5bbe4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.9.8-2
a5bbe4
- Rebuilt for Python 3.8
a5bbe4
a5bbe4
* Thu Aug 15 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.8-1
a5bbe4
- New upstream version 0.9.8.
a5bbe4
- Package the new nbd_*(3) man pages.
a5bbe4
a5bbe4
* Mon Aug  5 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.7-1
a5bbe4
- New upstream version 0.9.7.
a5bbe4
- Add libnbd-ocaml(3) man page.
a5bbe4
a5bbe4
* Sat Aug  3 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.6-2
a5bbe4
- Add all upstream patches since 0.9.6 was released.
a5bbe4
- Package the ocaml bindings into a subpackage.
a5bbe4
a5bbe4
* Tue Jul 30 2019 Richard W.M. Jones <rjones@redhat.com> - 0.9.6-1
a5bbe4
- New upstream verison 0.9.6.
a5bbe4
a5bbe4
* Fri Jul 26 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.9-1
a5bbe4
- New upstream version 0.1.9.
a5bbe4
a5bbe4
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.8-2
a5bbe4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a5bbe4
a5bbe4
* Wed Jul 17 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.8-1
a5bbe4
- New upstream version 0.1.8.
a5bbe4
a5bbe4
* Tue Jul 16 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.7-1
a5bbe4
- New upstream version 0.1.7.
a5bbe4
a5bbe4
* Wed Jul  3 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.6-1
a5bbe4
- New upstream version 0.1.6.
a5bbe4
a5bbe4
* Thu Jun 27 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.5-1
a5bbe4
- New upstream version 0.1.5.
a5bbe4
a5bbe4
* Sun Jun 09 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.4-1
a5bbe4
- New upstream version 0.1.4.
a5bbe4
a5bbe4
* Sun Jun  2 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.2-2
a5bbe4
- Enable libxml2 for NBD URI support.
a5bbe4
a5bbe4
* Thu May 30 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.2-1
a5bbe4
- New upstream version 0.1.2.
a5bbe4
a5bbe4
* Tue May 28 2019 Richard W.M. Jones <rjones@redhat.com> - 0.1.1-1
a5bbe4
- Fix license in man pages and examples.
a5bbe4
- Add nbdsh(1) man page.
a5bbe4
- Include the signature and keyring even if validation is disabled.
a5bbe4
- Update devel subpackage license.
a5bbe4
- Fix old FSF address in Python tests.
a5bbe4
- Filter Python provides.
a5bbe4
- Remove executable permission on the tar.gz.sig file.
a5bbe4
- Initial release.