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