setup.py 2.1 KB

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