Mercurial > libervia-web
annotate setup.py @ 449:981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
- browser_side --> src/browser
- public --> src/browser_side/public
- libervia.py --> src/browser/libervia_main.py
- libervia_server --> src/server
- libervia_server/libervia.sh --> src/libervia.sh
- twisted --> src/twisted
- new module src/common
- split constants.py in 3 files:
- src/common/constants.py
- src/browser/constants.py
- src/server/constants.py
- output --> html (generated by pyjsbuild during the installation)
- new option/parameter "data_dir" (-d) to indicates the directory containing html and server_css
- setup.py installs libervia to the following paths:
- src/common --> <LIB>/libervia/common
- src/server --> <LIB>/libervia/server
- src/twisted --> <LIB>/twisted
- html --> <SHARE>/libervia/html
- server_side --> <SHARE>libervia/server_side
- LIBERVIA_INSTALL environment variable takes 2 new options with prompt confirmation:
- clean: remove previous installation directories
- purge: remove building and previous installation directories
You may need to update your sat.conf and/or launching script to update the following options/parameters:
- ssl_certificate
- data_dir
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 20 May 2014 06:41:16 +0200 |
parents | f94c3caea2ba |
children | 1a0cec9b0f1e |
rev | line source |
---|---|
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
1 #!/usr/bin/env python2 |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 # Libervia: a Salut à Toi frontend |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
5 # Copyright (C) 2011, 2012, 2013, 2014 Jérôme Poisson (goffi@goffi.org) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
6 # Copyright (C) 2013, 2014 Adrien Cossa (souliane@mailoo.org) |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
7 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
8 # This program is free software: you can redistribute it and/or modify |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 # it under the terms of the GNU Affero General Public License as published by |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 # the Free Software Foundation, either version 3 of the License, or |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 # (at your option) any later version. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
16 # GNU Affero General Public License for more details. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
17 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
18 # You should have received a copy of the GNU Affero General Public License |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
20 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
21 from distribute_setup import use_setuptools |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 use_setuptools() |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 from setuptools.command.install import install |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
24 from setuptools import setup |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 from distutils.file_util import copy_file |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
26 import os |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
27 import sys |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
28 import subprocess |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
29 from stat import ST_MODE |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
30 import shutil |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
31 from src.server.constants import Const as C |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
32 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
33 # seen here: http://stackoverflow.com/questions/7275295 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
34 try: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
35 from setuptools.command import egg_info |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
36 egg_info.write_toplevel_names |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
37 except (ImportError, AttributeError): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
38 pass |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
39 else: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
40 def _top_level_package(name): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
41 return name.split('.', 1)[0] |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
42 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
43 def _hacked_write_toplevel_names(cmd, basename, filename): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
44 pkgs = dict.fromkeys( |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
45 [_top_level_package(k) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
46 for k in cmd.distribution.iter_distribution_names() |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
47 if _top_level_package(k) != "twisted" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
48 ] |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
49 ) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
50 cmd.write_file("top-level names", filename, '\n'.join(pkgs) + '\n') |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
51 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
52 egg_info.write_toplevel_names = _hacked_write_toplevel_names |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
53 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
54 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
55 NAME = 'libervia' |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
56 LAUNCH_DAEMON_COMMAND = 'libervia' |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
57 |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
58 ENV_LIBERVIA_INSTALL = "LIBERVIA_INSTALL" # environment variable to customise installation |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
59 NO_PREINSTALL_OPT = 'nopreinstall' # skip all preinstallation checks |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
60 AUTO_DEB_OPT = 'autodeb' # automaticaly install debs |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
61 CLEAN_OPT = 'clean' # remove previous installation directories |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
62 PURGE_OPT = 'purge' # remove building and previous installation directories |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
63 |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
64 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
65 class MercurialException(Exception): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
66 pass |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
67 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
68 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
69 def module_installed(module_name): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
70 """Try to import module_name, and return False if it failed |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
71 @param module_name: name of the module to test |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
72 @return: True if successful""" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
73 try: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
74 __import__(module_name) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
75 except ImportError: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
76 return False |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
77 return True |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
78 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
79 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
80 class CustomInstall(install): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
81 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
82 def custom_auto_options(self): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
83 """Change options for twistd in the shell script |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
84 Mainly change the paths""" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
85 sh_buffer = "" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
86 run_dir = os.path.dirname(self.sh_script_path) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
87 with open(self.sh_script_path, 'r') as sh_file: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
88 for ori_line in sh_file: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
89 if ori_line.startswith('DAEMON='): |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
90 dest_line = 'DAEMON=""\n' # we want to launch libervia as a daemon |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
91 elif ori_line.startswith('DATA_DIR='): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
92 dest_line = 'DATA_DIR="%s"\n' % self.install_data_dir |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
93 elif ori_line.startswith('PYTHON='): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
94 dest_line = 'PYTHON="%s"\n' % sys.executable |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
95 else: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
96 dest_line = ori_line |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
97 sh_buffer += dest_line |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
98 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
99 with open(self.sh_script_path, 'w') as sh_file: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
100 sh_file.write(sh_buffer) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
101 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
102 def custom_create_links(self): |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
103 """Create symbolic links to executables""" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
104 # the script which launch the daemon |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
105 for source, dest in self.sh_script_links: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
106 dest = os.path.join(self.install_scripts, dest) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
107 if os.path.islink(dest) and os.readlink(dest) != source: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
108 os.remove(dest) # copy_file doesn't force the link update |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
109 dest_name, copied = copy_file(source, dest, link='sym') |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
110 assert (copied) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
111 # we change the perm in the same way as in the original install_scripts |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
112 mode = ((os.stat(dest_name)[ST_MODE]) | 0555) & 07777 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
113 os.chmod(dest_name, mode) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
114 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
115 def pyjs_build(self): |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
116 """Build the browser side JS files from Python source.""" |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
117 cwd = os.getcwd() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
118 os.chdir(os.path.join('src', 'browser')) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
119 result = subprocess.call('pyjsbuild libervia_main --no-compile-inplace -I %s -o %s' % |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
120 (self.install_lib, self.pyjamas_output_dir), shell=True) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
121 os.chdir(cwd) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
122 return result |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
123 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
124 def copy_data_files(self): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
125 """To copy the JS files couldn't be done with the data_files parameter |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
126 of setuptools.setup because all the files to be copied must exist before |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
127 the call. Also, we need the value of self.install_lib to build the JS |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
128 files (it's not easily predictable as it may vary from one system to |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
129 another), so we can't call pyjsbuild before setuptools.setup. |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
130 """ |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
131 html = os.path.join(self.install_data_dir, C.HTML_DIR) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
132 if os.path.isdir(html): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
133 shutil.rmtree(html, ignore_errors=True) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
134 shutil.copytree(self.pyjamas_output_dir, html) |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
135 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
136 def run(self): |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
137 self.sh_script_path = os.path.join(self.install_lib, NAME, 'libervia.sh') |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
138 self.sh_script_links = [(self.sh_script_path, LAUNCH_DAEMON_COMMAND)] |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
139 self.install_data_dir = os.path.join(self.install_data, 'share', NAME) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
140 self.pyjamas_output_dir = os.path.join(os.getcwd(), 'html') |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
141 sys.stdout.write('running pre installation stuff\n') |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
142 sys.stdout.flush() |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
143 if PURGE_OPT in install_opt: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
144 self.purge() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
145 elif CLEAN_OPT in install_opt: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
146 self.clean() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
147 install.run(self) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
148 sys.stdout.write('running post installation stuff\n') |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
149 sys.stdout.flush() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
150 build_result = self.pyjs_build() # build after libervia.common is accessible |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
151 if build_result == 127: # TODO: remove magic string |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
152 print "pyjsbuild is not installed or not accessible from the PATH of user '%s'" % os.getenv('USERNAME') |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
153 return |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
154 if build_result != 0: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
155 print "pyjsbuild failed to build libervia" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
156 return |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
157 self.copy_data_files() |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
158 self.custom_auto_options() |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
159 self.custom_create_links() |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
160 |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
161 def confirm(self, message): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
162 """Ask the user for a confirmation""" |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
163 message += 'Proceed' |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
164 while True: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
165 res = raw_input("%s (y/n)? " % message) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
166 if res not in ['y', 'Y', 'n', 'N']: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
167 print "Your response ('%s') was not one of the expected responses: y, n" % res |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
168 message = 'Proceed' |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
169 continue |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
170 if res in ('y', 'Y'): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
171 return True |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
172 return False |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
173 |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
174 def clean(self, message=None, to_remove=None): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
175 """Clean previous installation directories |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
176 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
177 @param message (str): to use a non-default confirmation message |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
178 @param to_remove (str): extra files/directories to remove |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
179 """ |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
180 if message is None: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
181 message = "Cleaning previous installation directories" |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
182 if to_remove is None: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
183 to_remove = [] |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
184 to_remove.extend([os.path.join(self.install_lib, NAME), |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
185 self.install_data_dir, |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
186 os.path.join(self.install_data, 'share', 'doc', NAME), |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
187 os.path.join(self.install_lib, "%s-py%s.egg-info" % (self.config_vars['dist_fullname'], self.config_vars['py_version_short'])), |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
188 ]) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
189 for source, dest in self.sh_script_links: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
190 dest = os.path.join(self.install_scripts, dest) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
191 if os.path.islink(dest): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
192 to_remove.append(dest) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
193 plugin_file = os.path.join(self.install_lib, 'twisted', 'plugins', NAME) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
194 if os.path.isfile(plugin_file): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
195 to_remove.append(plugin_file) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
196 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
197 message = "%s:\n%s\n" % (message, "\n".join([" %s" % path for path in to_remove])) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
198 if not self.confirm(message): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
199 return |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
200 sys.stdout.write('cleaning previous installation directories...\n') |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
201 sys.stdout.flush() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
202 for path in to_remove: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
203 if os.path.isdir(path): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
204 shutil.rmtree(path, ignore_errors=True) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
205 else: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
206 os.remove(path) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
207 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
208 def purge(self): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
209 """Clean building and previous installation directories""" |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
210 message = "Cleaning building and previous installation directories" |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
211 to_remove = [os.path.join(os.getcwd(), 'build'), self.pyjamas_output_dir] |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
212 self.clean(message, to_remove) |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
213 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
214 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
215 def preinstall_check(install_opt): |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
216 """Check presence of problematic dependencies, and try to install them with package manager |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
217 This ugly stuff is necessary as distributions are not installed correctly with setuptools/distribute |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
218 Hope to remove this at some point""" |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
219 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
220 modules_tocheck = [] # if empty this method is dummy |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
221 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
222 package = {'twisted': 'python-twisted-core', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
223 'twisted.words': 'python-twisted-words', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
224 'twisted.web': 'python-twisted-web', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
225 'mercurial': 'mercurial'} # this dict map dependencies to packages names for debian distributions |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
226 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
227 sys.stdout.write("Running pre-installation dependencies check\n") |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
228 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
229 # which modules are not installed ? |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
230 modules_toinstall = [mod for mod in modules_tocheck if not module_installed(mod)] |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
231 """# is mercurial available ? |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
232 hg_installed = subprocess.call('which hg', stdout=open('/dev/null', 'w'), shell=True) == 0 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
233 if not hg_installed: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
234 modules_toinstall.append('mercurial')""" # hg can be installed from pypi |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
235 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
236 if modules_toinstall: |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
237 if AUTO_DEB_OPT in install_opt: # auto debian installation is requested |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
238 # are we on a distribution using apt ? |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
239 apt_path = subprocess.Popen('which apt-get', stdout=subprocess.PIPE, shell=True).communicate()[0][:-1] |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
240 else: |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
241 apt_path = None |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
242 |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
243 not_installed = set() |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
244 if apt_path: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
245 # we have apt, we'll try to use it |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
246 for module_name in modules_toinstall: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
247 package_name = package[module_name] |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
248 sys.stdout.write("Installing %s\n" % package_name) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
249 success = subprocess.call('%s -qy install %s' % (apt_path, package_name), shell=True) == 0 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
250 if not success: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
251 not_installed.add(module_name) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
252 else: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
253 not_installed = set(modules_toinstall) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
254 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
255 if not_installed: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
256 # some packages can't be automatically installed, we print their name for manual installation |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
257 sys.stdout.write("You should install the following dependencies with your distribution recommanded tool before installing %s:\n" % NAME) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
258 for module_name in not_installed: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
259 sys.stdout.write("- %s (Debian name: %s)\n" % (module_name, package[module_name])) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
260 sys.exit(2) |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
261 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
262 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
263 if sys.argv[1].lower() in ['egg_info', 'install']: |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
264 # we only check dependencies if egg_info or install is used |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
265 install_opt = os.environ.get(ENV_LIBERVIA_INSTALL, "").split() |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
266 if not NO_PREINSTALL_OPT in install_opt: # user can force preinstall skipping |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
267 preinstall_check(install_opt) |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
268 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
269 setup(name=NAME, |
385 | 270 version='0.4.0', |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
271 description=u'Web frontend for Salut à Toi', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
272 long_description=u'Libervia is a web frontend for Salut à Toi (SàT), a multi-frontends and multi-purposes XMPP client.', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
273 author='Goffi (Jérôme Poisson)', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
274 author_email='goffi@goffi.org', |
411
a0256b81d367
setup.py: update website (it's not http://www.salut-a-toi.org), and removed pyjamas framework which is not standard in pypi
Goffi <goffi@goffi.org>
parents:
385
diff
changeset
|
275 url='http://www.salut-a-toi.org', |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
276 classifiers=['Development Status :: 3 - Alpha', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
277 'Environment :: Web Environment', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
278 'Framework :: Twisted', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
279 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
280 'Operating System :: POSIX :: Linux', |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
281 'Topic :: Communications :: Chat'], |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
282 package_dir={'libervia': 'src', 'twisted.plugins': 'src/twisted/plugins'}, |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
283 packages=['libervia', 'libervia.common', 'libervia.server', 'twisted.plugins'], |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
284 package_data={'libervia': ['libervia.sh']}, |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
285 data_files=[(os.path.join('share', 'doc', NAME), ['COPYING', 'README', 'INSTALL']), |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
286 (os.path.join('share', NAME, C.SERVER_CSS_DIR), [os.path.join(C.SERVER_CSS_DIR, filename) for filename in os.listdir(C.SERVER_CSS_DIR)]), |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
287 ], |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
288 scripts=[], |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
289 zip_safe=False, |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
290 dependency_links=['http://www.blarg.net/%7Esteveha/pyfeed-0.7.4.tar.gz', 'http://www.blarg.net/%7Esteveha/xe-0.7.4.tar.gz'], |
447
f94c3caea2ba
fixes setup dependencies for pip
souliane <souliane@mailoo.org>
parents:
419
diff
changeset
|
291 install_requires=['sat', 'twisted', 'pyfeed', 'xe', 'txJSON-RPC', 'zope.interface', 'pyopenssl'], |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
292 cmdclass={'install': CustomInstall}, |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
293 ) |