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.

66 lines
1.6KB

  1. from distutils.core import setup, Command
  2. import sys
  3. try:
  4. import py2exe
  5. except ImportError:
  6. sys.stderr.write("Cannot import py2exe")
  7. import subprocess
  8. """The p2exe option will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package.
  9. python setup.py py2exe
  10. You can also build a zip executable with
  11. python setup.py bdist --format=zip
  12. The test suite can be run with
  13. python setup.py test
  14. The actual version is defined by the last git tag
  15. """
  16. # If run without args, build executables
  17. #if len(sys.argv) == 1:
  18. # sys.argv.append("py2exe")
  19. # os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # conflict with wine-py2exe.sh
  20. #sys.path.append('./youtube_dl')
  21. options = {
  22. "bundle_files": 1,
  23. "compressed": 1,
  24. "optimize": 2,
  25. "dist_dir": '.',
  26. "dll_excludes": ['w9xpopen.exe']
  27. }
  28. console = [{
  29. "script":"./youtube_dl/__main__.py",
  30. "dest_base": "youtube-dl",
  31. }]
  32. init_file = open('./youtube_dl/__init__.py')
  33. try:
  34. #return the last tag name
  35. version = subprocess.checkoutput(["git", "describe", "--abbrev=0", "--tags"])
  36. except:
  37. version = ''
  38. setup(name='youtube-dl',
  39. version=version,
  40. long_description='Small command-line program to download videos from YouTube.com and other video sites',
  41. url='https://github.com/rg3/youtube-dl',
  42. packages=['youtube_dl'],
  43. #test suite
  44. test_suite='nose.collector',
  45. test_requires=['nosetest'],
  46. console=console,
  47. options={"py2exe": options},
  48. scripts=['bin/youtube-dl'],
  49. zipfile=None,
  50. )
  51. #import shutil
  52. #shutil.rmtree("build")