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.

74 lines
2.2 KiB

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