-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
87 lines (69 loc) · 2.12 KB
/
SConstruct
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
# Setup
import os
env = Environment(ENV = os.environ)
try:
env.Tool('config', toolpath = [os.environ.get('CBANG_HOME')])
except Exception as e:
raise Exception('CBANG_HOME not set?\n' + str(e))
env.CBLoadTools('compiler cbang dist build_info packager')
conf = env.CBConfigure()
# Settings
name = 'duerer'
# Version
version = '0.1.0'
major, minor, revision = version.split('.')
# Config vars
env.Replace(PACKAGE_VERSION = version)
env.Replace(BUILD_INFO_NS = 'duerer::BuildInfo')
if not env.GetOption('clean') and not 'package' in COMMAND_LINE_TARGETS:
conf.CBConfig('compiler')
conf.CBConfig('cbang')
env.CBDefine('USING_CBANG') # Using CBANG macro namespace
conf.Finish()
# Program
Export('env name')
prog, lib = \
SConscript('src/%s.scons' % name, variant_dir = 'build', duplicate = 0)
Default(prog)
# Clean
Clean(prog, ['build', 'config.log'])
# Dist
docs = ['README.md']
tar = env.TarBZ2Dist(name, docs + [prog])
Alias('dist', tar)
AlwaysBuild(tar)
description = \
'''
Image caching and resizing server and S3 proxy named after Albrecht Duerer.
'''
short_description = description
if 'package' in COMMAND_LINE_TARGETS:
pkg = env.Packager(
name,
version = version,
maintainer = 'Joseph Coffland <joseph@cauldrondevelopment.com>',
vendor = 'Buildbotics LLC',
url = 'http://buildbotics.com/',
license = 'copyright',
bug_url = 'https://github.com/buildbotics/' + name + '/issues',
summary = 'Image caching server',
description = description,
prefix = '/usr',
documents = docs,
programs = [str(prog[0])],
changelog = 'ChangeLog',
platform_independent = ['scripts/duerer.service'],
deb_directory = 'debian',
deb_section = 'science',
deb_depends = 'debconf | debconf-2.0, libc6, bzip2, zlib1g',
deb_pre_depends = 'adduser',
deb_priority = 'optional',
)
AlwaysBuild(pkg)
env.Alias('package', pkg)
f = None
try:
f = open('package-description.txt', 'w')
f.write(short_description.strip())
finally:
if f is not None: f.close()