20 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
21 |
# |
# |
22 |
# Copyright 2001-2003 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
|
# |
|
23 |
|
|
24 |
import sys |
import sys |
25 |
import string |
import string |
78 |
except ValueError: |
except ValueError: |
79 |
pass |
pass |
80 |
|
|
81 |
if (sys.platform != "win32" and not have_prefix) or have_setupcfg: |
if (sys.platform != "win32" and not have_prefix and "install" in sys.argv) \ |
82 |
|
or have_setupcfg: |
83 |
os.system ("cp %s setup.cfg" % setupcfg) |
os.system ("cp %s setup.cfg" % setupcfg) |
84 |
else: |
else: |
85 |
try: |
try: |
112 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
113 |
|
|
114 |
if "sdist" in sys.argv: |
if "sdist" in sys.argv: |
115 |
|
# if a paths.py exists, it would get distributed if we didn't remove it |
116 |
|
if os.path.isfile ("module/base/paths.py"): |
117 |
|
os.remove ("module/base/paths.py") |
118 |
build_files () |
build_files () |
119 |
|
|
120 |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
163 |
pass |
pass |
164 |
|
|
165 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
166 |
# Create gnue_sys.py and site_config.cfg |
# Create paths.py and site_config.cfg |
167 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
168 |
|
|
169 |
def _write_config (self): |
def _write_config (self): |
|
dict = self.distribution.get_option_dict ("install") |
|
|
|
|
|
options = [] |
|
|
for key in dict.keys(): |
|
|
options.append('%s = "%s"' % (key, string.replace(str(dict[key][1]),'"','\\"'))) |
|
170 |
|
|
171 |
if dict.has_key('prefix') and not dict.has_key('install_prefix'): |
output = open ("module/base/paths.py", "w") |
172 |
options.append('install_prefix = prefix') |
output.write ("""\ |
173 |
|
# GNU Enterprise file path setup |
|
gnue_sys_py = """\ |
|
174 |
# |
# |
175 |
# Copyright 2001-2003 Free Software Foundation |
# Copyright 2001-2003 Free Software Foundation |
176 |
# |
# |
190 |
# License along with program; see the file COPYING. If not, |
# License along with program; see the file COPYING. If not, |
191 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
192 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
193 |
# |
""") |
194 |
|
output.write ("\n") |
195 |
import sys |
output.write ("# This file was generated during installation.\n") |
196 |
|
output.write ("\n") |
197 |
|
output.write ("lib = \"%s\"\n" % self.install_lib) |
198 |
|
output.write ("scripts = \"%s\"\n" % self.install_scripts) |
199 |
|
output.write ("data = \"%s\"\n" % self.install_data) |
200 |
|
# output.write ("config = \"%s\"\n" % self.install_config) |
201 |
|
output.close () |
202 |
|
|
203 |
# Settings used during installation |
# ------------------------------------------------------------------------- |
|
%s |
|
204 |
|
|
205 |
|
dict = self.distribution.get_option_dict ("install") |
206 |
|
|
207 |
# Add gnue base directory to the sys.path |
options = [] |
208 |
if install_lib not in sys.path: |
for key in dict.keys(): |
209 |
sys.path.insert(0,install_lib) |
options.append('%s = "%s"' % (key, string.replace(str(dict[key][1]),'"','\\"'))) |
|
""" % string.join(options,'\n') |
|
210 |
|
|
211 |
output = open("gnue_sys.py", "w") |
if dict.has_key('prefix') and not dict.has_key('install_prefix'): |
212 |
output.write(gnue_sys_py) |
options.append('install_prefix = prefix') |
|
output.close() |
|
213 |
|
|
214 |
output = open("site_config.cfg", "w") |
output = open("site_config.cfg", "w") |
215 |
output.write("""# IF YOU DON'T KNOW WHAT THIS FILE IS FOR, THEN YOU DON'T NEED TO BE HERE |
output.write("""# IF YOU DON'T KNOW WHAT THIS FILE IS FOR, THEN YOU DON'T NEED TO BE HERE |
394 |
base_dir = 'install_data', |
base_dir = 'install_data', |
395 |
copy_to = 'share/doc/gnue-common', |
copy_to = 'share/doc/gnue-common', |
396 |
template = ['recursive-include doc *', |
template = ['recursive-include doc *', |
397 |
'prune doc/CVS'], |
'prune doc/CVS', |
398 |
|
'prune doc/technotes/CVS'], |
399 |
strip_dirs = 1, # This is a number, not true/false |
strip_dirs = 1, # This is a number, not true/false |
400 |
preserve_path = 1) |
preserve_path = 1) |
401 |
] |
] |
555 |
|
|
556 |
scripts = ["scripts/gnue-schema"], |
scripts = ["scripts/gnue-schema"], |
557 |
) |
) |
558 |
|
|
559 |
|
# ----------------------------------------------------------------------------- |
560 |
|
# Clean up |
561 |
|
# ----------------------------------------------------------------------------- |
562 |
|
|
563 |
|
if os.path.isfile ("setup.cfg"): |
564 |
|
os.remove ("setup.cfg") |