aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-02-07 12:02:19 -0800
committerBrian Dolbec <dolsen@gentoo.org>2015-02-07 12:48:38 -0800
commit01762cdecb2dbcabf5b7b6c21f0a101d75c002e1 (patch)
tree1e87a6737fc0f54f33a029c63a59b51f8fd3295f /setup.py
parentsetup.py: Fix indentention (diff)
downloadlayman-01762cdecb2dbcabf5b7b6c21f0a101d75c002e1.tar.gz
layman-01762cdecb2dbcabf5b7b6c21f0a101d75c002e1.tar.bz2
layman-01762cdecb2dbcabf5b7b6c21f0a101d75c002e1.zip
setup.py: Make the selected PM plugins installable
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py40
1 files 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',
)