diff options
author | 2015-02-07 12:02:19 -0800 | |
---|---|---|
committer | 2015-02-07 12:48:38 -0800 | |
commit | 01762cdecb2dbcabf5b7b6c21f0a101d75c002e1 (patch) | |
tree | 1e87a6737fc0f54f33a029c63a59b51f8fd3295f | |
parent | setup.py: Fix indentention (diff) | |
download | layman-plugin.tar.gz layman-plugin.tar.bz2 layman-plugin.zip |
setup.py: Make the selected PM plugins installableplugin
-rwxr-xr-x | setup.py | 40 |
1 files changed, 31 insertions, 9 deletions
@@ -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', ) |