From 456b8b85a5c6a1020985250d90368fac67187b47 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 29 May 2019 21:23:40 +0100 Subject: [PATCH] Initial import (RHBZ#1713767). --- .gitignore | 1 + libguestfs.keyring | Bin 0 -> 2823 bytes libnbd-0.1.1.tar.gz.sig | 17 +++++ libnbd.spec | 161 ++++++++++++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 180 insertions(+) create mode 100644 .gitignore create mode 100644 libguestfs.keyring create mode 100644 libnbd-0.1.1.tar.gz.sig create mode 100644 libnbd.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b34e7a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/libnbd-0.1.1.tar.gz diff --git a/libguestfs.keyring b/libguestfs.keyring new file mode 100644 index 0000000000000000000000000000000000000000..bb3eb5537b7c398a10b7e2b26ca00af011d1a73e GIT binary patch literal 2823 zcma*oXEYm(0><$qB7$nPViakqqNG)u+FR_sQdc{DRukabMCqKo^wCkug~Y-bN=ZdDzIiUZ#$40(0^!V6(C-KH79?s=m3cGghyAo z1|dJMm+eiM>Vb)QYy4I#;Xu&Z^B~&YVZ!Whl6YA`T0fY9jOhHw z+Y;*35;Jx(8F=n(3o5j*bNOr3S) zCOp0NiMsuh^>)x<=&*u##pa25u9;{ZZc=y@%)4CE$a$A}A*UQGOC-D04;}dULUfuV z)^qc0R62lhwbK5pAcC9hk{LK2KJQ&jd|seog-6NxEVm_4X)8y7DYjWwHK2eI$lRku zmeq4z0zkjTs4a++z4bu{k^$N0>0MkG^k~>}tQQd>eap=1)cK}mGM_yYhtaPw3u{n! zU9d7X%GZbXT!~-iaePA-_ZF&Sz{>(|!tON<`4C)es{n-Uesd{GoD$><>+YS*e%6$X zv}81ZQEu&BDa*m|%?xc}K? ztXy1dUpQFtxVqa*MT11aG(ZsGE-C15Js>6$2qig`j06Osg@VW_D8Y0f5+LX{5JVpY zpdhDC^oaLZsK??x8DJOWJ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ZReG3G^_uml$%lONCD~B)o&u@Ar}fQG5;T#E%^U88SI<&z@~yy|THGE%E1PbI z?F^r&ZTiw{?xi@{*DAy6C4z2C)^HACOJ!QTq)OKNiy$F_ao^+$ziBa!`o*phmK_>s za)NY_nGb%M+@h1zb zdfh2x>9W=SlC19X_yB5T8jPIITr(IuajP65y|~iU>niq=mN|NI*0)B&ixQw`dlhcIFP)G9WnV`}K3C{4m}cRO<&1vJ^K5DAVUo*Z<@ zunwMvxU0NO;ORRnw0-LRLg3}q^7?BlO`eOGFQ3pD@ literal 0 HcmV?d00001 diff --git a/libnbd-0.1.1.tar.gz.sig b/libnbd-0.1.1.tar.gz.sig new file mode 100644 index 0000000..61cf806 --- /dev/null +++ b/libnbd-0.1.1.tar.gz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- + +iQJFBAABCAAvFiEE93dPsa0HSn6Mh2fqkXOPc+G3aKAFAlzs6IURHHJpY2hAYW5u +ZXhpYS5vcmcACgkQkXOPc+G3aKDFnA/+K/pH0lNT9p4JXZ1vqwyzuADpFr1BKgs/ +FTMoQCmO6Of24V0F53IHc9ymgzNuOpQfvh1x2zBIkprpMjV7nnTa42YVSdmXJ3+6 +sANqQaR+Wc8tApBNKuQLmU61XuVC0npdFcSfFyyy9Nv9QFWP2DDyi0E2RUinJCGe +/QutnyBojALMdUWJuNu2Bv3I0C0bgg+S8OtBPPYa0M0BkeyzzYbFx019yL60AuLk +CJbwhd+4PBs0gYNchoJT963euyCiRSHQhLkHr/qgi9RhYwatqZIiYnsKGXiyYehF +Uk+nd8Al/0gVVJ/2kWUb6cDe/6IEL4nfXqbRm+qaqVOX3LbtF032HMOG4RRd0kUm +2Jdd7cjSnTBokwJOyH0z73oBK2zZ29a4xJ8dhEUgGW/txmokPHAw35bn063P2yHd +ZFAZIic+Gl8/4+dtzW4wj0Mrhu0wSm3FutIPcWk194sh3/BaAKNSC5lDGxVKRLl9 +sPOpfFFFLUCMRNTkHKjETIYklt2A7vkH5+V1EWfXdVpz5UBSaPkvaxTgzfBlcAVE +JSXpbfWIqsH/iMj/3XC36SKvBSZ8+9UFq0Q2oaOUTMPZfKLI+tWw7KkyqZoRW6a0 ++zwHsYYjfmEr9NqRIK6TDQO58p2tHkFSz6AQHbKZhugtLCxBamClFkIASsqWjGct +stHWEYd2+nw= +=oVfz +-----END PGP SIGNATURE----- diff --git a/libnbd.spec b/libnbd.spec new file mode 100644 index 0000000..9f71b0f --- /dev/null +++ b/libnbd.spec @@ -0,0 +1,161 @@ +# If we should verify tarball signature with GPGv2. +%global verify_tarball_signature 1 + +# If there are patches which touch autotools files, set this to 1. +%global patches_touch_autotools %{nil} + +# The source directory. +%global source_directory 0.x-unstable-api + +Name: libnbd +Version: 0.1.1 +Release: 1%{?dist} +Summary: NBD client library in userspace + +License: LGPLv2+ +URL: https://github.com/libguestfs/libnbd + +Source0: http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz +Source1: http://libguestfs.org/download/libnbd/%{source_directory}/%{name}-%{version}.tar.gz.sig +# Keyring used to verify tarball signature. This contains the single +# key from here: +# https://pgp.key-server.io/pks/lookup?search=rjones%40redhat.com&fingerprint=on&op=vindex +Source2: libguestfs.keyring + +# Patches. +# (none) + +%if 0%{patches_touch_autotools} +BuildRequires: autoconf, automake, libtool +%endif + +%if 0%{verify_tarball_signature} +BuildRequires: gnupg2 +%endif + +BuildRequires: gcc +BuildRequires: /usr/bin/pod2man +BuildRequires: gnutls-devel +BuildRequires: python3-devel + +# Only for running the test suite. +BuildRequires: gnutls-utils +BuildRequires: nbdkit +BuildRequires: nbd +BuildRequires: qemu-img + + +%description +NBD — Network Block Device — is a protocol for accessing Block Devices +(hard disks and disk-like things) over a Network. + +This is the NBD client library in userspace, a simple library for +writing NBD clients. + +The key features are: + + * Synchronous and asynchronous APIs, both for ease of use and for + writing non-blocking, multithreaded clients. + + * High performance. + + * Minimal dependencies for the basic library. + + * Well-documented, stable API. + + * Bindings in several programming languages. + + +%package devel +Summary: Development headers for %{name} +License: LGPLv2+ and BSD +Requires: %{name}%{?_isa} = %{version}-%{release} + + +%description devel +This package contains development headers for %{name}. + + +%package -n python3-%{name} +Summary: Python 3 bindings for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-%{name}} + +# The Python module happens to be called lib*.so. Don't scan it and +# have a bogus "Provides: libnbdmod.*". +%global __provides_exclude_from ^%{python3_sitearch}/lib.*\\.so + + +%description -n python3-%{name} +python3-%{name} contains Python 3 bindings for %{name}. + + +%prep +%if 0%{verify_tarball_signature} +tmphome="$(mktemp -d)" +gpgv2 --homedir "$tmphome" --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0} +%endif +%autosetup -p1 +%if 0%{patches_touch_autotools} +autoreconf -i +%endif + + +%build +%configure \ + --disable-static \ + --with-tls-priority=@LIBNBD,SYSTEM \ + PYTHON=%{__python3} \ + --enable-python + +make %{?_smp_mflags} + + +%install +%make_install + +# Delete libtool crap. +find $RPM_BUILD_ROOT -name '*.la' -delete + + +%check +make %{?_smp_mflags} check || { + cat tests/test-suite.log + exit 1 + } + + +%files +%doc README +%license COPYING.LIB +%{_libdir}/libnbd.so.* + + +%files devel +%doc TODO examples/*.c +%license examples/LICENSE-FOR-EXAMPLES +%{_includedir}/libnbd.h +%{_libdir}/libnbd.so +%{_libdir}/pkgconfig/libnbd.pc +%{_mandir}/man3/libnbd.3* +%{_mandir}/man3/libnbd-api.3* + + +%files -n python3-%{name} +%{python3_sitearch}/libnbdmod*.so +%{python3_sitearch}/nbd.py +%{python3_sitearch}/__pycache__/nbd*.py* +%{_bindir}/nbdsh +%{_mandir}/man1/nbdsh.1* + + +%changelog +* Tue May 28 2019 Richard W.M. Jones - 0.1.1-1 +- Fix license in man pages and examples. +- Add nbdsh(1) man page. +- Include the signature and keyring even if validation is disabled. +- Update devel subpackage license. +- Fix old FSF address in Python tests. +- Filter Python provides. +- Remove executable permission on the tar.gz.sig file. +- Initial release. diff --git a/sources b/sources new file mode 100644 index 0000000..cf36daf --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libnbd-0.1.1.tar.gz) = b3bdaaa3277484806b434a99747c8c383716003c29019c8dd456ece156812b14894f99bc84e7c9dcb617faec1f0f2df0ff78410e2a276a08ce07a4ce11d13ea4