Merge branch 'master' into content-rework-take5
[dcpomatic.git] / cscript
1 import glob
2
3 releases = ['ubuntu-12.04-32', 'ubuntu-12.10-32', 'ubuntu-12.04-64', 'ubuntu-12.10-64', 'source', 'windows-32', 'windows-64']
4
5 def release(environment, variant, version):
6     if environment == 'windows':
7         command('./waf configure --target-windows')
8         command('./waf clean')
9         command('./waf')
10         shutil.copyfile('build/windows/installer.%s.nsi' % variant, 'build/windows/installer2.%s.nsi' % variant)
11         command('sed -i "s~%%resources%%~%s/windows~g" build/windows/installer2.%s.nsi' % (os.getcwd(), variant))
12         command('sed -i "s~%%deps%%~$WINDOWS_PREFIX~g" build/windows/installer2.%s.nsi' % variant)
13         command('sed -i "s~%%binaries%%~%s/build~g" build/windows/installer2.%s.nsi' % (os.getcwd(), variant))
14         command('sed -i "s~%%bits%%~32~g" build/windows/installer2.%s.nsi' % variant)
15         command('makensis build/windows/installer2.%s.nsi' % variant)
16         return glob.glob('build/windows/*%s*.exe' % variant)[0]
17     elif environment == 'ubuntu':
18         v = variant.split('-')
19         bits = v[1]
20         if bits == '32':
21             cpu = 'i386'
22         else:
23             cpu = 'amd64'
24
25         shutil.copyfile(os.path.join('builds', 'control-%s' % variant), os.path.join('debian', 'control'))
26         command('./waf dist')
27         f = open(os.path.join('debian', 'files'), 'w')
28         print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu)
29         shutil.rmtree('build/deb', ignore_errors=True)
30         os.makedirs('build/deb')
31         os.chdir('build/deb')
32         shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version)
33         command('tar xjf dcpomatic_%s.orig.tar.bz2' % version)
34         os.chdir('dcpomatic-%s' % version)
35         command('dch -b -v %s-1 "New upstream release."' % version)
36         command('dpkg-source -b .')
37         command('dpkg-buildpackage')
38         return os.path.abspath(glob.glob('../*.deb')[0])
39
40 def make_pot():
41     command('./waf pot')
42     return [os.path.abspath('build/src/lib/libdcpomatic.pot'),
43             os.path.abspath('build/src/wx/libdcpomatic-wx.pot'),
44             os.path.abspath('build/src/tools/dcpomatic.pot')]
45
46 def make_manual():
47     os.chdir('doc/manual')
48     command('make')
49     return [os.path.abspath('pdf'), os.path.abspath('html')]