~romaia/stoq/create-production

299 by evandro
updating file encoding
1
# -*- coding: utf-8 -*-
253 by evandro
Fixing setup.py
2
# vi:si:et:sw=4:sts=4:ts=4
3
4
##
3572 by jdahlin at com
First pass as updating post-merge
5
## Copyright (C) 2005-2011 Async Open Source
253 by evandro
Fixing setup.py
6
##
7
## This program is free software; you can redistribute it and/or
8
## modify it under the terms of the GNU Lesser General Public License
9
## as published by the Free Software Foundation; either version 2
10
## of the License, or (at your option) any later version.
11
##
12
## This program is distributed in the hope that it will be useful,
13
## but WITHOUT ANY WARRANTY; without even the implied warranty of
14
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
## GNU Lesser General Public License for more details.
16
##
17
## You should have received a copy of the GNU Lesser General Public License
18
## along with this program; if not, write to the Free Software
439 by evandro
Updating licences since the FSF address has been changed
19
## Foundation, Inc., or visit: http://www.gnu.org/.
253 by evandro
Fixing setup.py
20
##
21
##
3306 by jdahlin at com
Remove individual authors
22
## Author(s): Stoq Team <stoq-devel@async.com.br>
253 by evandro
Fixing setup.py
23
##
415 by evandro
Improving dependency checking
24
25
#
26
# Dependency checking
27
#
28
3646 by jdahlin at com
Reduce build time dependencies, check for a lot less
29
from stoq.lib.dependencies import DependencyChecker
30
dc = DependencyChecker()
31
dc.text_mode = True
32
# We don't need latest kiwi in here
33
dc.check_kiwi([1, 9, 26])
411 by evandro
Adding a dependencies check and updating setup informations
34
35
#
36
# Package installation
37
#
38
442 by jdahlin
use kiwi.dist.setup
39
from kiwi.dist import setup, listfiles, listpackages
253 by evandro
Fixing setup.py
40
3646 by jdahlin at com
Reduce build time dependencies, check for a lot less
41
from stoq import website, version
99 by jdahlin
Use kiwi.environ.Library and distutils helpers in kiwi.dist
42
1064 by jdahlin
Add an external directory with formencode and SQLObject forks, remove SQLObject dependency from documentation and setup.py. Install externals and set sys.path in stoqlib/__init__.py
43
def listexternal():
44
    dirs = []
45
    for package in listpackages('external'):
46
        # strip external
47
        dirs.append(package.replace('.', '/'))
48
    files = []
49
    for directory in dirs:
50
        files.append(('lib/stoqlib/' + directory[9:],
51
                      listfiles(directory, '*.py')))
52
    return files
53
3578 by jdahlin at com
Simplify plugin installation
54
def listplugins(plugins, exts):
2314 by jdahlin
Install ECF plugin & update setup.py's stoqlib description
55
    dirs = []
56
    for package in listpackages('plugins'):
57
        # strip plugins
58
        dirs.append(package.replace('.', '/'))
59
    files = []
60
    for directory in dirs:
2486 by jdahlin
Do not include plugins two times
61
        install_dir = 'lib/stoqlib/%s' % directory
2484 by jdahlin
Create a new directory for each plugin in /lib/stoqlib/plugins
62
        files.append((install_dir, listfiles(directory, '*.py')))
63
        files.append((install_dir, listfiles(directory, '*.plugin')))
3578 by jdahlin at com
Simplify plugin installation
64
65
    for plugin in plugins:
66
        for kind, suffix in exts:
67
            x = listfiles('plugins', plugin, kind, suffix)
68
            if x:
69
                path = '$prefix/lib/stoqlib/plugins/%s/%s'
70
                files.append((path % (plugin, kind), x))
71
72
        files.append(('$prefix/lib/stoqlib/plugins/' +  plugin,
73
                      listfiles('plugins', plugin, '*.py')))
74
2314 by jdahlin
Install ECF plugin & update setup.py's stoqlib description
75
    return files
76
3576 by jdahlin at com
Install everything from stoqlib/ too
77
packages = listpackages('stoq')
78
packages.extend(listpackages('stoqlib', exclude='stoqlib.tests'))
79
3572 by jdahlin at com
First pass as updating post-merge
80
scripts = [
81
    'bin/stoq',
3933 by johan at gnome
Simply database creation script
82
    'bin/stoqcreatedbuser',
3572 by jdahlin at com
First pass as updating post-merge
83
    'bin/stoqdbadmin',
84
    'bin/stoqruncmd',
85
    ]
