]> Raphaƫl G. Git Repositories - youtubedl/blob - setup.py
eb7b1a2121632f66f6b7d9b5d829cd9eaf46ccb5
[youtubedl] / setup.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 from __future__ import print_function
5 import pkg_resources
6 import sys
7
8 try:
9 from setuptools import setup
10 except ImportError:
11 from distutils.core import setup
12
13 try:
14 import py2exe
15 """This will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package"""
16 except ImportError:
17 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
18 print("Cannot import py2exe", file=sys.stderr)
19 exit(1)
20
21 py2exe_options = {
22 "bundle_files": 1,
23 "compressed": 1,
24 "optimize": 2,
25 "dist_dir": '.',
26 "dll_excludes": ['w9xpopen.exe']
27 }
28 py2exe_console = [{
29 "script": "./youtube_dl/__main__.py",
30 "dest_base": "youtube-dl",
31 }]
32 py2exe_params = {
33 'console': py2exe_console,
34 'options': { "py2exe": py2exe_options },
35 'zipfile': None
36 }
37
38 if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
39 params = py2exe_params
40 else:
41 params = {
42 'scripts': ['bin/youtube-dl'],
43 'data_files': [('etc/bash_completion.d', ['youtube-dl.bash-completion']), # Installing system-wide would require sudo...
44 ('share/doc/youtube_dl', ['README.txt']),
45 ('share/man/man1/', ['youtube-dl.1'])]
46 }
47
48 # Get the version from youtube_dl/version.py without importing the package
49 exec(compile(open('youtube_dl/version.py').read(), 'youtube_dl/version.py', 'exec'))
50
51 setup(
52 name = 'youtube_dl',
53 version = __version__,
54 description = 'YouTube video downloader',
55 long_description = 'Small command-line program to download videos from YouTube.com and other video sites.',
56 url = 'https://github.com/rg3/youtube-dl',
57 author = 'Ricardo Garcia',
58 maintainer = 'Philipp Hagemeister',
59 maintainer_email = 'phihag@phihag.de',
60 packages = ['youtube_dl'],
61
62 # Provokes warning on most systems (why?!)
63 #test_suite = 'nose.collector',
64 #test_requires = ['nosetest'],
65
66 classifiers = [
67 "Topic :: Multimedia :: Video",
68 "Development Status :: 5 - Production/Stable",
69 "Environment :: Console",
70 "License :: Public Domain",
71 "Programming Language :: Python :: 2.6",
72 "Programming Language :: Python :: 2.7",
73 "Programming Language :: Python :: 3",
74 "Programming Language :: Python :: 3.3"
75 ],
76
77 **params
78 )