From 01762cdecb2dbcabf5b7b6c21f0a101d75c002e1 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Sat, 7 Feb 2015 12:02:19 -0800 Subject: setup.py: Make the selected PM plugins installable --- setup.py | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index bca2481..aa8b37b 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,8 @@ import os import sys -from distutils.core import setup +from distutils.core import setup, Command +from distutils.dir_util import copy_tree # this affects the names of all the directories we do stuff with @@ -47,14 +48,32 @@ for mod in sorted(SELECTABLE): for plugin in sorted(SYNC_PLUGINS): if plugin in USE: - modules.append(SYNC_PLUGIN) - -setup(name = 'layman', - version = VERSION, - description = 'Python script for retrieving gentoo overlays', - author = 'Brian Dolbec, Gunnar Wrobel (original author retired)', - author_email = 'dolsen@gentoo', - url = 'http://layman.sourceforge.net/, ' +\ + modules.append(SYNC_PLUGINS[plugin]) + + +class setup_plugins(Command): + """ Perform moves for the plugins into base namespace + so they can be installed. """ + + user_options = [ + ] + + def initialize_options(self): + self.build_base = None + + def finalize_options(self): + self.set_undefined_options('build', + ('build_base', 'build_base')) + + def run(self): + for plugin in sorted(SYNC_PLUGINS): + if plugin in USE: + source = os.path.join('pm_plugins', + SYNC_PLUGINS[plugin].split('.')[0]) + target = SYNC_PLUGINS[plugin].split('.')[0] + copy_tree(source, target) + + setup( name = 'layman', version = VERSION, @@ -69,5 +88,8 @@ setup( ] + modules, scripts = ['bin/layman', 'bin/layman-overlay-maker', 'bin/layman-mounter', 'bin/layman-updater'], + cmdclass = { + 'setup_plugins': setup_plugins, + }, license = 'GPL', ) -- cgit v1.2.3-65-gdbad