2
# setup.py - Build system for Ubuntu One Control Panel package
4
# Author: Natalia B. Bidart <natalia.bidart@canonical.com>
6
# Copyright 2010 Canonical Ltd.
8
# This program is free software: you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License version 3, as published
10
# by the Free Software Foundation.
12
# This program is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranties of
14
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15
# PURPOSE. See the GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License along
18
# with this program. If not, see <http://www.gnu.org/licenses/>.
19
"""Setup.py: build, distribute, clean."""
25
import DistUtilsExtra.auto
26
from DistUtilsExtra.command import build_extra
28
print >> sys.stderr, 'To build this program you need '\
29
'https://launchpad.net/python-distutils-extra'
31
assert DistUtilsExtra.auto.__version__ >= '2.18', \
32
'needs DistUtilsExtra.auto >= 2.18'
34
from distutils.core import setup
35
from distutils.spawn import find_executable
36
from distutils.command import clean, build
38
POT_FILE = 'po/ubuntuone-control-panel.pot'
39
SERVICE_NAME = 'com.ubuntuone.controlpanel'
40
SERVICE_FILE = 'data/%s.service' % SERVICE_NAME
41
SERVICE_CONTENT = """[D-BUS Service]
43
Exec=/usr/lib/ubuntuone-control-panel-backend
46
CLEANFILES = [SERVICE_FILE, POT_FILE]
49
class ControlPanelBuild(build_extra.build_extra):
50
"""Class to build the extra files."""
52
description = 'build extra files needed by ubuntuone-control-panel'
57
with open(SERVICE_FILE, 'w') as out_file:
58
out_file.write(SERVICE_CONTENT)
60
# Run the parent build command
61
build_extra.build_extra.run(self)
64
class ControlPanelClean(clean.clean):
65
"""Class to clean up after the build."""
67
description = 'Clean up built files.'
70
"""Clean up the built files."""
71
for built_file in CLEANFILES:
72
if os.path.exists(built_file):
75
# Run the parent clean command
79
DistUtilsExtra.auto.setup(
80
name='ubuntuone-control-panel',
83
author='Natalia Bidart',
84
author_email='natalia.bidart@canonical.com',
85
description='Ubuntu One Control Panel',
86
long_description='Desktop application to manage a Ubuntu One account',
87
url='https://launchpad.net/ubuntuone-control-panel',
88
packages=['ubuntuone.controlpanel'],
90
('share/dbus-1/services', ['data/com.ubuntuone.controlpanel.service']),
91
('lib/ubuntuone-client', ['bin/ubuntuone-control-panel',
92
'bin/ubuntuone-control-panel-backend']),
93
('share/ubuntuone-client/data', ['data/*.ui'])],
95
'build' : ControlPanelBuild,
96
'clean' : ControlPanelClean})