]> www.infradead.org Git - users/hch/nvmetcli.git/commitdiff
nvmetcli: Install nvmetcli in /usr/sbin with setup.py
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Wed, 5 Apr 2017 23:49:06 +0000 (20:49 -0300)
committerChristoph Hellwig <hch@lst.de>
Thu, 6 Apr 2017 07:19:11 +0000 (09:19 +0200)
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 <maurosr@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
rpm/nvmetcli.spec.tmpl
setup.cfg [new file with mode: 0644]
setup.py

index 1ffdbe611593086385472fc5ce34bf38d1729ca4..f1b55337eb971e55423aa3531015a21fe5b13c3f 100644 (file)
@@ -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
 
diff --git a/setup.cfg b/setup.cfg
new file mode 100644 (file)
index 0000000..ed3bf6e
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[install]
+install_scripts=/usr/sbin
index fdd6ceaf0ce060a373dd20a1bcfd85b7e95843c9..c03a78d2e0aa924776d4ff45c3aa6c5ece381f46 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -27,4 +27,5 @@ setup(
     maintainer_email = 'hch@lst.de',
     test_suite='nose2.collector.collector',
     packages = ['nvmet'],
+    scripts=['nvmetcli']
     )