Skip to content

Commit

Permalink
nvmetcli: Install nvmetcli in /usr/sbin with setup.py
Browse files Browse the repository at this point in the history
According to the README, one can install nvmetcli through setup.py.
When one tries this though, the nvmetcli isn't configured in system's
$PATH.

Adding nvmetcli to scripts argument in setup call does half of the job.
Then, in order to install it in the correct location in a maintanable
way it's introduced setup.cfg file which contains 'install_scripts'
parameter for 'install' command set to /usr/sbin.

Nothing changes on the .deb package creation, the .rpm package process
in the other hand was made simpler by lines that are now done by
setup.py + setup.cfg settings.

Signed-off-by: Mauro S. M. Rodrigues <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
  • Loading branch information
maurorodrigues authored and Christoph Hellwig committed Apr 6, 2017
1 parent 65bf3de commit 9ab2ac6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 0 additions & 2 deletions rpm/nvmetcli.spec.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ as well as saving / restoring the configuration to / from a json file.
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root=%{buildroot} --prefix=usr
mkdir -p %{buildroot}%{_sysconfdir}/nvmet
mkdir -p %{buildroot}/usr/sbin
install -m 755 nvmetcli %{buildroot}/usr/sbin/nvmetcli
mkdir -p %{buildroot}%{_unitdir}
install -m 644 nvmet.service %{buildroot}%{_unitdir}/nvmet.service

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[install]
install_scripts=/usr/sbin
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@
maintainer_email = '[email protected]',
test_suite='nose2.collector.collector',
packages = ['nvmet'],
scripts=['nvmetcli']
)

0 comments on commit 9ab2ac6

Please sign in to comment.