install all files

This commit is contained in:
Frédéric Péters 2005-05-24 11:52:27 +00:00
parent c79cd93d90
commit 3ccb36111c
1 changed files with 20 additions and 12 deletions

View File

@ -1,12 +1,24 @@
#! /usr/bin/env python
import os
import glob
import distutils.core
import distutils.sysconfig
import distutils.command
from quixote.ptl.qx_distutils import qx_build_py
local_cfg = None
if os.path.exists('wcs/wcs_cfg.py'):
local_cfg = file('wcs/wcs_cfg.py').read()
os.unlink('wcs/wcs_cfg.py')
def data_tree(destdir, sourcedir):
extensions = ['.css', '.png', '.jpeg', '.jpg', '.xml', '.html']
r = []
for root, dirs, files in os.walk(sourcedir):
l = [os.path.join(root, x) for x in files if os.path.splitext(x)[1] in extensions]
r.append( (root.replace(sourcedir, destdir, 1), l) )
if 'CVS' in dirs:
dirs.remove('CVS')
return r
distutils.core.setup(
name = 'wcs',
version = "0.0.0",
@ -17,13 +29,9 @@ distutils.core.setup(
packages = ['wcs', 'wcs.admin', 'wcs.forms', 'wcs.liberty'],
cmdclass = {'build_py': qx_build_py},
scripts = ['wcs_scgi_server.py'],
data_files = [('share/wcs/web/', ( 'root/index.html',)),
('share/wcs/web/css', tuple(
glob.glob('root/css/*.css') + \
glob.glob('root/css/*.jpg') + \
glob.glob('root/css/*.png'))),
('share/wcs/web/css/img', tuple(
glob.glob('root/css/img/*.jpg') + \
glob.glob('root/css/img/*.png'))),
]
data_files = data_tree('share/wcs/web/', 'root/') + \
data_tree('share/wcs/themes/', 'data/themes/')
)
if local_cfg:
file('wcs/wcs_cfg.py', 'w').write(local_cfg)