annotate setup.py @ 2054:9bea36ddd065

macro/Hits: shows hits of a page (refactored version from MacroMarket)
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 10 Jun 2007 17:12:16 +0200
parents 88326c62ae53
children 01f05e74aa9c
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 #!/usr/bin/env python
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4 MoinMoin installer
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
5
1179
f82f71d052cd updated README, setup.py comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1156
diff changeset
6 @copyright: 2001-2005 by Jürgen Hermann <jh@web.de>,
f82f71d052cd updated README, setup.py comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1156
diff changeset
7 2006 by MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
9 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
10
1180
c1c0d7f6f2b4 remove string module usage, some other cosmetic changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1179
diff changeset
11 import os, sys, glob
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13 import distutils
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
14 from distutils.core import setup
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
15 from distutils.command.build_scripts import build_scripts
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17 from MoinMoin.version import release, revision
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
19 # we need this for distutils from python 2.3 compatibility, python 2.4 has the
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
20 # 'package_data' keyword to the 'setup' function to install data in packages
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
21 # see http://wiki.python.org/moin/DistutilsInstallDataScattered
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
22 from distutils.command.install_data import install_data
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
23 class smart_install_data(install_data):
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
24 def run(self):
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
25 i18n_data_files = [(target, files) for (target, files) in self.data_files if target.startswith('MoinMoin/i18n')]
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
26 share_data_files = [(target, files) for (target, files) in self.data_files if target.startswith('share/moin')]
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
27 # first install the share/moin stuff:
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
28 self.data_files = share_data_files
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
29 install_data.run(self)
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
30 # now we need to install the *.po files to the package dir:
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
31 # need to change self.install_dir to the library dir
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
32 install_cmd = self.get_finalized_command('install')
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
33 self.install_dir = getattr(install_cmd, 'install_lib')
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
34 self.data_files = i18n_data_files
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
35 return install_data.run(self)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
37 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
38 ### Helpers
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
39 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41 def isbad(name):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
42 """ Whether name should not be installed """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
43 return (name.startswith('.') or
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
44 name.startswith('#') or
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45 name.endswith('.pickle') or
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 name == 'CVS')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
48 def isgood(name):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 """ Whether name should be installed """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 return not isbad(name)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
51
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 def makeDataFiles(prefix, dir):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53 """ Create distutils data_files structure from dir
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55 distutil will copy all file rooted under dir into prefix, excluding
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 dir itself, just like 'ditto src dst' works, and unlike 'cp -r src
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 dst, which copy src into dst'.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 Typical usage:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
60 # install the contents of 'wiki' under sys.prefix+'share/moin'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 data_files = makeDataFiles('share/moin', 'wiki')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 For this directory structure:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64 root
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 file1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 file2
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67 dir
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
68 file
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 subdir
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 file
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
72 makeDataFiles('prefix', 'root') will create this distutil data_files structure:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
73 [('prefix', ['file1', 'file2']),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
74 ('prefix/dir', ['file']),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
75 ('prefix/dir/subdir', ['file'])]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
78 # Strip 'dir/' from of path before joining with prefix
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
79 dir = dir.rstrip('/')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
80 strip = len(dir) + 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
81 found = []
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
82 os.path.walk(dir, visit, (prefix, strip, found))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
83 return found
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
84
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
85 def visit((prefix, strip, found), dirname, names):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
86 """ Visit directory, create distutil tuple
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
87
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
88 Add distutil tuple for each directory using this format:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
89 (destination, [dirname/file1, dirname/file2, ...])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
90
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
91 distutil will copy later file1, file2, ... info destination.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
92 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
93 files = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
94 # Iterate over a copy of names, modify names
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
95 for name in names[:]:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
96 path = os.path.join(dirname, name)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
97 # Ignore directories - we will visit later
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
98 if os.path.isdir(path):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
99 # Remove directories we don't want to visit later
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
100 if isbad(name):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
101 names.remove(name)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
102 continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
103 elif isgood(name):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
104 files.append(path)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
105 destination = os.path.join(prefix, dirname[strip:])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
106 found.append((destination, files))
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
107
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
108
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
109 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
110 ### Build script files
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
111 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
112
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
113 class build_scripts_create(build_scripts):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
114 """ Overload the build_scripts command and create the scripts
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
115 from scratch, depending on the target platform.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
116
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
117 You have to define the name of your package in an inherited
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
118 class (due to the delayed instantiation of command classes
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
119 in distutils, this cannot be passed to __init__).
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
120
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
121 The scripts are created in an uniform scheme: they start the
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
122 run() function in the module
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
123
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
124 <packagename>.script.<mangled_scriptname>
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
125
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
126 The mangling of script names replaces '-' and '/' characters
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
127 with '-' and '.', so that they are valid module paths.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
128 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
129 package_name = None
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
130
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
131 def copy_scripts(self):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
132 """ Create each script listed in 'self.scripts'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
133 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
134 if not self.package_name:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
135 raise Exception("You have to inherit build_scripts_create and"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
136 " provide a package name")
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
137
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
138 self.mkpath(self.build_dir)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
139 for script in self.scripts:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
140 outfile = os.path.join(self.build_dir, os.path.basename(script))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
141
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
142 #if not self.force and not newer(script, outfile):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
143 # self.announce("not copying %s (up-to-date)" % script)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
144 # continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
145
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
146 if self.dry_run:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
147 self.announce("would create %s" % outfile)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
148 continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
149
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
150 module = os.path.splitext(os.path.basename(script))[0]
1180
c1c0d7f6f2b4 remove string module usage, some other cosmetic changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1179
diff changeset
151 module = module.replace('-', '_').replace('/', '.')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
152 script_vars = {
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
153 'python': os.path.normpath(sys.executable),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
154 'package': self.package_name,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
155 'module': module,
1832
b180f047d918 comments only: cleaned up TODO, XXX, ...
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1472
diff changeset
156 'package_location': '/usr/lib/python/site-packages', # FIXME: we need to know the correct path
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
157 }
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
158
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
159 self.announce("creating %s" % outfile)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
160 file = open(outfile, 'w')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
161
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
162 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
163 if sys.platform == "win32":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
164 file.write('@echo off\n'
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
165 'if NOT "%%_4ver%%" == "" %(python)s -c "from %(package)s.script.%(module)s import run; run()" %%$\n'
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
166 'if "%%_4ver%%" == "" %(python)s -c "from %(package)s.script.%(module)s import run; run()" %%*\n'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
167 % script_vars)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
168 else:
778
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
169 file.write("#! %(python)s\n"
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
170 "#Fix and uncomment those 2 lines if your moin command doesn't find the MoinMoin package:\n"
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
171 "#import sys\n"
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
172 "#sys.path.insert(0, '%(package_location)s')\n"
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
173 "from %(package)s.script.%(module)s import run\n"
c02c3bcad99b add some comment to POSIX platform moin command how to fix when it does not find MoinMoin module
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 757
diff changeset
174 "run()\n"
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
175 % script_vars)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
176 finally:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
177 file.close()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
178 os.chmod(outfile, 0755)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
179
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
180
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
181 class build_scripts_moin(build_scripts_create):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
182 package_name = 'MoinMoin'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
183
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
184
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
185 def scriptname(path):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
186 """ Helper for building a list of script names from a list of
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
187 module files.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
188 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
189 script = os.path.splitext(os.path.basename(path))[0]
1180
c1c0d7f6f2b4 remove string module usage, some other cosmetic changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1179
diff changeset
190 script = script.replace('_', '-')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
191 if sys.platform == "win32":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
192 script = script + ".bat"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
193 return script
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
194
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
195 # build list of scripts from their implementation modules
1866
0194beaf511e reduce reduce, filter and map usage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1832
diff changeset
196 moin_scripts = [scriptname(fn) for fn in glob.glob('MoinMoin/script/[!_]*.py')]
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
197
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
198
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
199 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
200 ### Call setup()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
201 #############################################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
202
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
203 setup_args = {
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
204 'name': "moin",
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
205 'version': release,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
206 'description': "MoinMoin %s.%s is a Python clone of WikiWiki" % (release, revision),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
207 'author': "Jürgen Hermann",
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
208 'author_email': "jh@web.de",
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
209 'url': "http://moinmoin.wikiwikiweb.de/",
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
210 'license': "GNU GPL",
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
211 'long_description': """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
212 A WikiWikiWeb is a collaborative hypertext environment, with an
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
213 emphasis on easy access to and modification of information. MoinMoin
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
214 is a Python WikiClone that allows you to easily set up your own wiki,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
215 only requiring a Python installation.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
216 """,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
217 'packages': [
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
218 'MoinMoin',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
219 'MoinMoin.action',
878
d825de2173d5 add comment to GUI converter, add missing packages to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 825
diff changeset
220 'MoinMoin.auth',
1060
4b02826f6408 add MoinMoin.config to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 933
diff changeset
221 'MoinMoin.config',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
222 'MoinMoin.converter',
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
223 'MoinMoin.filter',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
224 'MoinMoin.formatter',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
225 'MoinMoin.i18n',
686
f2debe9be4e0 more i18n cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 685
diff changeset
226 'MoinMoin.i18n.tools',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
227 'MoinMoin.logfile',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
228 'MoinMoin.macro',
878
d825de2173d5 add comment to GUI converter, add missing packages to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 825
diff changeset
229 'MoinMoin.mail',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
230 'MoinMoin.parser',
654
54b8e7d068d9 more import fixes for the request module, fix setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 554
diff changeset
231 'MoinMoin.request',
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
232 'MoinMoin.script',
501
069acf15d7b3 moin account {check,create,disable} script commands
Thomas Waldmann <tw@waldmann-edv.de>
parents: 499
diff changeset
233 'MoinMoin.script.account',
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
234 'MoinMoin.script.cli',
554
e5e529840fcf fixed Makefile, setup.py, comments
Thomas Waldmann <tw@waldmann-edv.de>
parents: 507
diff changeset
235 'MoinMoin.script.export',
e5e529840fcf fixed Makefile, setup.py, comments
Thomas Waldmann <tw@waldmann-edv.de>
parents: 507
diff changeset
236 'MoinMoin.script.import',
807
dc31818ae861 add xapian indexer script
Franz Pletz <fpletz AT franz-pletz DOT org>
parents: 804
diff changeset
237 'MoinMoin.script.index',
503
1c46c48ca67e moin maint cleanpage
Thomas Waldmann <tw@waldmann-edv.de>
parents: 501
diff changeset
238 'MoinMoin.script.maint',
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents: 369
diff changeset
239 'MoinMoin.script.migration',
498
fa788cd35485 temp fix for setup.py (old script stuff)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 497
diff changeset
240 'MoinMoin.script.old',
499
a65a53daed80 add old migration scripts
Thomas Waldmann <tw@waldmann-edv.de>
parents: 498
diff changeset
241 'MoinMoin.script.old.migration',
498
fa788cd35485 temp fix for setup.py (old script stuff)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 497
diff changeset
242 'MoinMoin.script.old.xmlrpc-tools',
1185
7fa381254061 add script.xmlrpc to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1180
diff changeset
243 'MoinMoin.script.xmlrpc',
1156
7fd2894837e0 add search module to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1060
diff changeset
244 'MoinMoin.search',
746
0d3e9b79dde3 moved SecurityPolicy stuff to security/*
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 686
diff changeset
245 'MoinMoin.security',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
246 'MoinMoin.server',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
247 'MoinMoin.stats',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
248 'MoinMoin.support',
804
ede8da99ce86 Remove last traces of lupy
Franz Pletz <fpletz AT franz-pletz DOT org>
parents: 686
diff changeset
249 'MoinMoin.support.xapwrap',
1472
ff126e63a52e install MoinMoin.support.parsedatetime
Franz Pletz <fpletz AT franz-pletz DOT org>
parents: 1185
diff changeset
250 'MoinMoin.support.parsedatetime',
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
251 'MoinMoin.theme',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
252 'MoinMoin.util',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
253 'MoinMoin.widget',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
254 'MoinMoin.wikixml',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
255 'MoinMoin.xmlrpc',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
256
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
257 # if we get *massive* amounts of test, this should probably be left out
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
258 'MoinMoin._tests',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
259 ],
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
260
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
261 # We can use package_* instead of the smart_install_data hack when we
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
262 # require Python 2.4.
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
263 #'package_dir': { 'MoinMoin.i18n': 'MoinMoin/i18n', },
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
264 #'package_data': { 'MoinMoin.i18n': ['README', 'Makefile', 'MoinMoin.pot', 'POTFILES.in',
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
265 # '*.po',
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
266 # 'tools/*',], },
757
38914e43f0dd setup.py: include i18n/mo/*.mo and some other files
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 746
diff changeset
267
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
268 # Override certain command classes with our own ones
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
269 'cmdclass': {
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
270 'build_scripts': build_scripts_moin,
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
271 'install_data': smart_install_data, # hack needed for 2.3
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
272 },
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
273
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
274 'scripts': moin_scripts,
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
275
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
276 # This copies the contents of wiki dir under sys.prefix/share/moin
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
277 # Do not put files that should not be installed in the wiki dir, or
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
278 # clean the dir before you make the distribution tarball.
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
279 'data_files': makeDataFiles('share/moin', 'wiki') + makeDataFiles('MoinMoin/i18n', 'MoinMoin/i18n')
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
280 }
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
281
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
282 if hasattr(distutils.dist.DistributionMetadata, 'get_keywords'):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
283 setup_args['keywords'] = "wiki web"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
284
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
285 if hasattr(distutils.dist.DistributionMetadata, 'get_platforms'):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
286 setup_args['platforms'] = "win32 posix"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
287
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
288
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
289 try:
1869
88326c62ae53 remove apply() usage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1866
diff changeset
290 setup(**setup_args)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
291 except distutils.errors.DistutilsPlatformError, ex:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
292 print
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
293 print str(ex)
933
a03c030a62c5 make setup.py work with python2.3 AND copy *.po to package dir
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 901
diff changeset
294
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
295 print """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
296 POSSIBLE CAUSE
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
297
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
298 "distutils" often needs developer support installed to work
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
299 correctly, which is usually located in a separate package
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
300 called "python%d.%d-dev(el)".
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
301
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
302 Please contact the system administrator to have it installed.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
303 """ % sys.version_info[:2]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
304 sys.exit(1)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
305