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.

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