|
1 #!/usr/bin/env python |
|
2 # pylint: disable-msg=W0404,W0622,W0704,W0613,W0152 |
|
3 # Copyright (c) 2003-2004 LOGILAB S.A. (Paris, FRANCE). |
|
4 # http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
5 # |
|
6 # This program is free software; you can redistribute it and/or modify it under |
|
7 # the terms of the GNU General Public License as published by the Free Software |
|
8 # Foundation; either version 2 of the License, or (at your option) any later |
|
9 # version. |
|
10 # |
|
11 # This program is distributed in the hope that it will be useful, but WITHOUT |
|
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
13 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License along with |
|
16 # this program; if not, write to the Free Software Foundation, Inc., |
|
17 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
18 """ Generic Setup script, takes package info from __pkginfo__.py file """ |
|
19 |
|
20 import os |
|
21 import sys |
|
22 import shutil |
|
23 from distutils.core import setup |
|
24 from distutils import command |
|
25 from distutils.command import install_lib |
|
26 from os.path import isdir, exists, join, walk |
|
27 |
|
28 # import required features |
|
29 from __pkginfo__ import distname, version, license, short_desc, long_desc, \ |
|
30 web, author, author_email |
|
31 try: |
|
32 from __pkginfo__ import scripts |
|
33 except ImportError: |
|
34 scripts = [] |
|
35 try: |
|
36 from __pkginfo__ import data_files |
|
37 except ImportError: |
|
38 data_files = None |
|
39 |
|
40 def ensure_scripts(linux_scripts): |
|
41 """creates the proper script names required for each platform |
|
42 (taken from 4Suite) |
|
43 """ |
|
44 from distutils import util |
|
45 if util.get_platform()[:3] == 'win': |
|
46 scripts_ = [script + '.bat' for script in linux_scripts] |
|
47 else: |
|
48 scripts_ = linux_scripts |
|
49 return scripts_ |
|
50 |
|
51 def install(**kwargs): |
|
52 """setup entry point""" |
|
53 return setup(name=distname, |
|
54 version=version, |
|
55 license =license, |
|
56 description=short_desc, |
|
57 long_description=long_desc, |
|
58 author=author, |
|
59 author_email=author_email, |
|
60 url=web, |
|
61 scripts=ensure_scripts(scripts), |
|
62 data_files=data_files, |
|
63 **kwargs) |
|
64 |
|
65 if __name__ == '__main__' : |
|
66 install() |