Support cx_Freeze

This commit is contained in:
Bastian Kleineidam 2012-05-23 21:32:07 +02:00
parent 5158c6e6b9
commit 7d5c27abdb
3 changed files with 28 additions and 9 deletions

View File

@ -7,6 +7,7 @@
* Generate standalone Windows installer. * Generate standalone Windows installer.
* Initialize the internal MIME database correct on all platforms. * Initialize the internal MIME database correct on all platforms.
* Improved option compatibility for the ar, cpio and tar programs. * Improved option compatibility for the ar, cpio and tar programs.
* Support RPM installer generation with cx_Freeze.
0.16 "Game of thrones" (released 12.5.2012) 0.16 "Game of thrones" (released 12.5.2012)

View File

@ -6,6 +6,6 @@ release = 1
packager = Bastian Kleineidam <calvin@users.sourceforge.net> packager = Bastian Kleineidam <calvin@users.sourceforge.net>
doc_files = doc/*.txt doc_files = doc/*.txt
provides = patool provides = patool
group = Web/Utilities group = Applications/Archiving
install_script = install-rpm.sh install_script = install-rpm.sh
python = python python = python

View File

@ -25,6 +25,9 @@ import os
import shutil import shutil
import glob import glob
import subprocess import subprocess
try:
from cx_Freeze import setup, Executable
except ImportError:
from distutils.core import setup from distutils.core import setup
try: try:
# py2exe monkey-patches the distutils.core.Distribution class # py2exe monkey-patches the distutils.core.Distribution class
@ -34,7 +37,12 @@ try:
except ImportError: except ImportError:
# py2exe is not installed # py2exe is not installed
has_py2exe = False has_py2exe = False
try:
from cx_Freeze.dist import Distribution
executables = [Executable("patool")]
except ImportError:
from distutils.core import Distribution from distutils.core import Distribution
executables = None
from distutils import util from distutils import util
AppName = "patool" AppName = "patool"
@ -42,17 +50,23 @@ AppVersion = "0.17"
MyName = "Bastian Kleineidam" MyName = "Bastian Kleineidam"
MyEmail = "calvin@users.sourceforge.net" MyEmail = "calvin@users.sourceforge.net"
# py2exe options for windows .exe packaging py_excludes = ['doctest', 'unittest', 'Tkinter', '_ssl', 'pdb',
'email', 'calendar', 'ftplib', 'httplib', 'pickle', 'optparse','rfc822'
]
# py2exe options for Windows packaging
py2exe_options = dict( py2exe_options = dict(
packages=["encodings"], packages=["encodings"],
excludes=['doctest', 'unittest', 'Tkinter', '_ssl', 'pdb', excludes=py_excludes,
'email', 'calendar', 'ftplib', 'httplib', 'pickle', 'optparse',
'rfc822'],
# silence py2exe error about not finding msvcp90.dll # silence py2exe error about not finding msvcp90.dll
dll_excludes=['MSVCP90.dll'], dll_excludes=['MSVCP90.dll'],
compressed=1, compressed=1,
optimize=2, optimize=2,
) )
# cx_Freeze for Linux RPM packaging
cxfreeze_options = dict(
packages=["encodings"],
excludes=py_excludes,
)
# Microsoft Visual C++ runtime version (tested with Python 2.7.2) # Microsoft Visual C++ runtime version (tested with Python 2.7.2)
MSVCP90Version = '9.0.21022.8' MSVCP90Version = '9.0.21022.8'
@ -226,7 +240,7 @@ except ImportError:
pass pass
setup ( args = dict(
name = AppName, name = AppName,
version = AppVersion, version = AppVersion,
description = "portable command line archive file manager", description = "portable command line archive file manager",
@ -260,7 +274,7 @@ installed.
packages = ['patoolib', 'patoolib.programs'], packages = ['patoolib', 'patoolib.programs'],
data_files = data_files, data_files = data_files,
scripts = ['patool'], scripts = ['patool'],
keywords = "archive,manager", keywords = "archiver,compression,commandline",
classifiers = [ classifiers = [
'Environment :: Console', 'Environment :: Console',
'Topic :: System :: Archiving', 'Topic :: System :: Archiving',
@ -275,5 +289,9 @@ installed.
}, },
options = { options = {
"py2exe": py2exe_options, "py2exe": py2exe_options,
"build_exe": cxfreeze_options,
}, },
) )
if executables:
args["executables"] = executables
setup(**args)