Mercurial > parpg-core
annotate SConstruct @ 2:e2a8e3805b04
Made parpg-core the main repository to pull from and build.
* Added parpg-assets as a subrepo under the data folder.
* Moved the SConstruct script into parpg-core and modified it to build and install parpg-assets as well.
* Made a few minor changes to the SConstruct file from the defunct parpg-main repository.
* Modified unix parpg executable script template to be more forgiving of installing the parpg Python package outside of PYTHONPATH.
* Updated the .hgignore file to include temporary SCons files.
author | M. George Hansen <technopolitica@gmail.com> |
---|---|
date | Sun, 15 May 2011 14:51:41 -0700 |
parents | |
children | 33684971cdb1 |
rev | line source |
---|---|
2
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
1 import sys |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
2 import os |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
3 import platform |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
4 import compileall |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
5 import fnmatch |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
6 from collections import Sequence |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
7 from multiprocessing import cpu_count |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
8 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
9 def InstallChmod(env, dest, source, mode): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
10 targets = env.Install(dest, source) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
11 for target in targets: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
12 env.AddPostAction(target, Chmod(target, mode)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
13 return targets |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
14 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
15 def InstallExecutable(env, dest, source): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
16 return env.InstallChmod(dest, source, mode=0755) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
17 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
18 def InstallReadOnly(env, dest, source): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
19 if not isinstance(source, Sequence): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
20 source = [source] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
21 targets = [] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
22 for entry in map(Entry, source): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
23 entry.disambiguate() |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
24 if entry.isdir(): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
25 target = env.InstallChmod(dest, entry, mode=0755) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
26 elif entry.isfile(): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
27 target = env.InstallChmod(dest, entry, mode=0644) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
28 else: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
29 # Something really weird happened and entry is not a Dir or a |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
30 # File... (Note: Yes this can happen!) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
31 error_message = \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
32 'expected entry to be a Dir or a File, but got {0!r}' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
33 raise ValueError(error_message.format(entry)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
34 targets.append(target) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
35 return targets |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
36 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
37 def InstallPyPackages(env, dest, source, compile=True): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
38 # Remove all existing *.pyc and *.pyo files for a sanitary install |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
39 # environment. |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
40 def _remove_compiled_modules(path): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
41 for dir_path, dir_names, file_names in os.walk(path): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
42 for file_name in fnmatch.filter(file_names, '*.py[co]'): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
43 file_path = os.path.join(dir_path, file_name) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
44 os.remove(file_path) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
45 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
46 def _add_targets(path): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
47 for dir_path, dir_names, file_names in os.walk(path): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
48 for file_name in fnmatch.filter(file_names, '*.py[co]'): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
49 file_path = os.path.join(dir_path, file_name) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
50 env.Clean(path, file_path) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
51 source_file_path = file_path.rstrip('oc') |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
52 env.Depends(file_path, source_file_path) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
53 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
54 if not isinstance(source, Sequence): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
55 source = [source] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
56 for dir in source: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
57 _remove_compiled_modules(str(dir)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
58 if compile: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
59 compileall.compile_dir(str(dir), ddir=str(dest), force=True) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
60 _add_targets(str(dir)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
61 targets = env.InstallReadOnly(dest, source) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
62 return targets |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
63 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
64 AddMethod(Environment, InstallChmod) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
65 AddMethod(Environment, InstallExecutable) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
66 AddMethod(Environment, InstallReadOnly) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
67 AddMethod(Environment, InstallPyPackages) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
68 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
69 EnsurePythonVersion(2, 6) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
70 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
71 AddOption( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
72 '--stand-alone', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
73 dest='stand_alone', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
74 action='store_true', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
75 default=False, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
76 help='install the entire program under installation prefix instead of in ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
77 'various system folders' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
78 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
79 AddOption( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
80 '--no-compile', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
81 dest='compile', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
82 action='store_false', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
83 default=True, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
84 help='don\'t compile any Python modules into .pyc files', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
85 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
86 SetOption('num_jobs', cpu_count()) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
87 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
88 def is_abs_path(key, val, env): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
89 if not os.path.isabs(val): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
90 error_message = '${key} must be an absolute path' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
91 raise ValueError(error_message.format(key=key)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
92 env[key] = os.path.normpath(val) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
93 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
94 variables = Variables() |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
95 # NOTE M. George Hansen 2011-05-13: Path variables are based on the GNU |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
96 # standards as defined at http://www.gnu.org/prep/standards/html_node/Directory-Variables.html |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
97 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
98 # Platform-specific variable defaults. |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
99 # FIXME M. George Hansen 2011-05-12: Define the MacOS-specific |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
100 # environmental variables (and check version...) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
101 platform_name = platform.system() |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
102 if platform_name in ['Linux', 'MacOS']: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
103 if GetOption('stand_alone'): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
104 PREFIX_DEFAULT = '/opt' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
105 else: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
106 PREFIX_DEFAULT = '/usr/local' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
107 BIN_DIR_DEFAULT = '$EXEC_PREFIX/bin' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
108 DATA_ROOT_DIR_DEFAULT = '$PREFIX/share/$PROJECT_NAME' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
109 SYS_CONF_DIR_DEFAULT = '$PREFIX/etc/$PROJECT_NAME' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
110 INCLUDE_DIR_DEFAULT = '$PREFIX/include/$PROJECT_NAME' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
111 DOC_DIR_DEFAULT = '$DATA_ROOT_DIR/doc/$PROJECT_NAME' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
112 LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
113 dist_name, dist_version, dist_id = \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
114 platform.linux_distribution(full_distribution_name=False) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
115 if dist_name in ['debian', 'Ubuntu']: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
116 # Debian uses dist-packages instead of site-packages for Python |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
117 # versions > 2.5. |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
118 PY_LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib/python$PY_VERSION_SHORT/' \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
119 'dist-packages' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
120 else: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
121 PY_LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib/python$PY_VERSION_SHORT/' \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
122 'site-packages' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
123 elif platform_name == 'Windows': |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
124 try: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
125 PREFIX_DEFAULT = os.environ['ProgramFiles'] + r'\$PROGRAM_NAME' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
126 except KeyError: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
127 PREFIX_DEFAULT = '' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
128 error_message = '%ProgramFiles% environmental variable is not ' \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
129 'set, unable to determine path to Program Files ' \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
130 'folder (use --prefix to override)' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
131 raise SConfWarning(error_message) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
132 BIN_DIR_DEFAULT = '$EXEC_PREFIX' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
133 DATA_ROOT_DIR_DEFAULT = '$PREFIX/data' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
134 SYS_CONF_DIR_DEFAULT = '$PREFIX/config' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
135 INCLUDE_DIR_DEFAULT = '$PREFIX/include' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
136 DOC_DIR_DEFAULT = '$PREFIX/doc/' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
137 LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
138 PY_LIB_DIR_DEFAULT = '$EXEC_PREFIX/lib' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
139 if GetOption('stand_alone'): |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
140 PY_LIB_DIR_DEFAULT = '$PREFIX/lib' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
141 else: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
142 python_prefix = sys.prefix |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
143 # FIXME M. George Hansen 2011-05-12: Does sys.prefix include the |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
144 # PythonX.Y part on Windows? |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
145 PY_LIB_DIR_DEFAULT = \ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
146 os.path.join(python_prefix, 'Lib', 'site-packages') |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
147 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
148 # Platform-independant variables: |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
149 variables.AddVariables( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
150 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
151 'PREFIX', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
152 'directory under which most or all of the program components should ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
153 'be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
154 PREFIX_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
155 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
156 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
157 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
158 'EXEC_PREFIX', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
159 'directory under which machine-specific compiled libraries and ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
160 'objects should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
161 '$PREFIX', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
162 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
163 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
164 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
165 'BIN_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
166 'directory where program executables should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
167 BIN_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
168 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
169 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
170 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
171 'DATA_ROOT_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
172 'directory under which read-only, architecture-independant data files ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
173 'should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
174 DATA_ROOT_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
175 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
176 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
177 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
178 'DATA_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
179 'directory where read-only, architecture-independant data files ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
180 'should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
181 '$DATA_ROOT_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
182 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
183 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
184 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
185 'SYS_CONF_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
186 'directory where read-only, machine-specific data files should be ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
187 'installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
188 SYS_CONF_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
189 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
190 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
191 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
192 'INCLUDE_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
193 'directory where C/C++ header files should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
194 INCLUDE_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
195 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
196 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
197 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
198 'DOC_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
199 'directory where program documentation should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
200 DOC_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
201 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
202 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
203 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
204 'LIB_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
205 'directory where platform-dependant, compiled library and object ' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
206 'files should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
207 LIB_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
208 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
209 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
210 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
211 'PY_LIB_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
212 'directory where pure Python modules and packages should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
213 PY_LIB_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
214 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
215 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
216 PathVariable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
217 'INCLUDE_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
218 'directory where C/C++ header files should be installed', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
219 INCLUDE_DIR_DEFAULT, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
220 is_abs_path, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
221 ), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
222 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
223 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
224 platform_name = platform.system() |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
225 python_version_tuple = platform.python_version_tuple() |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
226 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
227 environment = Environment( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
228 tools=['default', 'textfile', 'packaging'], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
229 variables=variables, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
230 PROJECT_NAME='parpg', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
231 PROJECT_VERSION_MAJOR=0, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
232 PROJECT_VERSION_MINOR=2, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
233 PROJECT_VERSION_PATCH=0, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
234 PROJECT_VERSION_SHORT='$PROJECT_VERSION_MAJOR.$PROJECT_VERSION_MAJOR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
235 PROJECT_VERSION_LONG='$PROJECT_VERSION_MAJOR.$PROJECT_VERSION_MINOR.' |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
236 '$PROJECT_VERSION_PATCH', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
237 PYTHON=sys.executable, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
238 PY_VERSION_SHORT='.'.join(python_version_tuple[:-1]), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
239 PY_VERSION_LONG='.'.join(python_version_tuple), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
240 PY_PACKAGES=[], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
241 CONFIG_FILES=[], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
242 DATA_FILES=[], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
243 EXECUTABLES=[], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
244 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
245 Help(variables.GenerateHelpText(environment)) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
246 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
247 config_dict = [('@{0}@'.format(key), environment.Dictionary()[key]) for key in |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
248 ('PREFIX', 'LIB_DIR', 'PY_LIB_DIR', 'BIN_DIR', 'SYS_CONF_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
249 'DATA_DIR', 'PYTHON')] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
250 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
251 environment['PY_PACKAGES'] += [ |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
252 Dir('src/parpg'), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
253 ] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
254 config_file_template = File('system.cfg.in') |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
255 subst_config_file = environment.Substfile(config_file_template, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
256 SUBST_DICT=config_dict) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
257 environment['CONFIG_FILES'] += [subst_config_file] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
258 environment['DATA_FILES'] += Glob('data/*') |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
259 # TODO M. George Hansen 2011-05-12: Implement windows executable. |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
260 executable_template = File('bin/unix/parpg.in') |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
261 subst_executable = environment.Substfile(executable_template, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
262 SUBST_DICT=config_dict) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
263 environment['EXECUTABLES'] += [subst_executable] |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
264 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
265 sources = environment.InstallPyPackages( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
266 '$PY_LIB_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
267 environment['PY_PACKAGES'], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
268 compile=GetOption('compile'), |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
269 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
270 config_files = environment.InstallChmod( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
271 '$SYS_CONF_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
272 environment['CONFIG_FILES'], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
273 mode=0755, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
274 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
275 Requires(config_files, subst_config_file) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
276 data_files = environment.InstallReadOnly( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
277 '$DATA_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
278 environment['DATA_FILES'], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
279 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
280 executables = environment.InstallExecutable( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
281 '$BIN_DIR', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
282 environment['EXECUTABLES'], |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
283 ) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
284 Requires(executables, subst_executable) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
285 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
286 # TODO M. George Hansen 2011-05-12: Implement package builder. |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
287 #package = environment.Package( |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
288 # NAME='parpg', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
289 # VERSION='0.2.0', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
290 # PACKAGEVERSION=0, |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
291 # LICENSE='gpl', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
292 # SUMMARY='', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
293 # DESCRIPTION='', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
294 # X_RPM_GROUP='Application/parpg', |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
295 #) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
296 |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
297 Default([sources, config_files, data_files, executables]) |
e2a8e3805b04
Made parpg-core the main repository to pull from and build.
M. George Hansen <technopolitica@gmail.com>
parents:
diff
changeset
|
298 Alias('install', [sources, config_files, data_files, executables]) |