- change for attr.
authorRonan Le Martret <ronan@fridu.net>
Thu, 4 Apr 2013 08:10:18 +0000 (10:10 +0200)
committerRonan Le Martret <ronan@fridu.net>
Thu, 4 Apr 2013 08:10:18 +0000 (10:10 +0200)
Tizen_TZ_package/recipes-Tizen-IVI-base/package-yocto-oe
Tizen_TZ_package/spec2yocto.py

index bf2e55e..5b9f83a 100644 (file)
@@ -9,6 +9,4 @@ gettext
 libgcc
 linux-libc-headers
 perl
-m4
-pkgconfig
-ncurses
\ No newline at end of file
+m4
\ No newline at end of file
index d558aa7..5adaace 100755 (executable)
@@ -42,6 +42,9 @@ import tempfile
 
 import ConfigParser
 
+
+debug_run=False
+
 class spec2yoctoConfig(object):
     '''
     classdocs
@@ -265,6 +268,9 @@ class specParser:
             
             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].*/)(.*)'
         
@@ -285,6 +291,18 @@ class specParser:
                 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":
@@ -351,7 +369,8 @@ class specParser:
                 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"))
@@ -545,11 +564,9 @@ class specParser:
         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
     
@@ -1357,7 +1374,7 @@ if __name__ == '__main__':
     
     elif command=="install":
         res= specParser(specPath,packagePN=packagePN).getInstallSection()
-
+        print res
         
     elif command=="rawbuild":
         aSpecParser=specParser(specPath)