You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.3 KiB

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