-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwscript
52 lines (38 loc) · 1.39 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/env python
# encoding: utf-8
VERSION='1.0.0'
APPNAME='pdf_quench'
top = '.'
out = 'build'
src = 'src'
install = 'install'
def configure(conf):
pass
def build(ctx):
ctx.exec_command('mkdir -p install')
if ctx.cmd == 'install':
start_dir = ctx.path.find_dir(src)
ctx.install_files('install/debian/usr/bin',
ctx.path.ant_glob(src + '/pdf_quench.py'),
cwd=start_dir,
relative_trick=False)
start_dir = ctx.path.find_dir(top)
ctx.install_files('install',
ctx.path.ant_glob('debian/**/*'),
cwd=start_dir,
relative_trick=True)
def chmod(ctx):
print('Creating debian package ...')
ctx.exec_command('chmod -R a+rX install/debian')
ctx.exec_command(('mv install/debian/usr/bin/pdf_quench.py '
'install/debian/usr/bin/pdf_quench'))
ctx.exec_command('chmod -R a+rx install/debian/usr/bin/pdf_quench')
ctx.exec_command('chmod -R a+rx install/debian/DEBIAN/postinst')
ctx.exec_command('chmod -R a+rx install/debian/DEBIAN/postrm')
def build_debian(ctx):
print('Creating debian package ...')
ctx.exec_command('fakeroot dpkg -b install/debian .')
def debian(ctx):
import Options
commands = ['configure', 'build', 'install', 'chmod', 'build_debian']
Options.commands = commands + Options.commands