43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
#! /usr/bin/env python
|
|
|
|
import os
|
|
import distutils.core
|
|
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', '.gif', '.xml', '.html', '.js', '.ezt']
|
|
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) )
|
|
for vcs_dirname in ('CVS', '.svn', '.bzr', '.git'):
|
|
if vcs_dirname in dirs:
|
|
dirs.remove(vcs_dirname)
|
|
return r
|
|
|
|
distutils.core.setup(
|
|
name = 'wcs',
|
|
version = "1.0",
|
|
maintainer = "Frederic Peters",
|
|
maintainer_email = "fpeters@entrouvert.com",
|
|
url = "http://wcs.labs.libre-entreprise.org",
|
|
package_dir = { 'wcs': 'wcs' },
|
|
packages = ['wcs', 'wcs.admin', 'wcs.backoffice', 'wcs.ctl',
|
|
'wcs.ctl.Bouncers', 'wcs.forms', 'wcs.wf', 'wcs.qommon',
|
|
'wcs.qommon.admin', 'wcs.qommon.backoffice', 'wcs.qommon.ident',
|
|
'wcs.qommon.vendor'],
|
|
cmdclass = {'build_py': qx_build_py},
|
|
scripts = ['wcsctl.py'],
|
|
data_files = data_tree('share/wcs/web/', 'root/') + \
|
|
data_tree('share/wcs/themes/', 'data/themes/') + \
|
|
data_tree('share/wcs/qommon/', 'wcs/qommon/static/')
|
|
)
|
|
|
|
if local_cfg:
|
|
file('wcs/wcs_cfg.py', 'w').write(local_cfg)
|