1 |
commit: 01762cdecb2dbcabf5b7b6c21f0a101d75c002e1 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 7 20:02:19 2015 +0000 |
4 |
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 7 20:48:38 2015 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=01762cde |
7 |
|
8 |
setup.py: Make the selected PM plugins installable |
9 |
|
10 |
--- |
11 |
setup.py | 40 +++++++++++++++++++++++++++++++--------- |
12 |
1 file changed, 31 insertions(+), 9 deletions(-) |
13 |
|
14 |
diff --git a/setup.py b/setup.py |
15 |
index bca2481..aa8b37b 100755 |
16 |
--- a/setup.py |
17 |
+++ b/setup.py |
18 |
@@ -3,7 +3,8 @@ |
19 |
import os |
20 |
import sys |
21 |
|
22 |
-from distutils.core import setup |
23 |
+from distutils.core import setup, Command |
24 |
+from distutils.dir_util import copy_tree |
25 |
|
26 |
|
27 |
# this affects the names of all the directories we do stuff with |
28 |
@@ -47,14 +48,32 @@ for mod in sorted(SELECTABLE): |
29 |
|
30 |
for plugin in sorted(SYNC_PLUGINS): |
31 |
if plugin in USE: |
32 |
- modules.append(SYNC_PLUGIN) |
33 |
- |
34 |
-setup(name = 'layman', |
35 |
- version = VERSION, |
36 |
- description = 'Python script for retrieving gentoo overlays', |
37 |
- author = 'Brian Dolbec, Gunnar Wrobel (original author retired)', |
38 |
- author_email = 'dolsen@gentoo', |
39 |
- url = 'http://layman.sourceforge.net/, ' +\ |
40 |
+ modules.append(SYNC_PLUGINS[plugin]) |
41 |
+ |
42 |
+ |
43 |
+class setup_plugins(Command): |
44 |
+ """ Perform moves for the plugins into base namespace |
45 |
+ so they can be installed. """ |
46 |
+ |
47 |
+ user_options = [ |
48 |
+ ] |
49 |
+ |
50 |
+ def initialize_options(self): |
51 |
+ self.build_base = None |
52 |
+ |
53 |
+ def finalize_options(self): |
54 |
+ self.set_undefined_options('build', |
55 |
+ ('build_base', 'build_base')) |
56 |
+ |
57 |
+ def run(self): |
58 |
+ for plugin in sorted(SYNC_PLUGINS): |
59 |
+ if plugin in USE: |
60 |
+ source = os.path.join('pm_plugins', |
61 |
+ SYNC_PLUGINS[plugin].split('.')[0]) |
62 |
+ target = SYNC_PLUGINS[plugin].split('.')[0] |
63 |
+ copy_tree(source, target) |
64 |
+ |
65 |
+ |
66 |
setup( |
67 |
name = 'layman', |
68 |
version = VERSION, |
69 |
@@ -69,5 +88,8 @@ setup( |
70 |
] + modules, |
71 |
scripts = ['bin/layman', 'bin/layman-overlay-maker', |
72 |
'bin/layman-mounter', 'bin/layman-updater'], |
73 |
+ cmdclass = { |
74 |
+ 'setup_plugins': setup_plugins, |
75 |
+ }, |
76 |
license = 'GPL', |
77 |
) |