summaryrefslogtreecommitdiffstats
path: root/rpm/nvmetcli.spec.tmpl
blob: f1b55337eb971e55423aa3531015a21fe5b13c3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Name:           nvmetcli
License:        Apache License 2.0
Group:          Applications/System
Summary:        Command line interface for the kernel NVMe nvmet
Version:        VERSION
Release:        1%{?dist}
URL:		http://git.infradead.org/users/hch/nvmetcli.git
Source:         nvmetcli-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-rpmroot
BuildArch:      noarch
BuildRequires:  python-devel python-setuptools systemd-units
Requires:	python-configshell python-kmod python-six
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

%description
This package contains the command line interface to the NVMe over Fabrics
nvmet in the Linux kernel.  It allows configuring the nvmet interactively
as well as saving / restoring the configuration to / from a json file.

%prep
%setup -q -n nvmetcli-%{version}

%build
%{__python} setup.py build

%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root=%{buildroot} --prefix=usr
mkdir -p %{buildroot}%{_sysconfdir}/nvmet
mkdir -p %{buildroot}%{_unitdir}
install -m 644 nvmet.service %{buildroot}%{_unitdir}/nvmet.service

%clean
rm -rf %{buildroot}

%post
%systemd_post nvmet.service

%preun
%systemd_preun nvmet.service

%postun
%systemd_postun_with_restart nvmet.service

%files
%defattr(-,root,root,-)
%{python_sitelib}
%dir %{_sysconfdir}/nvmet
/usr/sbin/nvmetcli
%{_unitdir}/nvmet.service
%doc COPYING README

%changelog