From 53a938452116c30143e60661aa56bd20af6f536f Mon Sep 17 00:00:00 2001 From: ianb Date: Wed, 18 May 2005 21:09:19 +0000 Subject: Fixed up installation so --install-data works; only works on Python 2.4's distutils though --- setup.py | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9a56ba6..aa1d2db 100644 --- a/setup.py +++ b/setup.py @@ -12,23 +12,30 @@ if sys.version < '2.2.3': import os -BASEDIR = os.path.split(os.path.abspath(__file__))[0] +BASEDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'paste') +DATA_PREFIX = sysconfig.get_python_lib(prefix='') -def get_data_files(path, files = []): - l = [] - for name in os.listdir(path): - if name[0] == ".": + +def get_data_files(relpath, files=None): + files = files or [] + for name in os.listdir(os.path.join(BASEDIR, relpath)): + if name.startswith("."): continue - relpath = os.path.join(path, name) - f = os.path.join(BASEDIR, relpath) - if os.path.isdir(f): - get_data_files(relpath, files) - elif os.path.isfile(f): - l.append(f) - pref = sysconfig.get_python_lib()[len(sysconfig.PREFIX) + 1:] - files.append((os.path.join(pref, path), l)) + fn = os.path.join(relpath, name) + if os.path.isdir(os.path.join(BASEDIR, fn)): + get_data_files(fn, files) + elif os.path.isfile(os.path.join(BASEDIR, fn)): + files.append(fn) return files +package_data = [] +for subdir in [('app_templates',), + ('frameworks',)]: + package_data.extend(get_data_files(os.path.join(*subdir))) +for filename in [('default_config.conf',)]: + package_data.append(os.path.join(*filename)) +print package_data + setup(name="Paste", version="0.1", description="Tools for use with a Web Server Gateway Interface stack", @@ -63,14 +70,13 @@ functionality. "paste.webkit.FakeWebware", "paste.webkit.FakeWebware.WebKit", "paste.webkit.FakeWebware.WebUtils", - "paste.webkit.FakeWebware.MiscUtils", - "paste.servers", - "paste.servers.scgi_server", + "paste.webkit.FakeWebware.MiscUtils", + "paste.servers", + "paste.servers.scgi_server", "paste.wareweb"], scripts=['scripts/paste-server', 'scripts/paste-setup'], download_url="", - data_files=get_data_files(os.path.join("paste","app_templates")) + get_data_files(os.path.join("paste", "frameworks")) + - [(os.path.join(sysconfig.get_python_lib()[len(sysconfig.PREFIX) + 1:], "paste"), [os.path.join("paste", "default_config.conf")])] + package_data={'paste': package_data}, ) # Send announce to: -- cgit v1.2.1