Mercurial > libervia-backend
annotate setup.py @ 230:b25cbec73c1e
distutils: removes build and dist from manifest's prune
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 06 Jan 2011 18:09:00 +0100 |
parents | 533507bb4e32 |
children | 0cd5b3c4513f |
rev | line source |
---|---|
225 | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | |
3 | |
230
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
4 from distribute_setup import use_setuptools |
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
5 use_setuptools() |
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
6 from setuptools.command.install import install |
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
7 from setuptools import setup |
225 | 8 from distutils.file_util import copy_file |
9 import os,sys,subprocess | |
10 from stat import ST_MODE | |
11 from glob import glob | |
12 | |
13 NAME = 'sat' | |
14 LAUNCH_DAEMON_COMMAND = 'sat' | |
15 | |
16 | |
17 class custom_install(install): | |
18 | |
19 def custom_auto_options(self): | |
20 """Change options for twistd in the shell script | |
21 Mainly change the paths""" | |
22 sh_buffer = "" | |
23 run_dir = os.path.dirname(self.sh_script_path) | |
24 with open(self.sh_script_path,'r') as sh_file: | |
25 for ori_line in sh_file: | |
26 if ori_line.startswith('DAEMON='): | |
27 dest_line = 'DAEMON=""\n' #we want to launch sat as a daemon | |
28 elif ori_line.startswith('TAP_PATH='): | |
29 dest_line = 'TAP_PATH="%s/"\n' % run_dir | |
30 else: | |
31 dest_line = ori_line | |
32 sh_buffer += dest_line | |
33 | |
34 with open(self.sh_script_path,'w') as sh_file: | |
35 sh_file.write(sh_buffer) | |
36 | |
37 | |
38 def custom_create_links(self): | |
39 """Create symbolic links to executables""" | |
40 #the script which launch the daemon | |
41 links = [(self.sh_script_path,LAUNCH_DAEMON_COMMAND),] | |
42 for source,dest in links: | |
43 dest_name, copied = copy_file(source, os.path.join(self.install_scripts, dest), link='sym') | |
44 assert (copied) | |
45 #we change the perm in the same way as in the original install_scripts | |
46 mode = ((os.stat(dest_name)[ST_MODE]) | 0555) & 07777 | |
47 os.chmod(dest_name, mode) | |
48 | |
49 def run(self): | |
50 install.run(self) | |
51 print ('running post installation stuff') | |
52 self.sh_script_path = os.path.join(self.install_lib,'sat','sat.sh') | |
53 self.primitivus_path = os.path.join(self.install_lib,'sat_frontends','primitivus') | |
54 self.custom_auto_options() | |
55 self.custom_create_links() | |
56 | |
57 | |
58 | |
59 setup(name=NAME, | |
60 version='0.1.0', | |
61 description=u'Salut à Toi multi-frontend XMPP client', | |
62 long_description=u'Salut à Toi (SàT) is a XMPP client based on a daemon/frontend architecture. You can use it with the desktop frontend (wix - WxPython based), console ui frontend (Primitivus, Urwid based), or command line frontend (jp), and others are coming. ', | |
63 author='Goffi (Jérôme Poisson)', | |
64 author_email='goffi@goffi.org', | |
65 url='http://wiki.goffi.org/wiki/Salut_%C3%A0_Toi', | |
66 classifiers=['Development Status :: 3 - Alpha', | |
67 'Environment :: Console', | |
68 'Environment :: X11 Applications :: GTK', | |
69 'Framework :: Twisted', | |
70 'License :: OSI Approved :: GNU General Public License (GPL)', | |
71 'Operating System :: POSIX :: Linux', | |
72 'Topic :: Communications :: Chat'], | |
73 package_dir = {'sat':'src', 'sat_frontends':'frontends/src'}, | |
74 packages=['sat','sat.tools','sat.bridge', 'sat.plugins', | |
75 'sat_frontends', 'sat_frontends.bridge', 'sat_frontends.quick_frontend', | |
227 | 76 'sat_frontends.primitivus', 'sat_frontends.wix'], |
77 package_data = {'sat': ['sat.tac','sat.sh'], | |
78 'sat_frontends': ['wix/COPYING','wix/images/*png','wix/images/cards/*','wix/images/crystal/*']}, | |
225 | 79 data_files=[(os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['i18n/fr/LC_MESSAGES/sat.mo']), |
80 (os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['frontends/i18n/fr/LC_MESSAGES/sat_frontend.mo']), | |
81 (os.path.join(sys.prefix,'share/locale/fr/LC_MESSAGES'), ['frontends/src/jp/i18n/fr/LC_MESSAGES/jp.mo']), | |
227 | 82 ('share/doc/%s' % NAME, ['CHANGELOG', 'COPYING', 'INSTALL', 'README', 'README4TRANSLATORS']), |
83 ('share/doc/%s/misc' % NAME, ['frontends/src/wix/images/split_card.sh']), | |
84 ], | |
85 scripts=['frontends/src/jp/jp', 'frontends/src/primitivus/primitivus', 'frontends/src/wix/wix'], | |
230
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
86 zip_safe=False, |
b25cbec73c1e
distutils: removes build and dist from manifest's prune
Goffi <goffi@goffi.org>
parents:
227
diff
changeset
|
87 install_requires=['twisted', 'progressbar', 'wxPython', 'urwid', 'BeautifulSoup'], |
225 | 88 cmdclass=dict(install=custom_install), |
89 ) | |
90 |