~ubuntu-branches/debian/sid/groundcontrol/sid

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Bazaar Package Importer
  • Author(s): Luke Faraone
  • Date: 2010-02-07 18:26:54 UTC
  • Revision ID: james.westby@ubuntu.com-20100207182654-u0n26lkazgfog4et
Tags: upstream-1.5
ImportĀ upstreamĀ versionĀ 1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
# Copyright (C) 2009 Martin Owens
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; either version 3 of the License, or
 
8
# (at your option) any later version.
 
9
#
 
10
# This program is distributed in the hope that it will be useful,
 
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
# GNU General Public License for more details.
 
14
#
 
15
# You should have received a copy of the GNU General Public License
 
16
# along with this program; if not, write to the Free Software
 
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
#
 
19
 
 
20
from GroundControl import __appname__, __version__
 
21
from distutils.core import setup
 
22
from distutils.command.install_lib  import install_lib
 
23
from DistUtilsExtra.command import *
 
24
from fnmatch import fnmatch
 
25
 
 
26
import os, platform
 
27
 
 
28
MODULE = 'GroundControl'
 
29
 
 
30
# remove MANIFEST. distutils doesn't properly update it
 
31
# when the contents of directories change.
 
32
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
 
33
 
 
34
if platform.system() == 'FreeBSD':
 
35
        man_dir = 'man'
 
36
else:
 
37
        man_dir = 'share/man'
 
38
 
 
39
TOP_BUILDDIR='.'
 
40
INTLTOOL_MERGE='intltool-merge'
 
41
desktop_in='groundcontrol.desktop.in'
 
42
desktop_data='groundcontrol.desktop'
 
43
 
 
44
class groundcontrol_build_i18n(build_i18n.build_i18n):
 
45
    def run(self):
 
46
         build_i18n.build_i18n.run(self)
 
47
         # Build the desktop file
 
48
         os.system ("C_ALL=C " + INTLTOOL_MERGE + " -d -u -c " + TOP_BUILDDIR +
 
49
             "/po/.intltool-merge-cache " + TOP_BUILDDIR + "/po " +
 
50
             desktop_in + " " + desktop_data)
 
51
 
 
52
def listfiles(*dirs):
 
53
        dir, pattern = os.path.split(os.path.join(*dirs))
 
54
        return [os.path.join(dir, filename)
 
55
                for filename in os.listdir(os.path.abspath(dir))
 
56
                        if filename[0] != '.' and fnmatch(filename, pattern)]
 
57
 
 
58
# Generate a standard share dir
 
59
SDIR = 'share/%s/' % __appname__
 
60
 
 
61
setup(
 
62
        name             = __appname__,
 
63
        version          = __version__,
 
64
        description      = 'Ground Control - Launchpad Desktop Integration',
 
65
        long_description = "Integrates the Launchpad service stack with the desktop.",
 
66
        author           = 'Martin Owens',
 
67
        author_email     = 'doctormo@ubuntu.com',
 
68
        url              = 'https://code.launchpad.net/groundcontrol',
 
69
        platforms        = 'linux',
 
70
        license          = 'GPLv3',
 
71
        packages         = [ MODULE ],
 
72
        scripts          = listfiles( 'bin', 'lp-*' ),
 
73
        data_files       = [
 
74
            ( SDIR, listfiles( 'bin', '*.py' ) ),
 
75
            ( SDIR + 'glade', listfiles( 'glade', '*.glade' ) ),
 
76
            ( SDIR + 'pixmaps', listfiles( 'pixmaps', '*.svg' ) ),
 
77
            ( SDIR + 'pixmaps/chicons', listfiles( 'pixmaps/chicons', '*.svg' ) ),
 
78
            ( SDIR + 'pixmaps/status', listfiles( 'pixmaps/status', '*.svg' ) ),
 
79
            ( SDIR + 'pixmaps/person', listfiles( 'pixmaps/person', '*.svg' ) ),
 
80
            ( SDIR + 'pixmaps/project', listfiles( 'pixmaps/project', '*.svg' ) ),
 
81
            ( SDIR + 'pixmaps/bugs', listfiles( 'pixmaps/bugs', '*.svg' ) ),
 
82
            ( SDIR + 'pixmaps/animation', listfiles( 'pixmaps/animation', '*.svg' ) ),
 
83
            ( 'lib/nautilus/extensions-2.0/python/',  [ 'nautilus-groundcontrol.py' ] ),
 
84
            ( 'share/applications/', [ 'groundcontrol.desktop' ] ),
 
85
            ( 'share/pixmaps/', [ 'pixmaps/groundcontrol.svg' ] ),
 
86
            ( os.path.join(man_dir, 'man1'),  listfiles( 'doc',     '*.1' ) ),
 
87
        ],
 
88
        cmdclass={
 
89
                   'build'       : build_extra.build_extra,
 
90
                   'build_i18n'  : groundcontrol_build_i18n,
 
91
                 },
 
92
    )
 
93