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.

85 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': [ # 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. # Get the version from youtube_dl/version.py without importing the package
  46. exec(compile(open('youtube_dl/version.py').read(),
  47. 'youtube_dl/version.py', 'exec'))
  48. setup(
  49. name = 'youtube_dl',
  50. version = __version__,
  51. description = 'YouTube video downloader',
  52. long_description = 'Small command-line program to download videos from YouTube.com and other video sites.',
  53. url = 'https://github.com/rg3/youtube-dl',
  54. author = 'Ricardo Garcia',
  55. maintainer = 'Philipp Hagemeister',
  56. maintainer_email = 'phihag@phihag.de',
  57. packages = ['youtube_dl', 'youtube_dl.extractor'],
  58. # Provokes warning on most systems (why?!)
  59. #test_suite = 'nose.collector',
  60. #test_requires = ['nosetest'],
  61. classifiers = [
  62. "Topic :: Multimedia :: Video",
  63. "Development Status :: 5 - Production/Stable",
  64. "Environment :: Console",
  65. "License :: Public Domain",
  66. "Programming Language :: Python :: 2.6",
  67. "Programming Language :: Python :: 2.7",
  68. "Programming Language :: Python :: 3",
  69. "Programming Language :: Python :: 3.3"
  70. ],
  71. **params
  72. )