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