forked from projecthamster/hamster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
93 lines (69 loc) · 2.89 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- python -*-
VERSION = '2.0'
APPNAME = 'hamster-time-tracker'
top = '.'
out = 'build'
import intltool, gnome
import os
def configure(conf):
conf.check_tool('python')
conf.check_tool('misc')
conf.check_python_version((2,4,2))
conf.check_tool('gnome intltool dbus')
conf.define('ENABLE_NLS', 1)
conf.define('HAVE_BIND_TEXTDOMAIN_CODESET', 1)
conf.define('VERSION', VERSION)
conf.define('GETTEXT_PACKAGE', "hamster-time-tracker")
conf.define('PACKAGE', "hamster-time-tracker")
conf.define('PYEXECDIR', conf.env["PYTHONDIR"]) # i don't know the difference
# avoid case when we want to install globally (prefix=/usr) but sysconfdir
# was not specified
if conf.env['SYSCONFDIR'] == '/usr/etc':
conf.define('SYSCONFDIR', '/etc')
else:
conf.define('SYSCONFDIR', conf.env['SYSCONFDIR'])
conf.define('prefix', conf.env["PREFIX"]) # to keep compatibility for now
conf.sub_config("help")
def set_options(opt):
# options for disabling pyc or pyo compilation
opt.tool_options("python")
opt.tool_options("misc")
opt.tool_options("gnu_dirs")
def build(bld):
bld.install_files('${LIBDIR}/hamster-time-tracker',
"""src/hamster-service
src/hamster-windows-service
""",
chmod = 0755)
bld.install_as('${BINDIR}/hamster', "src/hamster-cli", chmod = 0755)
bld.install_files('${SYSCONFDIR}/bash_completion.d','src/hamster.bash')
# set correct flags in defs.py
bld.new_task_gen("subst",
source= "src/hamster/defs.py.in",
target= "src/hamster/defs.py",
install_path="${PYTHONDIR}/hamster",
dict = bld.env
)
bld.install_files('${PYTHONDIR}/hamster', 'src/hamster/*.py')
for folder in ("lib", "storage", "widgets"):
bld.install_files('${PYTHONDIR}/hamster/%s' % folder,
'src/hamster/%s/*.py' % folder)
bld.new_task_gen("subst",
source= "org.gnome.hamster.service.in",
target= "org.gnome.hamster.service",
install_path="${DATADIR}/dbus-1/services",
dict = bld.env
)
bld.new_task_gen("subst",
source= "org.gnome.hamster.Windows.service.in",
target= "org.gnome.hamster.Windows.service",
install_path="${DATADIR}/dbus-1/services",
dict = bld.env
)
bld.add_subdirs("po help data")
def post(ctx):
# Postinstall tasks:
# gnome.postinstall_scrollkeeper('hamster-time-tracker') # Installing the user docs
gnome.postinstall_schemas('hamster-time-tracker') # Installing GConf schemas
gnome.postinstall_icons() # Updating the icon cache
bld.add_post_fun(post)