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.

91 lines
2.5 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. setuptools_available = True
  9. except ImportError:
  10. from distutils.core import setup
  11. try:
  12. # This will create an exe that needs Microsoft Visual C++ 2008
  13. # Redistributable Package
  14. import py2exe
  15. except ImportError:
  16. if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
  17. print("Cannot import py2exe", file=sys.stderr)
  18. exit(1)
  19. py2exe_options = {
  20. "bundle_files": 1,
  21. "compressed": 1,
  22. "optimize": 2,
  23. "dist_dir": '.',
  24. "dll_excludes": ['w9xpopen.exe'],
  25. }
  26. py2exe_console = [{
  27. "script": "./youtube_dl/__main__.py",
  28. "dest_base": "youtube-dl",
  29. }]
  30. py2exe_params = {
  31. 'console': py2exe_console,
  32. 'options': {"py2exe": py2exe_options},
  33. 'zipfile': None
  34. }
  35. if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
  36. params = py2exe_params
  37. else:
  38. params = {
  39. 'data_files': [ # Installing system-wide would require sudo...
  40. ('etc/bash_completion.d', ['youtube-dl.bash-completion']),
  41. ('share/doc/youtube_dl', ['README.txt']),
  42. ('share/man/man1/', ['youtube-dl.1'])
  43. ]
  44. }
  45. if setuptools_available:
  46. params['entry_points'] = {'console_scripts': ['youtube-dl = youtube_dl:main']}
  47. else:
  48. params['scripts'] = ['bin/youtube-dl']
  49. # Get the version from youtube_dl/version.py without importing the package
  50. exec(compile(open('youtube_dl/version.py').read(),
  51. 'youtube_dl/version.py', 'exec'))
  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'
  57. ' YouTube.com and other video sites.',
  58. url='https://github.com/rg3/youtube-dl',
  59. author='Ricardo Garcia',
  60. author_email='ytdl@yt-dl.org',
  61. maintainer='Philipp Hagemeister',
  62. maintainer_email='phihag@phihag.de',
  63. packages=['youtube_dl', 'youtube_dl.extractor'],
  64. # Provokes warning on most systems (why?!)
  65. # test_suite = 'nose.collector',
  66. # test_requires = ['nosetest'],
  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. **params
  78. )