442 by jdahlin
use kiwi.dist.setup
86
data_files = [
3572 by jdahlin at com
First pass as updating post-merge
87
    ('$datadir/csv', listfiles('data', 'csv', '*.csv')),
88
    ('$datadir/glade', listfiles('data', 'glade', '*.ui')),
89
    ('$datadir/fonts', listfiles('data', 'fonts', '*.ttf')),
90
    ('$datadir/misc', listfiles('data/misc', '*.*')),
655 by jdahlin
Move glade files to data/glade
91
    ('$datadir/pixmaps', listfiles('data', 'pixmaps', '*.png')),
3738 by Ronaldo Maia
Improve stoq logo and convert it to svg
92
    ('$datadir/pixmaps', listfiles('data', 'pixmaps', '*.svg')),
655 by jdahlin
Move glade files to data/glade
93
    ('$datadir/sql', listfiles('data', 'sql', '*.sql')),
2347 by jdahlin
Add support for python patches, rewrite patch 20 as a python patch, since DROP VIEW IF EXISTS was introduced in Postgres 8.2
94
    ('$datadir/sql', listfiles('data', 'sql', '*.py')),
2147 by george
#3152: Impressão de recibo para pagamentos em carteira. r=jdahlin
95
    ('$datadir/template', listfiles('data', 'template', '*.rml')),
4053 by Ronaldo Maia
Add html files to setup.py
96
    ('$datadir/html', listfiles('data', 'html', '*.html')),
97
    ('$datadir/html', listfiles('data', 'html', '*.css')),
98
    ('$datadir/html', listfiles('data', 'html', '*.png')),
3572 by jdahlin at com
First pass as updating post-merge
99
    ('$sysconfdir/stoq',  ''),
100
    ('share/doc/stoq',
4089 by Johan Dahlin
Install COPYING.pt_BR
101
     ('AUTHORS', 'CONTRIBUTORS', 'COPYING', 'COPYING.pt_BR', 'COPYING.stoqlib', 'README')),
3897 by jdahlin at com
Install a policy-kit policy
102
    ('share/icons/hicolor/48x48/apps', ['data/pixmaps/stoq.png']),
103
    ('share/polkit-1/actions', ['data/br.com.stoq.createdatabase.policy']),
104
    ]
1064 by jdahlin
Add an external directory with formencode and SQLObject forks, remove SQLObject dependency from documentation and setup.py. Install externals and set sys.path in stoqlib/__init__.py
105
data_files += listexternal()
3572 by jdahlin at com
First pass as updating post-merge
106
templates = [
107
    ('share/applications', ['stoq.desktop'])]
3338 by Ronaldo Maia
Include pyboleto bank logos
108
109
# Pyboleto bank logos
110
data_files += [
111
    ('lib/stoqlib/pyboleto/media',
112
     listfiles('external', 'pyboleto', 'media', '*.jpg')),
113
    ('lib/stoqlib/pyboleto/media',
114
     listfiles('external', 'pyboleto', 'media', '*.gif')),
115
    ]
116
442 by jdahlin
use kiwi.dist.setup
117
resources = dict(
2319 by jdahlin
0.9.1
118
    locale='$prefix/share/locale',
119
    plugin='$prefix/lib/stoqlib/plugins',
120
    )
442 by jdahlin
use kiwi.dist.setup
121
global_resources = dict(
3572 by jdahlin at com
First pass as updating post-merge
122
    config='$sysconfdir/stoq',
123
    csv='$datadir/csv',
124
    docs='$prefix/share/doc/stoq',
125
    fonts='$datadir/fonts',
126
    glade='$datadir/glade',
4056 by Johan Dahlin
Add html to resources
127
    html='$datadir/html',
3572 by jdahlin at com
First pass as updating post-merge
128
    misc='$datadir/misc',
442 by jdahlin
use kiwi.dist.setup
129
    pixmaps='$datadir/pixmaps',
130
    sql='$datadir/sql',
2314 by jdahlin
Install ECF plugin & update setup.py's stoqlib description
131
    template='$datadir/template',
132
    )
133
3578 by jdahlin at com
Simplify plugin installation
134
PLUGINS = ['ecf', 'nfe', 'books']
135
PLUGIN_EXTS = [('csv', '*csv'),
136
               ('glade', '*.ui'),
137
               ('sql', '*.sql'),
138
               ('sql', '*.py')]
139
140
data_files += listplugins(PLUGINS, PLUGIN_EXTS)
3178.1.4 by georgeyk
Add books plugin resources.
141
3572 by jdahlin at com
First pass as updating post-merge
142
setup(name='stoq',
411 by evandro
Adding a dependencies check and updating setup informations
143
      version=version,
45 by jdahlin
Add distutils, update svn:ignore. Add COPYING and AUTHORS
144
      author="Async Open Source",
411 by evandro
Adding a dependencies check and updating setup informations
145
      author_email="stoq-devel@async.com.br",
3572 by jdahlin at com
First pass as updating post-merge
146
      description="A powerful retail system",
411 by evandro
Adding a dependencies check and updating setup informations
147
      long_description="""
3572 by jdahlin at com
First pass as updating post-merge
148
      Stoq is an advanced retails system which has as main goals the
149
      usability, good devices support, and useful features for retails.
442 by jdahlin
use kiwi.dist.setup
150
      """,
411 by evandro
Adding a dependencies check and updating setup informations
151
      url=website,
4057 by Johan Dahlin
Update license
152
      license="GNU GPL 2.0 and GNU LGPL 2.1 (see COPYING and COPYING.stoqlib)",
3576 by jdahlin at com
Install everything from stoqlib/ too
153
      packages=packages,
442 by jdahlin
use kiwi.dist.setup
154
      data_files=data_files,
3572 by jdahlin at com
First pass as updating post-merge
155
      scripts=scripts,
442 by jdahlin
use kiwi.dist.setup
156
      resources=resources,
157
      global_resources=global_resources,
3646 by jdahlin at com
Reduce build time dependencies, check for a lot less
158
      templates=templates)