78 def package(pyabc_dir, extra_bin, extra_lib, extra_files, abc_exe, abc_sh, pyabc, ofname, scripts_dir, use_sys):
82 tf = tarfile.open(ofname,
"w:gz")
84 add_dir(tf,
"%s"%pyabc_dir, mtime)
86 add_dir(tf,
"%s/bin"%pyabc_dir, mtime)
88 add_file(tf, abc_exe,
"%s/bin/abc_exe"%pyabc_dir, 0777, mtime)
89 add_file(tf, abc_sh,
"%s/bin/abc"%pyabc_dir, 0777, mtime)
92 for fn
in os.listdir(scripts_dir):
93 if fn.startswith(
'.'):
95 fullname = os.path.join(scripts_dir, fn)
96 if os.path.isfile(fullname):
97 fnroot, fnext = os.path.splitext(fn)
99 add_file( tf, fullname, os.path.join(
"%s/bin"%pyabc_dir, fnroot), 0777, mtime)
100 elif fnext
not in (
'.pyc',
'.pyo'):
101 add_file( tf, fullname, os.path.join(
"%s/scripts"%pyabc_dir, fn), 0666, mtime)
103 for bin
in extra_bin:
104 add_file( tf, bin, os.path.join(
"%s/bin"%pyabc_dir, os.path.basename(bin)), 0777, mtime)
106 lib_dir =
"%s/lib"%pyabc_dir
110 for lib
in extra_lib:
113 for file, dest
in extra_files:
114 add_file(tf, file,
'%s/%s'%(pyabc_dir, dest), 0666, mtime)
116 for entry
in os.listdir(pyabc):
117 if entry.endswith(
'.py'):
118 add_file( tf, os.path.join(pyabc, entry), os.path.join(
"%s/lib"%pyabc_dir, entry), 0666, mtime)
122 zf = tempfile.NamedTemporaryFile(
"w+b")
127 add_fileobj(tf, zf,
"%s/lib/python_library.zip"%pyabc_dir, 0666, mtime)
133 lib_dynload = os.path.join(sys.exec_prefix,
"lib",
"python%s"%sys.version[:3],
"lib-dynload")
135 for fn
in os.listdir(lib_dynload):
136 fullname = os.path.join(lib_dynload, fn)
137 if os.path.isfile(fullname):
138 add_file( tf, fullname, os.path.join(
"%s/lib"%pyabc_dir, fn), 0666, mtime)