Lines Matching refs:os
39 import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
92 os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION')
104 fn = os.path.join(SRCDIR, 'Include', 'patchlevel.h')
120 DEPSRC = os.path.join(WORKDIR, 'third-party')
121 DEPSRC = os.path.expanduser('~/Universal/other-sources')
148 SRCDIR = os.path.dirname(
149 os.path.dirname(
150 os.path.dirname(
151 os.path.abspath(__file__
288 "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
306 "DESTDIR": shellQuote(os.path.join(WORKDIR, 'libraries')),
355 shellQuote(os.path.join(WORKDIR, 'libraries')),
356 shellQuote(os.path.join(WORKDIR, 'libraries')),
516 fd = os.popen(commandline, 'r')
527 fd = os.popen(commandline, 'r')
579 libfw = os.path.join('/', fwpth)
580 usrfw = os.path.join(os.getenv('HOME'), fwpth)
581 frameworks[framework] = os.readlink(libfw)
582 if not os.path.exists(libfw):
586 if os.path.exists(usrfw):
610 for ev in list(os.environ):
614 ev, os.environ[ev]))
615 del os.environ[ev]
618 if 'SDK_TOOLS_BIN' in os.environ:
619 base_path = os.environ['SDK_TOOLS_BIN'] + ':' + base_path
623 if os.path.isdir(OLD_DEVELOPER_TOOLS):
625 os.environ['PATH'] = base_path
626 print("Setting default PATH: %s"%(os.environ['PATH']))
688 SRCDIR=os.path.abspath(SRCDIR)
689 WORKDIR=os.path.abspath(WORKDIR)
690 DEPSRC=os.path.abspath(DEPSRC)
722 curdir = os.getcwd()
724 os.chdir(builddir)
726 retval = os.path.basename(archiveName[:-7])
734 if os.path.exists(retval):
736 fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r')
739 retval = os.path.basename(archiveName[:-8])
740 if os.path.exists(retval):
742 fp = os.popen("tar jxf %s 2>&1"%(shellQuote(archiveName),), 'r')
745 retval = os.path.basename(archiveName[:-4])
746 if os.path.exists(retval):
748 fp = os.popen("tar xf %s 2>&1"%(shellQuote(archiveName),), 'r')
751 retval = os.path.basename(archiveName[:-4])
752 if os.path.exists(retval):
754 fp = os.popen("unzip %s 2>&1"%(shellQuote(archiveName),), 'r')
762 return os.path.join(builddir, retval)
765 os.chdir(curdir)
782 os.unlink(fname)
791 name = os.path.basename(fname)
792 if os.path.exists(fname):
805 if os.system(
851 "--prefix=%s"%os.path.join("/", *FW_VERSION_PREFIX),
852 "--openssldir=%s"%os.path.join("/", *FW_SSL_DIRECTORY),
864 srcdir = os.getcwd()
865 universalbase = os.path.join(srcdir, "..",
866 os.path.basename(srcdir) + "-universal")
867 os.mkdir(universalbase)
871 archsrc = os.path.join(universalbase, arch, "src")
874 archbase = os.path.join(universalbase, arch, "root")
875 os.mkdir(archbase)
880 archbasefw = os.path.join(archbase, *FW_VERSION_PREFIX)
883 os.chdir(archsrc)
885 os.chdir(srcdir)
889 basefw = os.path.join(basedir, *FW_VERSION_PREFIX)
891 os.path.join(archbasefw, "include", "openssl"),
892 os.path.join(basefw, "include", "openssl")
895 shlib_version_number = grepValue(os.path.join(archsrc, "Makefile"),
906 os.mkdir(os.path.join(basefw, "lib"))
918 os.path.join(fw, "lib", lib_versioned))
921 os.symlink(lib_versioned, os.path.join(basefw, "lib", lib_unversioned))
927 relative_path = os.path.join("..", "..", "..", *FW_VERSION_PREFIX)
935 os.symlink(
936 os.path.join(relative_path, *fn),
937 os.path.join(basedir, "usr", "local", *fn)
948 curdir = os.getcwd()
958 archiveName = os.path.split(url)[-1]
959 sourceArchive = os.path.join(DEPSRC, archiveName)
961 if not os.path.exists(DEPSRC):
962 os.mkdir(DEPSRC)
966 buildDir=os.path.join(WORKDIR, '_bld')
967 if not os.path.exists(buildDir):
968 os.mkdir(buildDir)
971 os.chdir(workDir)
976 fn = os.path.join(DEPSRC, os.path.basename(url))
980 fn = os.path.join(curdir, patch)
987 fn = os.path.join(DEPSRC, os.path.basename(url))
991 fn = os.path.join(curdir, patchscript)
996 os.unlink(fn)
999 os.chdir(recipe['buildDir'])
1060 os.chdir(curdir)
1069 universal = os.path.join(WORKDIR, 'libraries')
1070 os.mkdir(universal)
1071 os.makedirs(os.path.join(universal, 'usr', 'local', 'lib'))
1072 os.makedirs(os.path.join(universal, 'usr', 'local', 'include'))
1083 rootDir = os.path.join(WORKDIR, '_root')
1084 buildDir = os.path.join('../../Doc')
1085 docdir = os.path.join(rootDir, 'pydocs')
1086 curDir = os.getcwd()
1087 os.chdir(buildDir)
1093 doctarfiles = [ f for f in os.listdir(DEPSRC)
1098 if not os.path.exists('build'):
1099 os.mkdir('build')
1101 os.chdir('build')
1103 runCommand('tar xjf %s'%shellQuote(os.path.join(DEPSRC, doctarfile)))
1105 archivefiles = [ f for f in os.listdir('.')
1107 if os.path.isdir(f) ]
1112 os.rename(archivefile, 'html')
1113 os.chdir(buildDir)
1115 htmlDir = os.path.join('build', 'html')
1116 if not os.path.exists(htmlDir):
1120 os.rename(htmlDir, docdir)
1121 os.chdir(curDir)
1127 buildDir = os.path.join(WORKDIR, '_bld', 'python')
1128 rootDir = os.path.join(WORKDIR, '_root')
1130 if os.path.exists(buildDir):
1132 if os.path.exists(rootDir):
1134 os.makedirs(buildDir)
1135 os.makedirs(rootDir)
1136 os.makedirs(os.path.join(rootDir, 'empty-dir'))
1137 curdir = os.getcwd()
1138 os.chdir(buildDir)
1159 shellQuote(os.path.join(SRCDIR, 'configure')),
1188 os.path.join(WORKDIR, 'libraries', 'usr', 'local', 'lib'),
1203 make_extras = os.getenv("BUILDINSTALLER_BUILDPYTHON_MAKE_EXTRAS")
1224 if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
1225 build_lib_dir = os.path.join(
1228 fw_lib_dir = os.path.join(
1242 frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
1243 frmDirVersioned = os.path.join(frmDir, 'Versions', version)
1244 path_to_lib = os.path.join(frmDirVersioned, 'lib', 'python%s'%(version,))
1246 sslDir = os.path.join(frmDirVersioned, 'etc', 'openssl')
1247 os.makedirs(sslDir)
1253 for dirpath, dirnames, filenames in os.walk(frmDir):
1255 os.chmod(os.path.join(dirpath, dn), STAT_0o775)
1256 os.chown(os.path.join(dirpath, dn), -1, gid)
1259 if os.path.islink(fn):
1263 p = os.path.join(dirpath, fn)
1264 st = os.stat(p)
1265 os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
1266 os.chown(p, -1, gid)
1286 fp = open(os.path.join(buildDir, 'Makefile'), 'r')
1314 path = os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile')
1343 path = os.path.join(path_to_lib,
1346 path = os.path.join(path_to_lib, '_sysconfigdata.py')
1375 usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')
1376 to_framework = os.path.join('..', '..', '..', 'Library', 'Frameworks',
1378 if os.path.exists(usr_local_bin):
1380 os.makedirs(usr_local_bin)
1381 for fn in os.listdir(
1382 os.path.join(frmDir, 'Versions', version, 'bin')):
1383 os.symlink(os.path.join(to_framework, fn),
1384 os.path.join(usr_local_bin, fn))
1386 os.chdir(curdir)
1411 os.chmod(outPath, STAT_0o755)
1416 curdir = os.getcwd()
1443 srcdir = os.path.join(WORKDIR, '_root', srcdir[1:])
1447 postflight = os.path.abspath(postflight)
1449 packageContents = os.path.join(targetDir, pkgname + '.pkg', 'Contents')
1450 os.makedirs(packageContents)
1453 os.chdir(srcdir)
1454 runCommand("pax -wf %s . 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
1455 runCommand("gzip -9 %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
1456 runCommand("mkbom . %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.bom')),))
1458 fn = os.path.join(packageContents, 'PkgInfo')
1463 rsrcDir = os.path.join(packageContents, "Resources")
1464 os.mkdir(rsrcDir)
1465 fp = open(os.path.join(rsrcDir, 'ReadMe.txt'), 'w')
1470 patchScript(postflight, os.path.join(rsrcDir, 'postflight'))
1494 writePlist(pl, os.path.join(packageContents, 'Info.plist'))
1501 writePlist(pl, os.path.join(packageContents, 'Resources', 'Description.plist'))
1504 os.chdir(curdir)
1539 for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
1542 os.unlink(os.path.join(dirpath, fn))
1544 outdir = os.path.join(WORKDIR, 'installer')
1545 if os.path.exists(outdir):
1547 os.mkdir(outdir)
1549 pkgroot = os.path.join(outdir, 'Python.mpkg', 'Contents')
1550 pkgcontents = os.path.join(pkgroot, 'Packages')
1551 os.makedirs(pkgcontents)
1555 rsrcDir = os.path.join(pkgroot, 'Resources')
1557 fn = os.path.join(pkgroot, 'PkgInfo')
1562 os.mkdir(rsrcDir)
1564 makeMpkgPlist(os.path.join(pkgroot, 'Info.plist'))
1570 writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist'))
1571 for fn in os.listdir('resources'):
1574 shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
1576 patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
1584 shellQuote(os.path.join(WORKDIR, '_root'))))
1593 outdir = os.path.join(WORKDIR, 'diskimage')
1594 if os.path.exists(outdir):
1628 imagepath = os.path.join(outdir,
1634 os.mkdir(outdir)
1643 shellQuote(os.path.join(WORKDIR, 'installer')),
1646 fd = os.popen(cmd, 'r')
1657 if not os.path.exists(os.path.join(WORKDIR, "mnt")):
1658 os.mkdir(os.path.join(WORKDIR, "mnt"))
1660 shellQuote(imagepath + ".tmp.dmg"), shellQuote(os.path.join(WORKDIR, "mnt"))))
1664 os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
1666 shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
1668 runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))
1675 os.unlink(imagepath + ".tmp.dmg")
1685 dirPath = os.path.normpath(os.path.dirname(__file__))
1686 toolPath = os.path.join(dirPath, "seticon.app/Contents/MacOS/seticon")
1687 if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(dirPath + '/seticon.m').st_mtime:
1690 appPath = os.path.join(dirPath, "seticon.app/Contents/MacOS")
1691 if not os.path.exists(appPath):
1692 os.makedirs(appPath)
1696 runCommand("%s %s %s"%(shellQuote(os.path.abspath(toolPath)), shellQuote(icnsPath),
1704 os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET
1705 os.environ['CC'] = CC
1706 os.environ['CXX'] = CXX
1708 if os.path.exists(WORKDIR):
1710 os.mkdir(WORKDIR)
1712 os.environ['LC_ALL'] = 'C'
1726 del os.environ['MACOSX_DEPLOYMENT_TARGET']
1731 folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(
1733 fn = os.path.join(folder, "License.rtf")
1735 fn = os.path.join(folder, "ReadMe.rtf")
1737 fn = os.path.join(folder, "Update Shell Profile.command")
1739 fn = os.path.join(folder, "Install Certificates.command")
1741 os.chmod(folder, STAT_0o755)
1749 os.path.join(WORKDIR, 'installer', 'ReadMe.rtf'))
1753 os.path.join(WORKDIR, 'installer', 'License.rtf'))
1755 fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
1758 fp.write("# By: %s\n" % pwd.getpwuid(os.getuid()).pw_gecos)