def writeVersionHeader(self, program): verpath = program.name+'/'+program.prefix+'-version.h.in' with self.buildSystem.fileFor(verpath) as f: d = rawTemplateFor('version.h.in').read() d = d.replace('##NAME##', program.name.upper().replace('-','_')) d = d.replace('##Name##', ''.join([c.capitalize() for c in program.name.split('-')])) d = d.replace('##-name##', program.name) d = d.replace('##_name##', program.name.lower().replace('-','_')) f.write(d)
def addDocs(self, prog): if "lang:c" in self.features: if "doc:gtk" in self.features: p = "doc/reference/%s/Makefile.am" % prog.name t = rawTemplateFor("Makefile.gtk-doc") with self.fileFor(p) as f: d = t.read() d = d.replace("##name##", prog.lower_name) d = d.replace("##NAME##", prog.upper_name) d = d.replace("##prog##", prog.name) d = d.replace("##PROG##", prog.name.replace("-", "_").upper()) f.write(d) p = "doc/reference/%s/version.xml.in" % prog.name with self.fileFor(p) as f: f.write(".".join([str(i) for i in self.getVersion()]))
def getLicenseData(self, name): p = rawTemplateFor(name.upper()) return p and p.read() or ""
def copyTo(self, srcName, dstName=None): if dstName is None: dstName = srcName self.fileFor(dstName).write(rawTemplateFor(srcName).read())