Cope with $PATH not being set.
[zeroinstall/zeroinstall-mseaborn.git] / setup.py
blob1526da9f45b5f687680d3ecb9f9cad6c93e1948c
1 from distutils.core import setup
2 from distutils.command.build_py import build_py
3 from distutils.command.install_lib import install_lib
4 import os
5 import zeroinstall
7 class build_with_data(build_py):
8 """Python < 2.4 doesn't support package_data_files, so add it manually."""
9 package_data_files = [
10 "zeroinstall/0launch-gui/README",
11 "zeroinstall/0launch-gui/0launch-gui",
12 "zeroinstall/0launch-gui/ZeroInstall-GUI.xml",
13 "zeroinstall/0launch-gui/zero-install.glade",
15 def run(self):
16 # Copy .py files and build, as usual
17 build_py.run(self)
18 # Copy data files
19 for data_file in self.package_data_files:
20 outfile = os.path.join(self.build_lib, data_file)
21 self.copy_file(data_file, outfile, preserve_mode=0)
22 executable = (os.stat(data_file).st_mode & 0111) != 0
23 if executable:
24 os.chmod(outfile, os.stat(outfile).st_mode | 0111)
26 class install_lib_exec(install_lib):
27 def run(self):
28 install_lib.run(self)
29 if os.name != 'posix': return
31 launch = os.path.join(self.install_dir, 'zeroinstall/0launch-gui/0launch-gui')
32 os.chmod(launch, os.stat(launch).st_mode | 0111)
34 setup(name="zeroinstall-injector",
35 version=zeroinstall.version,
36 description="The Zero Install Injector (0launch)",
37 author="Thomas Leonard",
38 author_email="zero-install-devel@lists.sourceforge.net",
39 url="http://0install.net",
40 scripts=['0launch', '0alias', '0store', '0store-secure-add'],
41 data_files = [('man/man1', ['0launch.1', '0alias.1', '0store-secure-add.1', '0store.1']),
42 ('share/applications', ['applications/zeroinstall-zero2desktop.desktop']),
43 ('share/pixmaps', ['applications/zeroinstall-zero2desktop.png'])],
44 license='LGPL',
45 cmdclass={
46 'build_py': build_with_data,
47 'install_lib': install_lib_exec,
49 long_description="""\
50 A running process is created by combining many different libraries (and other
51 components). In the Zero Install world, we have all versions of each library
52 available at all times. The problem then is how to choose which versions to
53 use.
55 The injector solves this problem by selecting components to meet a program's
56 requirements, according to a policy you give it. The injector finds out which
57 versions are available, and downloads and runs the ones you choose.""",
58 packages=["zeroinstall", "zeroinstall.support", "zeroinstall.zerostore", "zeroinstall.injector", "zeroinstall.0launch-gui"])