From fa6a71287dd9d0d9eb9ea8eccee2d9700c4a0c74 Mon Sep 17 00:00:00 2001 From: Nick Murtagh Date: Sat, 29 Jul 2017 20:12:42 +0100 Subject: [PATCH] Add option to move specified files into /usr/bin --- rpmvenv/extensions/python/venv.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rpmvenv/extensions/python/venv.py b/rpmvenv/extensions/python/venv.py index d0bb595..8409c22 100644 --- a/rpmvenv/extensions/python/venv.py +++ b/rpmvenv/extensions/python/venv.py @@ -66,6 +66,11 @@ required=False, default=False, ), + bin_files=ListOption( + description='Files to move to /usr/bin.', + option=StringOption(), + default=(), + ), ), ) @@ -165,4 +170,14 @@ def generate(config, spec): 'find %{venv_dir}/lib -type f -name "*.so" | xargs -r strip', )) + if config.python_venv.bin_files: + spec.blocks.install.append('mkdir -p %{buildroot}/usr/bin') + + for path in config.python_venv.bin_files: + spec.blocks.files.append('/usr/bin/{0}'.format(path)) + spec.blocks.install.append( + 'mv %{{venv_dir}}/bin/{0} %{{buildroot}}/usr/bin/{0}' + .format(path) + ) + return spec