]> Raphaƫl G. Git Repositories - youtubedl/blob - build_exe.py
Merge tag 'upstream/2012.09.27'
[youtubedl] / build_exe.py
1 from distutils.core import setup
2 import py2exe
3 import sys, os
4
5 """This will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package"""
6
7 # If run without args, build executables
8 if len(sys.argv) == 1:
9 sys.argv.append("py2exe")
10
11 # os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # conflict with wine-py2exe.sh
12 sys.path.append('./youtube_dl')
13
14 options = {
15 "bundle_files": 1,
16 "compressed": 1,
17 "optimize": 2,
18 "dist_dir": '.',
19 "dll_excludes": ['w9xpopen.exe']
20 }
21
22 console = [{
23 "script":"./youtube_dl/__main__.py",
24 "dest_base": "youtube-dl",
25 }]
26
27 init_file = open('./youtube_dl/__init__.py')
28 for line in init_file.readlines():
29 if line.startswith('__version__'):
30 version = line[11:].strip(" ='\n")
31 break
32 else:
33 version = ''
34
35 setup(name='youtube-dl',
36 version=version,
37 description='Small command-line program to download videos from YouTube.com and other video sites',
38 url='https://github.com/rg3/youtube-dl',
39 packages=['youtube_dl'],
40
41 console = console,
42 options = {"py2exe": options},
43 zipfile = None,
44 )
45
46 import shutil
47 shutil.rmtree("build")
48