162 |
|
|
163 |
class gnue_install (install): |
class gnue_install (install): |
164 |
|
|
165 |
|
user_options = install.user_options |
166 |
|
i = 0 |
167 |
|
for option in user_options: |
168 |
|
i = i + 1 |
169 |
|
if option [0] == "install-data=": |
170 |
|
user_options.insert (i, ("install-config=", None, |
171 |
|
"installation directory for configuration files")) |
172 |
|
break |
173 |
|
|
174 |
|
# --------------------------------------------------------------------------- |
175 |
|
# Initalize options |
176 |
|
# --------------------------------------------------------------------------- |
177 |
|
|
178 |
|
def initialize_options (self): |
179 |
|
install.initialize_options (self) |
180 |
|
self.install_config = None |
181 |
|
|
182 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
183 |
# Check dependencies |
# Check dependencies |
184 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
194 |
|
|
195 |
def _write_config (self): |
def _write_config (self): |
196 |
|
|
|
self.install_config = os.path.join (self.install_data, "etc") # FIXME! |
|
|
|
|
197 |
output = open ("module/base/paths.py", "w") |
output = open ("module/base/paths.py", "w") |
198 |
output.write ("# This file was generated during installation.\n") |
output.write ("# This file was generated during installation.\n") |
199 |
output.write ("\n") |
output.write ("\n") |
337 |
if self.finalized: |
if self.finalized: |
338 |
return |
return |
339 |
|
|
340 |
|
# try to set a reasonable default for --install-config |
341 |
|
if self.install_config is None: |
342 |
|
if self.home == "/usr" or self.prefix == "/usr": |
343 |
|
self.install_config = "/etc" |
344 |
|
elif self.home == "/opt/gnue" or self.prefix == "/opt/gnue": |
345 |
|
self.install_config = "/etc/opt/gnue" |
346 |
|
else: |
347 |
|
self.install_config = os.path.join (self.install_data, "etc") |
348 |
|
|
349 |
# if install directory isn't in Python's search path, add it there |
# if install directory isn't in Python's search path, add it there |
350 |
if self.install_lib in sys.path: |
if self.install_lib in sys.path: |
351 |
path_line = "" |
path_line = "" |
428 |
'prune images/CVS'], |
'prune images/CVS'], |
429 |
preserve_path = 1), |
preserve_path = 1), |
430 |
Data_Files( |
Data_Files( |
431 |
base_dir = 'install_data', |
base_dir = 'install_config', |
432 |
copy_to = '', |
copy_to = '', |
433 |
template = ['recursive-include etc *', |
template = ['recursive-include etc *', |
434 |
'prune etc/CVS'], |
'prune etc/CVS'], |
435 |
preserve_path = 1), |
preserve_path = 0), |
436 |
Data_Files( |
Data_Files( |
437 |
base_dir = 'install_data', |
base_dir = 'install_data', |
438 |
copy_to = '', |
copy_to = '', |