def __init__(self, intermediateDir, targetDir, stagingDir, variables, sections): self.intermediateDir = intermediateDir self.targetDir = targetDir self.stagingDir = stagingDir self.variables = variables self.sections = sections self.controlDir = os.path.join(self.stagingDir, 'DEBIAN') scxutil.MkAllDirs(self.controlDir) self.controlFileName = os.path.join(self.controlDir, 'control') self.configFileName = os.path.join(self.controlDir, 'conffiles') self.preInstallPath = os.path.join(self.controlDir, 'preinst') self.postInstallPath = os.path.join(self.controlDir, 'postinst') self.preUninstallPath = os.path.join(self.controlDir, 'prerm') self.postUninstallPath = os.path.join(self.controlDir, 'postrm') self.fullversion_dashed = self.fullversion = self.variables["VERSION"] if "RELEASE" in self.variables: self.fullversion = self.variables[ "VERSION"] + "." + self.variables["RELEASE"] self.fullversion_dashed = self.variables[ "VERSION"] + "-" + self.variables["RELEASE"] self.archType = self.variables["PFARCH"] if self.archType == 'x86_64': self.archType = 'amd64' elif self.archType == 'aarch64': self.archType = 'arm64'
def CreateRPMDirectiveFile(self): # Create the RPM directory tree scxutil.MkAllDirs(os.path.join(self.intermediateDir, "RPM-packages/BUILD")) scxutil.MkAllDirs(os.path.join(self.intermediateDir, "RPM-packages/RPMS")) scxutil.MkAllDirs(os.path.join(self.intermediateDir, "RPM-packages/SOURCES")) scxutil.MkAllDirs(os.path.join(self.intermediateDir, "RPM-packages/SPECS")) scxutil.MkAllDirs(os.path.join(self.intermediateDir, "RPM-packages/SRPMS")) # Create the RPM directive file if os.path.exists(os.path.join(os.path.expanduser('~'), '.rpmmacros')): scxutil.Move(os.path.join(os.path.expanduser('~'), '.rpmmacros'), os.path.join(os.path.expanduser('~'), '.rpmmacros.save')) rpmfile = open(os.path.join(os.path.expanduser('~'), '.rpmmacros'), 'w') rpmfile.write('%%_topdir\t%s\n' % os.path.join(self.intermediateDir, "RPM-packages")) rpmfile.close()
def __init__(self, intermediateDir, targetDir, stagingDir, variables, sections): self.intermediateDir = intermediateDir self.targetDir = targetDir self.stagingDir = stagingDir self.variables = variables self.sections = sections self.tempDir = os.path.join(self.intermediateDir, "pkg-tmp") scxutil.MkAllDirs(self.tempDir) self.specificationFileName = os.path.join(self.tempDir, 'product_specification') self.configurePath = os.path.join(self.tempDir, "configure.sh") self.unconfigurePath = os.path.join(self.tempDir, "unconfigure.sh") self.preinstallPath = os.path.join(self.tempDir, "preinstall.sh") self.postremovePath = os.path.join(self.tempDir, "postremove.sh") self.fullversion_dashed = self.fullversion = self.variables["VERSION"] if "RELEASE" in self.variables: self.fullversion = self.variables[ "VERSION"] + "." + self.variables["RELEASE"] self.fullversion_dashed = self.variables[ "VERSION"] + "-" + self.variables["RELEASE"]
def __init__(self, intermediateDir, targetDir, stagingDir, variables, sections): self.intermediateDir = intermediateDir self.targetDir = targetDir self.stagingDir = stagingDir self.variables = variables self.sections = sections self.tempDir = os.path.join(self.intermediateDir, "lpp-tmp") scxutil.MkAllDirs(self.tempDir) self.filesetName = self.variables["SHORT_NAME"] + '.rte' self.lppNameFileName = os.path.join(self.stagingDir, 'lpp_name') self.alFileName = os.path.join(self.tempDir, self.filesetName + '.al') self.cfgfilesFileName = os.path.join(self.tempDir, self.filesetName + '.cfgfiles') self.copyrightFileName = os.path.join(self.tempDir, self.filesetName + '.copyright') self.inventoryFileName = os.path.join(self.tempDir, self.filesetName + '.inventory') self.sizeFileName = os.path.join(self.tempDir, self.filesetName + '.size') self.productidFileName = os.path.join(self.tempDir, 'productid') self.liblppFileName = os.path.join( self.stagingDir, 'usr/lpp/' + self.filesetName + '/liblpp.a') # Need to specify new file names for scripts. self.preInstallPath = os.path.join(self.tempDir, self.filesetName + '.pre_i') self.postInstallPath = os.path.join(self.tempDir, self.filesetName + '.config') self.preUninstallPath = os.path.join(self.tempDir, self.filesetName + '.unconfig') self.postUninstallPath = os.path.join(self.tempDir, self.filesetName + '.unpost_i') self.preUpgradePath = os.path.join(self.tempDir, self.filesetName + '.pre_rm') self.fullversion_dashed = self.fullversion = self.variables["VERSION"] if "RELEASE" in self.variables: self.fullversion = self.variables[ "VERSION"] + "." + self.variables["RELEASE"] self.fullversion_dashed = self.variables[ "VERSION"] + "-" + self.variables["RELEASE"]
def __init__(self, intermediateDir, targetDir, stagingDir, variables, sections): self.intermediateDir = intermediateDir self.targetDir = targetDir self.stagingDir = stagingDir self.variables = variables self.sections = sections self.tempDir = os.path.join(self.intermediateDir, "pkg-tmp") scxutil.MkAllDirs(self.tempDir) self.prototypeFileName = os.path.join(self.tempDir, 'prototype') self.pkginfoFile = PKGInfoFile(self.tempDir, self.variables) self.depFileName = os.path.join(self.tempDir, 'depend') self.preInstallPath = os.path.join(self.tempDir, "preinstall.sh") self.postInstallPath = os.path.join(self.tempDir, "postinstall.sh") self.preUninstallPath = os.path.join(self.tempDir, "preuninstall.sh") self.postUninstallPath = os.path.join(self.tempDir, "postuninstall.sh") self.iConfigFileName = os.path.join(self.tempDir, 'i.config') self.rConfigFileName = os.path.join(self.tempDir, 'r.config') self.fullversion_dashed = self.fullversion = self.variables["VERSION"] if "RELEASE" in self.variables: self.fullversion = self.variables[ "VERSION"] + "." + self.variables["RELEASE"] self.fullversion_dashed = self.variables[ "VERSION"] + "-" + self.variables["RELEASE"]
os.path.expanduser(dfp.variables["INTERMEDIATE_DIR"])) targetDir = os.path.abspath(os.path.expanduser(dfp.variables["TARGET_DIR"])) stagingDir = os.path.abspath(os.path.expanduser(dfp.variables["STAGING_DIR"])) if "DEBUG" in dfp.defines: dfp.Debug() # Make the staging directory retval = os.system('mkdir -p %s' % stagingDir) if retval != 0: sys.stderr.write("Error: Unable to create staging directory %s" % stagingDir) exit(1) for d in Directories: scxutil.MkAllDirs(stagingDir + d.stagedLocation) pass for f in Files: scxutil.Copy(os.path.join(baseDir, f.baseLocation), stagingDir + f.stagedLocation) pass for l in Links: scxutil.Link(l.baseLocation, stagingDir + l.stagedLocation) pass if dfp.variables["PACKAGE_TYPE"] == "RPM": packageObject = linuxrpm.LinuxRPMFile(intermediateDir, targetDir, stagingDir, dfp.variables, dfp.sections)