From: Mauro S. M. Rodrigues Date: Wed, 5 Apr 2017 23:49:06 +0000 (-0300) Subject: nvmetcli: Install nvmetcli in /usr/sbin with setup.py X-Git-Tag: v0.4~3 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9ab2ac6c921068bd9075a5827a4ddb174a744a70;p=users%2Fhch%2Fnvmetcli.git nvmetcli: Install nvmetcli in /usr/sbin with setup.py 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 Signed-off-by: Christoph Hellwig --- diff --git a/rpm/nvmetcli.spec.tmpl b/rpm/nvmetcli.spec.tmpl index 1ffdbe6..f1b5533 100644 --- a/rpm/nvmetcli.spec.tmpl +++ b/rpm/nvmetcli.spec.tmpl @@ -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 index 0000000..ed3bf6e --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[install] +install_scripts=/usr/sbin diff --git a/setup.py b/setup.py index fdd6cea..c03a78d 100755 --- 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'] )