diff options
author | David Rousselie <dax@happycoders.org> | 2008-03-07 23:41:37 +0300 |
---|---|---|
committer | David Rousselie <dax@happycoders.org> | 2008-03-07 23:41:37 +0300 |
commit | 64b7823403bf16a847e0063cc7ca5a00ab8b2baa (patch) | |
tree | e216c2fbd8d6133fdff601985752479dd331e82b /setup.py | |
parent | a5a2d3f6ca72212434ef24d9f10f4ce2fa647c62 (diff) |
Finish setuptools configuration
darcs-hash:20080307204137-86b55-c8e70d7a59efdc5db799a4709aa885ffbdc65de2.gz
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 31 |
1 files changed, 25 insertions, 6 deletions
@@ -21,13 +21,20 @@ ## from setuptools import setup, find_packages -from distutils import sysconfig +import sys +import re +import shutil -prefix = sysconfig.get_config_vars("prefix") -if len(prefix) == 0 or prefix[0] == "/usr": - config_dir = "/etc/jabber" +prefix = "/usr" +for arg in sys.argv: + if arg[0:9] == "--prefix=": + prefix = arg[9:] + break + +if prefix == "/usr": + config_dir = "/etc/jabber/" else: - config_dir = prefix[0] + "/etc/jabber" + config_dir = prefix + "/etc/jabber/" setup(name='jmc', version='0.3', @@ -44,4 +51,16 @@ setup(name='jmc', "tests"]), entry_points={'console_scripts': ['jmc=jmc.runner:main']}, test_suite='jmc.tests.suite') -# data_files=[("etc/jabber", "conf/jmc.conf")], + +shutil.copy("conf/jmc.conf", config_dir) +runner_file = open("src/jmc/runner.py") +dest_runner_file = open("build/lib/jmc/runner.py", "w") + +config_file_re = re.compile("(.*self\.config_file = \")(jmc.conf\")") +for line in runner_file: + match = config_file_re.match(line) + if match is not None: + dest_runner_file.write(match.group(1) + config_dir + + match.group(2) + "\n") + else: + dest_runner_file.write(line) |