import ConfigParser
+
+debug_run=False
+
class spec2yoctoConfig(object):
'''
classdocs
command += " --define='%%_configure %s'" % oe_runconf2
+ #if pkgName in ["attr"]:
+ # oe_runconf2='''autotools_do_configure'''
+ # command += " --define='%%_configure %s'" % oe_runconf2
patternUrlSourceFile = r'Source[\d]*[\s]*:[\s]*([http,ftp].*/)(.*)'
tmp_package_spec_path=tmpSpecFile.name
+ if pkgName == "attr":
+ for r in resUrlSourceFile:
+ currentSpecString=currentSpecString.replace('make configure','%configure')
+ currentSpecString=currentSpecString.replace('/lib/libattr.so\n','#/lib/libattr.so\n')
+ currentSpecString=currentSpecString.replace('\n/lib/libattr.so.*\n','\n%{_libdir}/libattr.so.*\n')
+
+ with tempfile.NamedTemporaryFile(mode='w',
+ suffix='tmp',
+ prefix=os.path.basename(tmp_package_spec_path),
+ delete=False) as tmpSpecFile:
+ tmpSpecFile.write(currentSpecString)
+ tmp_package_spec_path=tmpSpecFile.name
if self.__packagePN == "dbus-initial":
command += " --define='%s #%s' " % (p,p)
command += " --parse %s " % tmp_package_spec_path
- # print "command :",command
+ if debug_run:
+ print "command :",command
if not os.path.isdir(os.path.join("/tmp","parsed_spec")):
os.mkdir(os.path.join("/tmp","parsed_spec"))
for line in self.__spectDico[self.__installFlag][1:]:
if ("mkdir" in line) and (not "-p" in line):
line=line.replace("mkdir","mkdir -p")
-
pathList=re.findall(r"^install -m ... .* (.*)",line)
for path in pathList:
res+="mkdir -p %s\n" % path
-
res+=line+"\n"
return res
elif command=="install":
res= specParser(specPath,packagePN=packagePN).getInstallSection()
-
+ print res
elif command=="rawbuild":
aSpecParser=specParser(specPath)