-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSConscript
66 lines (56 loc) · 2.23 KB
/
SConscript
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
# -*- python -*-
# build top level files
# this is a SConscript, too, to support really build-dirs
Import('env', 'is_dist')
cronfile = env.FileSubst('capisuite.cron', 'capisuite.cronin')
rcfile = env.FileSubst('rc.capisuite', 'rc.capisuite.in')
env.AddPostAction([cronfile, rcfile], Chmod('$TARGETS', 0755))
env.Alias('install', [
env.Install('$docdir', Split('COPYING NEWS README AUTHORS')),
])
# Since these are not installed, we need to list explicitly
# them for distribuition
env.DistSourcesOf([cronfile, rcfile])
env.ExtraDist('cronjob.conf')
#--- a simple 'Echo' action with nice output ---
import SCons, os
def echo_func(file, text):
open(file, 'a').writelines([text, os.linesep])
def echo_str(file, text):
return 'Echo("%s", %s)' % (file, repr(text))
Echo = SCons.Action.ActionFactory(echo_func, echo_str)
#--- build Changelog ---
changelog_header = """
# This file is automatically generated from the Subversion log for
# the current branch (i.e. the branch which was used for this
# release). Only changes starting from 2005-01-01 are listed here.
#
# ChangeLog.complete lists all changes in all branches if needed
# for reference.
"""
cl = File('#/ChangeLog')
env.ExtraDist(cl)
if is_dist or 'ChangeLog' in COMMAND_LINE_TARGETS:
cl = env.Command(cl, None,
[Echo('$TARGET', changelog_header),
Echo('$TARGET', ''),
# need to set locale to set correct character encoding
'LANG=de_DE svn log -v -r "HEAD:{2005-01-01}" >> $TARGET'
])[0]
env.AlwaysBuild(cl)
changelog_complete_header = """
# This file is automatically generated from the Subversion
# repository. It contains all changes in all development branches
# and is only meant for reference purposes. If you want to see the
# changes which lead to this release, please refer to the ChangeLog
"""
cl = File('#/ChangeLog.complete')
env.ExtraDist(cl)
if is_dist or 'ChangeLog' in COMMAND_LINE_TARGETS:
cl = env.Command(cl, None,
[Echo('$TARGET', changelog_complete_header),
Echo('$TARGET', ''),
# need to set locale to set correct character encoding
'LANG=de_DE svn log -v $SVNREPOSITORY >> $TARGET'
])[0]
env.AlwaysBuild(cl)