File libnvme.spec of Package libnvme.27881

#
# spec file for package libnvme
#
# Copyright (c) 2022 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 1

# Whether to run tests - default YES
%bcond_without check

Name:           libnvme
Version:        1.0
Release:        0
Summary:        Linux-native nvme device management library
License:        LGPL-2.1-or-later
URL:            https://github.com/linux-nvme/libnvme/
Source0:        libnvme-%{version}.tar.gz
Patch1:         0001-fabrics-Lower-log-level-in-__nvmf_add_ctrl.patch
Patch2:         0002-fabrics-Remove-double-connection-error-logging.patch
Patch3:         0003-fabrics-Introduce-connection-connect-error-mapping.patch
Patch4:         0004-libnvme-Export-nvme_ctrl_get_config.patch
Patch5:         0005-tree-Factor-lookup-code-for-controller.patch
Patch6:         0006-fabrics-Consider-config-from-file-when-adding-new-co.patch
Patch7:         0007-python-add-missing-ctrl-attrs-to-Python-bindings.patch
Patch8:         0008-libnvme-accessors-for-dhchap_key-variables.patch
Patch9:         0009-fabrics-Update-controller-authentication-in-nvmf_add.patch
Patch10:        0010-json-fixup-dhchap_ctrl_key-definitions.patch
Patch11:        0011-tree-rename-controller-dhchap_key-to-dhchap_ctrl_key.patch
Patch12:        0012-Parse-dhchap_host_key-on-controller-level.patch
Patch13:        0013-json-schema-add-dhchap_key-details-to-host-section.patch
Patch14:        0014-nvme-tree-avoid-segfault-if-auth-keys-are-unavailabl.patch
Patch15:        0015-fabrics-restructrure-nvmf_get_discovery_log.patch
Patch16:        0016-tree-simplifiy-nvme_subsystem_lookup_namespace.patch
Patch17:        0017-tree-make-nvme_subsystem_scan_namespace-idempotent.patch
Patch18:        0018-tree-make-nvme_ctrl_scan_namespace-idempotent.patch
Patch19:        0019-Fix-llx-lx-build-warnings-on-powerpc.patch
Patch20:        0020-fabrics-sanitize-dump-config-output.patch
Patch21:        0021-fabrics-Fix-build_options-return-values.patch
Patch22:        0022-fabrics-Duplicate-strings-when-merging-configs.patch
Patch23:        0023-libnvme.map-add-nvme_ctrl_is_persistent.patch
Patch24:        0024-libnvme.map-export-nvme_ctrl_-get-set-_dhchap_host_k.patch
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  libjson-c-devel
BuildRequires:  libuuid-devel
BuildRequires:  make
BuildRequires:  meson >= 0.47.0
BuildRequires:  openssl-devel
BuildRequires:  python3-devel
BuildRequires:  swig

%description
Provides library functions for accessing and managing NVMe devices on a Linux
system.

%package -n %{name}%{sover}
Summary:        Linux-native nvme device management library

%description -n %{name}%{sover}
Provides library functions for accessing and managing NVMe devices on a Linux
system.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{sover} = %{version}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package -n	python3-libnvme
Summary:        Python binding for %{name}

%description -n python3-libnvme
Provides library functions for accessing and managing NVMe devices on a Linux
system.

Python binding part.

%prep
%autosetup -p1

%build
%meson \
    -Ddocs=man
%meson_build

%if %{with_check}
%check
%meson_test
%endif

%install
%meson_install

%post -n %{name}%{sover} -p /sbin/ldconfig
%postun -n %{name}%{sover} -p /sbin/ldconfig

%files -n %{name}%{sover}
%license COPYING
%doc README.md
%{_libdir}/%{name}.so.%{sover}*

%files devel
%doc README.md
%{_includedir}/*
%{_libdir}/%{name}*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/*/*

%files -n python3-libnvme
%{python3_sitearch}/libnvme
%{python3_sitearch}/libnvme/*.so
%{python3_sitearch}/libnvme/__init__.py
%{python3_sitearch}/libnvme/nvme.py

%changelog
openSUSE Build Service is sponsored by