2016-02-11 14:11:43 +01:00
|
|
|
#
|
2016-02-19 10:15:02 +01:00
|
|
|
# spec file for package nvme-cli
|
2016-02-11 14:11:43 +01:00
|
|
|
#
|
2023-01-30 15:36:18 +01:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2016-02-11 14:11:43 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-08-16 02:18:24 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-02-11 14:11:43 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: nvme-cli
|
2023-07-27 14:13:15 +02:00
|
|
|
Version: 2.4
|
2016-02-11 14:11:43 +01:00
|
|
|
Release: 0
|
2017-10-24 15:04:20 +02:00
|
|
|
Summary: NVM Express user space tools
|
2018-04-04 14:16:27 +02:00
|
|
|
License: GPL-2.0-only
|
2016-02-11 14:11:43 +01:00
|
|
|
Group: Hardware/Other
|
2022-01-17 10:11:39 +01:00
|
|
|
URL: https://github.com/linux-nvme/nvme-cli/
|
2022-01-18 16:52:19 +01:00
|
|
|
Source0: nvme-cli-%{version}.tar.gz
|
2022-01-17 10:11:39 +01:00
|
|
|
# downstream patches
|
|
|
|
Patch100: 0100-harden_nvmf-connect@.service.patch
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
2019-11-19 15:15:45 +01:00
|
|
|
BuildRequires: libhugetlbfs-devel
|
2022-01-17 10:11:39 +01:00
|
|
|
BuildRequires: libjson-c-devel
|
2022-08-03 09:18:34 +02:00
|
|
|
BuildRequires: libnvme-devel
|
2017-06-26 12:05:38 +02:00
|
|
|
BuildRequires: libuuid-devel
|
2023-01-30 15:36:18 +01:00
|
|
|
BuildRequires: meson >= 0.50.0
|
2019-03-29 10:41:27 +01:00
|
|
|
BuildRequires: pkgconfig
|
2017-06-16 12:21:29 +02:00
|
|
|
BuildRequires: xmlto
|
2022-01-17 10:11:39 +01:00
|
|
|
BuildRequires: zlib-devel
|
2021-07-27 11:59:19 +02:00
|
|
|
BuildRequires: pkgconfig(bash-completion)
|
2016-02-19 10:15:02 +01:00
|
|
|
BuildRequires: pkgconfig(libudev)
|
2016-02-11 14:11:43 +01:00
|
|
|
|
2022-09-22 09:29:40 +02:00
|
|
|
%systemd_ordering
|
2022-09-21 13:43:51 +02:00
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%description
|
2017-10-24 15:04:20 +02:00
|
|
|
NVM Express (NVMe) is a direct attached storage interface. The
|
|
|
|
nvme-cli package contains core management tools with minimal
|
|
|
|
dependencies.
|
2016-02-11 14:11:43 +01:00
|
|
|
|
2019-05-23 13:19:41 +02:00
|
|
|
%package -n nvme-cli-regress-script
|
|
|
|
Summary: A small script to test the nvme binary for regressions
|
|
|
|
Group: Hardware/Other
|
|
|
|
Requires: nvme-cli
|
2022-09-21 13:43:51 +02:00
|
|
|
BuildArch: noarch
|
2019-05-23 13:19:41 +02:00
|
|
|
|
|
|
|
%description -n nvme-cli-regress-script
|
|
|
|
A small shell script to test the nvme binary for regressions. It requires an
|
|
|
|
NVMe device for testing purposes. Do NOT use in a production environment.
|
|
|
|
|
2021-07-27 11:59:19 +02:00
|
|
|
%package bash-completion
|
|
|
|
Summary: NVM Express user space tools bash completion
|
|
|
|
Group: System/Shells
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires: bash-completion
|
|
|
|
Supplements: (nvme-cli and bash-completion)
|
2022-09-21 13:43:51 +02:00
|
|
|
BuildArch: noarch
|
2021-07-27 11:59:19 +02:00
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Optional dependency offering bash completion for NVM Express user space tools
|
|
|
|
|
2022-01-17 10:11:39 +01:00
|
|
|
%package zsh-completion
|
|
|
|
Summary: NVM Express user space tools zsh completion
|
|
|
|
Group: System/Shells
|
|
|
|
Requires: %{name} = %{version}
|
2022-01-19 12:55:16 +01:00
|
|
|
Requires: zsh
|
|
|
|
Supplements: (nvme-cli and zsh)
|
2022-09-21 13:43:51 +02:00
|
|
|
BuildArch: noarch
|
2022-01-17 10:11:39 +01:00
|
|
|
|
|
|
|
%description zsh-completion
|
|
|
|
Optional dependency offering zsh completion for NVM Express user space tools
|
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%prep
|
2022-01-18 16:52:19 +01:00
|
|
|
%autosetup -p1
|
2016-02-11 14:11:43 +01:00
|
|
|
|
|
|
|
%build
|
2022-01-17 10:11:39 +01:00
|
|
|
%meson \
|
|
|
|
-Dudevrulesdir=%{_udevrulesdir} \
|
|
|
|
-Ddracutrulesdir=%{_sysconfdir}/dracut/dracut.conf.d \
|
|
|
|
-Dsystemddir=%{_unitdir} \
|
2022-03-18 20:46:07 +01:00
|
|
|
-Ddocs=man \
|
2022-08-03 14:09:11 +02:00
|
|
|
-Dsystemctl=%{_bindir}/systemctl
|
2022-01-17 10:11:39 +01:00
|
|
|
%meson_build
|
2016-02-11 14:11:43 +01:00
|
|
|
|
|
|
|
%install
|
2022-01-17 10:11:39 +01:00
|
|
|
%meson_install
|
2017-06-26 13:00:04 +02:00
|
|
|
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/hostnqn
|
2022-01-17 10:11:39 +01:00
|
|
|
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/hostid
|
|
|
|
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/discovery.conf
|
|
|
|
rm %{buildroot}%{_sysconfdir}/dracut/dracut.conf.d/70-nvmf-autoconnect.conf
|
|
|
|
|
2019-05-23 13:19:41 +02:00
|
|
|
# for subpackage nvme-cli-regress-script:
|
2023-07-27 14:13:15 +02:00
|
|
|
install -m 744 -D regress %{buildroot}%{_sbindir}/nvme-regress
|
2019-01-28 13:12:59 +01:00
|
|
|
|
2022-11-03 12:32:41 +01:00
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
|
|
|
pushd %{buildroot}%{_sbindir}
|
|
|
|
ln -s service rcnvmefc-boot-connections
|
|
|
|
ln -s service rcnvmf-autoconnect
|
|
|
|
popd
|
|
|
|
|
2022-01-17 10:11:39 +01:00
|
|
|
%define services nvmefc-boot-connections.service nvmf-connect.target nvmf-autoconnect.service
|
2019-01-28 13:12:59 +01:00
|
|
|
|
|
|
|
%pre
|
2022-08-03 14:09:11 +02:00
|
|
|
%service_add_pre %{services} nvmf-connect@.service
|
2016-02-11 14:11:43 +01:00
|
|
|
|
2017-06-26 10:36:13 +02:00
|
|
|
%post
|
2019-05-23 13:19:41 +02:00
|
|
|
if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
|
2022-01-17 10:11:39 +01:00
|
|
|
%{_bindir}/echo "Generating host NQN."
|
2017-06-26 13:13:01 +02:00
|
|
|
%{_sbindir}/nvme gen-hostnqn > %{_sysconfdir}/nvme/hostnqn
|
2017-06-26 10:36:13 +02:00
|
|
|
fi
|
2019-05-23 13:19:41 +02:00
|
|
|
if [ ! -s %{_sysconfdir}/nvme/hostid ]; then
|
2022-11-03 12:32:41 +01:00
|
|
|
sed -nr 's/.*:uuid:(.*?)$/\1/p' %{_sysconfdir}/nvme/hostnqn > %{_sysconfdir}/nvme/hostid
|
2017-06-30 15:43:19 +02:00
|
|
|
fi
|
2022-08-03 14:09:11 +02:00
|
|
|
%service_add_post %{services} nvmf-connect@.service
|
2019-01-28 13:12:59 +01:00
|
|
|
|
|
|
|
%preun
|
2022-08-03 14:09:11 +02:00
|
|
|
%service_del_preun %{services}
|
2019-01-28 13:12:59 +01:00
|
|
|
|
|
|
|
%postun
|
2022-08-03 14:09:11 +02:00
|
|
|
%service_del_postun %{services}
|
2019-03-29 10:41:27 +01:00
|
|
|
|
|
|
|
%posttrans
|
2019-05-14 08:23:12 +02:00
|
|
|
if [ -f /sys/class/fc/fc_udev_device/nvme_discovery ]; then
|
|
|
|
%{_bindir}/echo add > /sys/class/fc/fc_udev_device/nvme_discovery
|
|
|
|
fi
|
2017-06-26 10:36:13 +02:00
|
|
|
|
2022-03-22 15:12:54 +01:00
|
|
|
%pre -n nvme-cli-bash-completion
|
|
|
|
if [ -d %{_datadir}/bash-completion/completions/nvme ]; then
|
|
|
|
rm -r %{_datadir}/bash-completion/completions/nvme;
|
|
|
|
fi
|
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%files
|
2019-03-29 10:41:27 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2016-02-11 14:11:43 +01:00
|
|
|
%{_sbindir}/nvme
|
2022-11-03 12:32:41 +01:00
|
|
|
%{_sbindir}/rcnvmefc-boot-connections
|
|
|
|
%{_sbindir}/rcnvmf-autoconnect
|
2019-03-29 10:41:27 +01:00
|
|
|
%{_mandir}/man1/nvme*.1*%{?ext_man}
|
2019-11-19 15:15:45 +01:00
|
|
|
%{_udevrulesdir}/70-nvmf-autoconnect.rules
|
2020-02-04 13:01:32 +01:00
|
|
|
%{_udevrulesdir}/71-nvmf-iopolicy-netapp.rules
|
|
|
|
%{_unitdir}/nvmf-autoconnect.service
|
2019-01-28 13:12:59 +01:00
|
|
|
%{_unitdir}/nvmefc-boot-connections.service
|
2019-11-19 15:15:45 +01:00
|
|
|
%{_unitdir}/nvmf-connect@.service
|
|
|
|
%{_unitdir}/nvmf-connect.target
|
2017-06-26 13:13:01 +02:00
|
|
|
%dir %{_sysconfdir}/nvme/
|
|
|
|
%ghost %{_sysconfdir}/nvme/hostnqn
|
2019-03-29 10:41:27 +01:00
|
|
|
%ghost %{_sysconfdir}/nvme/hostid
|
2022-01-17 10:11:39 +01:00
|
|
|
%ghost %{_sysconfdir}/nvme/discovery.conf
|
2016-02-11 14:11:43 +01:00
|
|
|
|
2019-05-23 13:19:41 +02:00
|
|
|
%files -n nvme-cli-regress-script
|
|
|
|
%{_sbindir}/nvme-regress
|
|
|
|
|
2021-07-27 11:59:19 +02:00
|
|
|
%files bash-completion
|
|
|
|
%dir %{_datadir}/bash-completion
|
|
|
|
%dir %{_datadir}/bash-completion/completions
|
|
|
|
%{_datadir}/bash-completion/completions/nvme
|
|
|
|
|
2022-01-17 10:11:39 +01:00
|
|
|
%files zsh-completion
|
|
|
|
%dir %{_datadir}/zsh
|
|
|
|
%dir %{_datadir}/zsh/site-functions
|
|
|
|
%{_datadir}/zsh/site-functions/_nvme
|
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%changelog
|