3 # Setup script for myslice+unfold
5 # Thierry Parmentelat <thierry.parmentelat@inria.fr>
11 from distutils.core import setup
13 # we don't have a final list so let's keep it simple for now
14 packages= [ os.path.dirname(init) for init in (glob("*/__init__.py")+glob("*/*/__init__.py")) ]
16 # Avoid troubles : clean /usr/share/unfold/
17 #shutil.rmtree('/usr/share/unfold/')
20 return glob( dir+"/*.png") + glob ( dir+"/*.gif")
22 return glob( dir+"/*.js")
23 def stylesheets (dir):
24 return glob( dir+"/*.css")
26 # looks like data_files requires actual files and cannot cope with
27 # a whole subdir like we have for fonts
28 # returns a list of tuples suitable to add to data_files
29 from operator import add
31 def scan_fonts (install_topdir, topdir, extensions):
32 def subdir_tuples (subdir, extensions):
33 return [ (install_topdir+subdir, glob (subdir+"/*.%s"%extension), )
34 for extension in extensions
35 if glob(subdir+"/*.%s"%extension)
38 return [x[0] for x in os.walk(topdir)]
39 return reduce (add, [ subdir_tuples (subdir, extensions) for subdir in subdirs(topdir) ] )
41 fonts_tuples = scan_fonts ('/usr/share/unfold/static/fonts',
43 ('otf','eot','svg','ttf','woff'))
45 setup(packages = packages,
46 # xxx somehow this does not seem to show up in debian packaging
47 scripts = [ 'apache/unfold-init-ssl.sh' ],
49 ( '/usr/share/unfold/static/js', javascript('static/js')),
50 ( '/usr/share/unfold/static/css', stylesheets ('static/css')),
51 ( '/usr/share/unfold/static/img', images ('static/img')),
53 ( '/usr/share/unfold/static/img/institutions', images ('static/img/institutions')),
54 ( '/usr/share/unfold/static/img/testbeds', images ('static/img/testbeds')),
55 ( '/usr/share/unfold/templates', glob ('templates/*')),
56 ( 'apache', [ 'apache/unfold.conf', 'apache/unfold-ssl.conf', 'apache/unfold.wsgi' ]),
57 ( '/etc/unfold/trusted_roots', []),