2016-02-11 14:11:43 +01:00
|
|
|
#
|
2016-02-22 08:57:54 +01:00
|
|
|
# spec file for package nvme-cli
|
2016-02-11 14:11:43 +01:00
|
|
|
#
|
2020-08-19 18:44:58 +02:00
|
|
|
# Copyright (c) 2020 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-19 18:44:58 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2016-02-11 14:11:43 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: nvme-cli
|
2021-05-13 22:18:09 +02:00
|
|
|
Version: 1.14
|
2016-02-11 14:11:43 +01:00
|
|
|
Release: 0
|
2017-10-25 17:47:27 +02:00
|
|
|
Summary: NVM Express user space tools
|
2018-04-05 15:33:47 +02:00
|
|
|
License: GPL-2.0-only
|
2016-02-11 14:11:43 +01:00
|
|
|
Group: Hardware/Other
|
2020-08-19 18:44:58 +02:00
|
|
|
URL: https://github.com/linux-nvme/nvme-cli
|
|
|
|
Source: https://github.com/linux-nvme/nvme-cli/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
2019-04-02 09:18:12 +02:00
|
|
|
Source2: nvme-cli-rpmlintrc
|
2019-05-15 12:24:42 +02:00
|
|
|
# downstream patches:
|
2019-11-21 12:57:38 +01:00
|
|
|
Patch102: 0102-nvme-cli-Add-script-to-determine-host-NQN.patch
|
|
|
|
BuildRequires: libhugetlbfs-devel
|
2017-06-26 15:56:56 +02:00
|
|
|
BuildRequires: libuuid-devel
|
2019-04-02 09:18:12 +02:00
|
|
|
BuildRequires: pkgconfig
|
2017-06-20 09:39:37 +02:00
|
|
|
BuildRequires: xmlto
|
2016-02-22 08:57:54 +01:00
|
|
|
BuildRequires: pkgconfig(libudev)
|
2019-02-13 10:05:23 +01:00
|
|
|
BuildRequires: rubygem(asciidoctor)
|
2019-05-27 08:36:24 +02:00
|
|
|
%ifarch x86_64 aarch64 i586
|
|
|
|
Requires(post): dmidecode
|
|
|
|
%endif
|
2022-09-21 13:43:51 +02:00
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%description
|
2017-10-25 17:47:27 +02:00
|
|
|
NVM Express (NVMe) is a direct attached storage interface. The
|
|
|
|
nvme-cli package contains core management tools with minimal
|
|
|
|
dependencies.
|
2022-01-17 10:11:39 +01:00
|
|
|
|
2019-05-27 08:36:24 +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
|
|
|
|
|
|
|
|
%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.
|
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%prep
|
2019-04-02 09:18:12 +02:00
|
|
|
%setup -q
|
2019-11-21 12:57:38 +01:00
|
|
|
%patch102 -p1
|
2016-02-11 14:11:43 +01:00
|
|
|
|
|
|
|
%build
|
2016-02-22 08:57:54 +01:00
|
|
|
echo %{version} > version
|
2019-02-13 10:05:23 +01:00
|
|
|
make CFLAGS="%{optflags} -I." PREFIX=%{_prefix} USE_ASCIIDOCTOR=YesPlease %{?_smp_mflags} all
|
2019-05-27 08:36:24 +02:00
|
|
|
sed -i '/make.*/d' regress
|
2023-10-04 17:20:00 +02:00
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%install
|
2020-02-07 15:51:22 +01:00
|
|
|
make PREFIX=%{_prefix} DESTDIR=%{buildroot} UDEVRULESDIR=%{_udevrulesdir} install-bin install-man install-udev install-systemd %{?_smp_mflags}
|
2017-06-26 15:56:56 +02:00
|
|
|
install -m 644 -D /dev/null %{buildroot}%{_sysconfdir}/nvme/hostnqn
|
2019-04-02 09:18:12 +02:00
|
|
|
install -m 644 -D completions/bash-nvme-completion.sh %{buildroot}%{_datadir}/bash_completion/completions/nvme
|
2019-05-27 08:36:24 +02:00
|
|
|
%ifarch x86_64 aarch64 i586
|
2020-02-07 15:51:22 +01:00
|
|
|
install -m 744 -D scripts/det-hostnqn.sh %{buildroot}%{_sbindir}/nvme-gen-hostnqn
|
2019-05-27 08:36:24 +02:00
|
|
|
%endif
|
|
|
|
# for subpackage nvme-cli-regress-script:
|
|
|
|
install -m 744 -D regress %{buildroot}%{_sbindir}/nvme-regress
|
2019-01-28 20:50:03 +01:00
|
|
|
|
2019-11-21 12:57:38 +01:00
|
|
|
%define services nvmefc-boot-connections.service nvmf-connect.target
|
2019-01-28 20:50:03 +01:00
|
|
|
|
|
|
|
%pre
|
2019-11-21 12:57:38 +01:00
|
|
|
%service_add_pre %services nvmf-connect@.service
|
2022-03-22 15:12:54 +01:00
|
|
|
|
2017-06-26 15:56:56 +02:00
|
|
|
%post
|
2019-05-27 08:36:24 +02:00
|
|
|
%ifarch x86_64 aarch64 i586
|
|
|
|
if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
|
2020-02-07 15:51:22 +01:00
|
|
|
%{_sbindir}/nvme-gen-hostnqn > %{_sysconfdir}/nvme/hostnqn
|
2019-05-27 08:36:24 +02:00
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
if [ ! -s %{_sysconfdir}/nvme/hostnqn ]; then
|
|
|
|
%{_bindir}/echo "Generating random host NQN."
|
2017-06-26 15:56:56 +02:00
|
|
|
%{_sbindir}/nvme gen-hostnqn > %{_sysconfdir}/nvme/hostnqn
|
|
|
|
fi
|
2019-05-27 08:36:24 +02:00
|
|
|
if [ ! -s %{_sysconfdir}/nvme/hostid ]; then
|
2017-07-02 13:38:19 +02:00
|
|
|
%{_bindir}/uuidgen > %{_sysconfdir}/nvme/hostid
|
|
|
|
fi
|
2020-02-07 15:51:22 +01:00
|
|
|
%service_add_post %services nvmf-connect@.service
|
2019-01-28 20:50:03 +01:00
|
|
|
|
|
|
|
%preun
|
2020-11-23 15:33:04 +01:00
|
|
|
%service_del_preun %services
|
2019-01-28 20:50:03 +01:00
|
|
|
|
|
|
|
%postun
|
2019-04-02 09:18:12 +02:00
|
|
|
%service_del_postun %services
|
|
|
|
|
|
|
|
%posttrans
|
2019-05-15 12:24:42 +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 15:56:56 +02:00
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%files
|
2019-04-02 09:18:12 +02:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2016-02-11 14:11:43 +01:00
|
|
|
%{_sbindir}/nvme
|
2019-05-27 08:36:24 +02:00
|
|
|
%ifarch x86_64 aarch64 i586
|
2020-02-07 15:51:22 +01:00
|
|
|
%{_sbindir}/nvme-gen-hostnqn
|
2019-05-27 08:36:24 +02:00
|
|
|
%endif
|
2019-04-02 09:18:12 +02:00
|
|
|
%{_mandir}/man1/nvme*.1*%{?ext_man}
|
|
|
|
%dir %{_datadir}/bash_completion
|
|
|
|
%dir %{_datadir}/bash_completion/completions/
|
|
|
|
%{_datadir}/bash_completion/completions/nvme
|
2019-11-21 12:57:38 +01:00
|
|
|
%{_udevrulesdir}/70-nvmf-autoconnect.rules
|
2020-02-07 15:51:22 +01:00
|
|
|
%{_udevrulesdir}/71-nvmf-iopolicy-netapp.rules
|
|
|
|
%{_unitdir}/nvmf-autoconnect.service
|
2019-01-28 20:50:03 +01:00
|
|
|
%{_unitdir}/nvmefc-boot-connections.service
|
2019-11-21 12:57:38 +01:00
|
|
|
%{_unitdir}/nvmf-connect@.service
|
|
|
|
%{_unitdir}/nvmf-connect.target
|
2017-06-26 15:56:56 +02:00
|
|
|
%dir %{_sysconfdir}/nvme/
|
|
|
|
%ghost %{_sysconfdir}/nvme/hostnqn
|
2019-04-02 09:18:12 +02:00
|
|
|
%ghost %{_sysconfdir}/nvme/hostid
|
2022-01-17 10:11:39 +01:00
|
|
|
|
2019-05-27 08:36:24 +02:00
|
|
|
%files -n nvme-cli-regress-script
|
|
|
|
%{_sbindir}/nvme-regress
|
|
|
|
|
2016-02-11 14:11:43 +01:00
|
|
|
%changelog
|