aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2011-09-08 16:57:24 +0000
committerRalph Sennhauser <sera@gentoo.org>2011-09-08 16:57:24 +0000
commitc370e2b8ec74443ad0fc0a2fcab6c307565f2515 (patch)
treef666d70d858529ac2017a0acf0fbf9e7ba5f5ac1
parentInstall configuration files into prefix (diff)
downloadjava-config-c370e2b8ec74443ad0fc0a2fcab6c307565f2515.tar.gz
java-config-c370e2b8ec74443ad0fc0a2fcab6c307565f2515.tar.bz2
java-config-c370e2b8ec74443ad0fc0a2fcab6c307565f2515.zip
Add eprefixify to setup.py
svn path=/projects/java-config-2/branches/generation3-support/; revision=8789
-rw-r--r--setup.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index dc8cfda..a7666ad 100644
--- a/setup.py
+++ b/setup.py
@@ -7,6 +7,26 @@ import os
def eprefix():
return os.getenv('EPREFIX', '')
+from distutils.command.build import build
+import fileinput
+import sys
+
+class my_build(build):
+
+ def initialize_options(self):
+ build.initialize_options(self)
+
+ def finalize_options(self):
+ build.finalize_options(self)
+
+ def run(self):
+ # TODO Should make a copy first. -sera
+ for base, dirs, files in os.walk('src'):
+ for f in files:
+ for line in fileinput.input(os.path.join(base, f),inplace=True):
+ sys.stdout.write(line.replace('@GENTOO_PORTAGE_EPREFIX@', eprefix()))
+ build.run(self)
+
class my_install_scripts(install_scripts):
"""Specialized data file install to handle our symlinks"""
install_scripts.user_options.append(('symlink-tools=', None,
@@ -36,7 +56,7 @@ from distutils.core import setup
from glob import glob
setup (
- cmdclass={'install_scripts': my_install_scripts},
+ cmdclass={'build' : my_build, 'install_scripts': my_install_scripts},
name = 'java-config',
version = '2.1.11',
description = 'java enviroment configuration tool',