提交 e9ebbb79 编写于 作者: L Lukáš Doktor

libexec: Move libexec to package_files

With the recent changes the "libexec" dir is only available when
installed via RPM. In order to have "libexec" files available
as standard package we have to include it in  the package_files
dir (avocado/). The benefit is that we can actually use package
resources to get the location in "avocado exec-path" command.

For packaging purposes let's simply symlink $libexec/avocado to the
packaged $avocado/libexec location so there is the usual location, but
keep using the python-location by default.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 c1823f4a
......@@ -2,5 +2,6 @@ include README.rst
include LICENSE
include Makefile
recursive-include avocado/etc *
recursive-include avocado/libexec *
recursive-include selftests *
recursive-include examples *
......@@ -14,10 +14,7 @@
Libexec PATHs modifier
"""
import os
import sys
from avocado.core import exit_codes
from pkg_resources import resource_filename
from avocado.core.output import LOG_UI
from avocado.core.plugin_interfaces import CLICmd
......@@ -37,20 +34,4 @@ class ExecPath(CLICmd):
:param args: Command line args received from the run subparser.
"""
if 'VIRTUAL_ENV' in os.environ:
LOG_UI.debug('libexec')
elif os.path.exists('/usr/libexec/avocado'):
LOG_UI.debug('/usr/libexec/avocado')
elif os.path.exists('/usr/lib/avocado'):
LOG_UI.debug('/usr/lib/avocado')
else:
for path in os.environ.get('PATH').split(':'):
if (os.path.exists(os.path.join(path, 'avocado')) and
os.path.exists(os.path.join(os.path.dirname(path),
'libexec'))):
LOG_UI.debug(os.path.join(os.path.dirname(path), 'libexec'))
break
else:
LOG_UI.error("Can't locate avocado libexec path")
sys.exit(exit_codes.AVOCADO_FAIL)
return sys.exit(exit_codes.AVOCADO_ALL_OK)
LOG_UI.debug(resource_filename("avocado", "libexec"))
......@@ -194,8 +194,8 @@ popd
%{__cp} -r examples/yaml_to_mux %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/yaml_to_mux_loader %{buildroot}%{_datadir}/avocado
%{__cp} -r examples/varianter_pict %{buildroot}%{_datadir}/avocado
%{__install} -d -m 0755 %{buildroot}%{_libexecdir}/avocado
%{__install} -m 0755 libexec/avocado* %{buildroot}%{_libexecdir}/avocado
%{__mkdir} -p %{buildroot}%{_libexecdir}/
ln -s %{python_sitelib}/avocado/libexec/ %{buildroot}%{_libexecdir}/avocado
%check
%if %{with_tests}
......@@ -279,6 +279,7 @@ AVOCADO_CHECK_LEVEL=0 selftests/run
%exclude %{python_sitelib}/avocado_framework_plugin_loader_yaml*
%exclude %{python_sitelib}/avocado_framework_plugin_golang*
%exclude %{python_sitelib}/avocado_framework_plugin_result_upload*
%exclude %{python_sitelib}/avocado/libexec*
%package plugins-output-html
Summary: Avocado HTML report plugin
......@@ -455,11 +456,8 @@ A small set of utilities to interact with Avocado from the Bourne
Again Shell code (and possibly other similar shells).
%files bash
%{_libexecdir}/avocado/avocado-bash-utils
%{_libexecdir}/avocado/avocado_debug
%{_libexecdir}/avocado/avocado_error
%{_libexecdir}/avocado/avocado_info
%{_libexecdir}/avocado/avocado_warn
%{python_sitelib}/avocado/libexec*
%{_libexecdir}/avocado*
%changelog
* Sat Jan 6 2018 Cleber Rosa <cleber@redhat.com> - 57.0-3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册