import os

version = '160209'
out_dir = 'parades-' + version

def add_install(fname):
  out_fname = fname
  if 'udhr' in fname:
    out_fname = fname.replace('udhr/', 'example/')
    if 'README' in fname:
      out_fname = out_fname + '.example'
  node = InstallAs(os.path.join(out_dir, out_fname), fname)
  Alias('copy', node)

for fname in "parades.py paravesp.sty README".split():
  add_install(fname)
node = Install(out_dir, "doc/parades.pdf")
for fname in "README SConstruct paras.py paras.sty udhr_eng.xml udhr.pdf udhr.tex udhr.xsl".split():
  fname = os.path.join("udhr", fname)
  add_install(fname)

node = Zip(out_dir + '.zip', out_dir, ZIPFLAGS='-r')
Alias('dist', node)
