diff options
author | David Rousselie <dax@happycoders.org> | 2008-03-08 00:01:59 +0300 |
---|---|---|
committer | David Rousselie <dax@happycoders.org> | 2008-03-08 00:01:59 +0300 |
commit | fc6952c5731fc7f1de383afce2228c3036ad525d (patch) | |
tree | ac7551b3e9cba69ac763d326b3c80165df6ba566 /setup.py | |
parent | 64b7823403bf16a847e0063cc7ca5a00ab8b2baa (diff) |
Fix setup script
darcs-hash:20080307210159-86b55-586662b9ae0917210a774dee49baace0a1ac4f6e.gz
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -24,6 +24,7 @@ from setuptools import setup, find_packages import sys import re import shutil +import os prefix = "/usr" for arg in sys.argv: @@ -52,15 +53,16 @@ setup(name='jmc', entry_points={'console_scripts': ['jmc=jmc.runner:main']}, test_suite='jmc.tests.suite') -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) +if len(sys.argv) >= 2 and sys.argv[1] == "install": + os.makedirs(config_dir) + 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) |