]>
Commit | Line | Data |
---|---|---|
2f1765c4 FV |
1 | #!/usr/bin/env python |
2 | # -*- coding: utf-8 -*- | |
3 | ||
4 | from __future__ import print_function | |
cc51a7d4 | 5 | import pkg_resources |
4efe62a0 | 6 | import sys |
cc51a7d4 | 7 | |
a32b573c DC |
8 | try: |
9 | from setuptools import setup | |
10 | except ImportError: | |
11 | from distutils.core import setup | |
12 | ||
fec89790 FV |
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 | ||
cc51a7d4 | 21 | py2exe_options = { |
770234af FV |
22 | "bundle_files": 1, |
23 | "compressed": 1, | |
24 | "optimize": 2, | |
25 | "dist_dir": '.', | |
26 | "dll_excludes": ['w9xpopen.exe'] | |
27 | } | |
cc51a7d4 | 28 | py2exe_console = [{ |
a5741a3f | 29 | "script": "./youtube_dl/__main__.py", |
770234af FV |
30 | "dest_base": "youtube-dl", |
31 | }] | |
fec89790 FV |
32 | py2exe_params = { |
33 | 'console': py2exe_console, | |
34 | 'options': { "py2exe": py2exe_options }, | |
35 | 'zipfile': None | |
36 | } | |
770234af | 37 | |
fec89790 FV |
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'])] | |
a5741a3f | 46 | } |
a5741a3f FV |
47 | |
48 | # Get the version from youtube_dl/version.py without importing the package | |
2f1765c4 | 49 | exec(compile(open('youtube_dl/version.py').read(), 'youtube_dl/version.py', 'exec')) |
87bec4c7 | 50 | |
cc51a7d4 FV |
51 | setup( |
52 | name = 'youtube_dl', | |
53 | version = __version__, | |
a5741a3f FV |
54 | description = 'YouTube video downloader', |
55 | long_description = 'Small command-line program to download videos from YouTube.com and other video sites.', | |
cc51a7d4 FV |
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'], | |
53e89361 | 61 | |
a5741a3f FV |
62 | # Provokes warning on most systems (why?!) |
63 | #test_suite = 'nose.collector', | |
64 | #test_requires = ['nosetest'], | |
770234af | 65 | |
2f1765c4 FV |
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" | |
a5741a3f FV |
75 | ], |
76 | ||
fec89790 | 77 | **params |
cc51a7d4 | 78 | ) |