Blame SPECS/libnbd.spec

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