From 8951fef0cdd038a56dbbd2e777db432cdba8794212aaac3e0faff5e094bcb145 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 28 Jan 2021 18:12:48 +0000 Subject: [PATCH] Accepting request 867557 from home:jfehlig:branches:Virtualization Initial packaging of libnbd OBS-URL: https://build.opensuse.org/request/show/867557 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libnbd?expand=0&rev=1 --- .gitattributes | 23 ++++++ .gitignore | 1 + _service | 18 +++++ libnbd-1.7.1.tar.gz | 3 + libnbd.changes | 14 ++++ libnbd.spec | 174 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 233 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 libnbd-1.7.1.tar.gz create mode 100644 libnbd.changes create mode 100644 libnbd.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..259cd89 --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + libnbd + v1.7.1 + git + disable + https://github.com/libguestfs/libnbd + @PARENT_TAG@ + [v]?([^\+]+)(.*) + \1 + enable + + + *.tar + gz + + + diff --git a/libnbd-1.7.1.tar.gz b/libnbd-1.7.1.tar.gz new file mode 100644 index 0000000..294a823 --- /dev/null +++ b/libnbd-1.7.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c5cfb9e3835d164fab2c066b0e1ac16eadefa7b936523d516ea1341a0bab5a7 +size 1068490 diff --git a/libnbd.changes b/libnbd.changes new file mode 100644 index 0000000..5ca1981 --- /dev/null +++ b/libnbd.changes @@ -0,0 +1,14 @@ +------------------------------------------------------------------- +Tue Jan 26 23:36:04 UTC 2021 - jfehlig@suse.com + +- Initial packaging of libnbd: + * Version 1.7.1. + * sh: Add NOTES section. + * copy: Update multi-conn documentation. + * sh: Arrange --opt-mode documentation in alphabetical order. + * python: Add example. + * copy: Fix initialization complaint with ancient GCC on RHEL 7. + * python: Fix Python style error. + * copy/file-ops.c: Small whitespace fix. + * copy/copy-nbd-to-sparse-file.sh: Skip test unless nbdkit available. + diff --git a/libnbd.spec b/libnbd.spec new file mode 100644 index 0000000..3c7c3ea --- /dev/null +++ b/libnbd.spec @@ -0,0 +1,174 @@ +# +# spec file for package libnbd +# +# Copyright (c) 2021 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + +%define sover 0 + +Name: libnbd +Version: 1.7.1 +Release: 0 +Summary: NBD client library in userspace +License: LGPL-2.0-or-later +URL: https://github.com/libguestfs/libnbd +Source0: %{name}-%{version}.tar.gz + +Requires: libnbd%{sover} = %{version}-%{release} +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: fdupes +BuildRequires: libtool +BuildRequires: perl(Pod::Man) +BuildRequires: perl(Pod::Simple) +BuildRequires: pkg-config +BuildRequires: pkgconfig(bash-completion) +BuildRequires: pkgconfig(fuse) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gnutls) >= 3.3.0 +BuildRequires: pkgconfig(libxml-2.0) + +# Only for running the test suite. +BuildRequires: gcc-c++ +BuildRequires: jq +BuildRequires: nbd +BuildRequires: qemu-tools + + +%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 -n libnbd%{sover} +Summary: Core library for nbd +%description -n libnbd%{sover} +This is the NBD client library in userspace, a simple library for +writing NBD clients. + +%package devel +Summary: Development headers for %{name} +Requires: libnbd%{sover} = %{version}-%{release} +%description devel +This package contains development headers for %{name}. + +%package -n nbdfuse +Summary: FUSE support for %{name} +Requires: libnbd%{sover} = %{version}-%{release} +%description -n nbdfuse +This package contains FUSE support for %{name}. + +%package bash-completion +Summary: Bash tab-completion for %{name} +BuildArch: noarch +Requires: bash-completion >= 2.0 +Requires: libnbd%{sover} = %{version}-%{release} +%description bash-completion +Install this package if you want intelligent bash tab-completion +for %{name}. + + +%prep +%autosetup -p1 + + +%build +autoreconf -fiv +%configure \ + --with-tls-priority=@LIBNBD,SYSTEM \ + --enable-fuse \ + --disable-golang \ + --disable-python \ + --disable-ocaml \ + --disable-static + +%make_build + + +%install +%make_install +%fdupes %{buildroot} +# Delete libtool crap. +find $RPM_BUILD_ROOT -name '*.la' -delete + +# Delete the golang man page since we're not distributing the bindings. +rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3* + +# Delete the ocaml man page. 'make install' should be fixed to not install it when ocaml is disabled +rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-ocaml.3* + +%check +# All fuse tests fail in Koji with: +# fusermount: entry for fuse/test-*.d not found in /etc/mtab +# for unknown reasons but probably related to the Koji environment. +for f in fuse/test-*.sh; do + rm $f + touch $f + chmod +x $f +done + + +make %{?_smp_mflags} check || { + for f in $(find -name test-suite.log); do + echo + echo "==== $f ====" + cat $f + done + } + +%post -n libnbd%{sover} -p /sbin/ldconfig +%postun -n libnbd%{sover} -p /sbin/ldconfig + +%files +%doc README +%{_bindir}/nbdcopy +%{_bindir}/nbdinfo +%{_mandir}/man1/nbdcopy.1* +%{_mandir}/man1/nbdinfo.1* + +%files -n libnbd%{sover} +%license COPYING.LIB +%{_libdir}/libnbd.so.%{sover} +%{_libdir}/libnbd.so.%{sover}.* + +%files devel +%{_includedir}/libnbd.h +%{_libdir}/libnbd.so +%{_libdir}/pkgconfig/libnbd.pc +%{_mandir}/man3/libnbd.3* +%{_mandir}/man1/libnbd-release-notes-1.*.1* +%{_mandir}/man3/libnbd-security.3* +%{_mandir}/man3/nbd_*.3* + +%files -n nbdfuse +%{_bindir}/nbdfuse +%{_mandir}/man1/nbdfuse.1* + +%files bash-completion +%{_datadir}/bash-completion