<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>1656</bug_id>
          
          <creation_ts>2011-10-05 12:02:58 +0000</creation_ts>
          <short_desc>Recipe creation/import script</short_desc>
          <delta_ts>2012-11-30 08:11:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Meta-yocto</product>
          <component>meta-yocto</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(P3) (Test Case Ready)(Patch Merged)</status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Hatle">mark.hatle</reporter>
          <assigned_to name="Kai Kang">kai.kang</assigned_to>
          <cc>hongxu.jia</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>josh</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
    
    <cc>wd</cc>
    
    <cc>yi.zhao</cc>
    
    <cc>zhenfeng.zhao</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16730</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2011-10-05 12:02:58 +0000</bug_when>
    <thetext>A script or similar system that would allow you to give is an upstream URL, tarball, patch set, package (SRPM, or debian style) and generate a recipe based on those instructions.

The goal is to facilitate a starting point for someone who is not yet familar with writing recipes by hand.  Add options to be able to specify autoconf or not.. (perhaps even automatically detected based on the contents of the upstream sources or build instructions embedded in a package.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16899</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Lock - Disabled">josh</who>
    <bug_when>2011-10-18 10:30:32 +0000</bug_when>
    <thetext>I started to look at the feasibility of such a project and found
a colleague had already done some similar work for MeeGo - Autospectacle:

https://meego.gitorious.org/meego-developer-tools/autospectacle

Autospectacle uses various clever heuristics such as:
* detecting build dependencies by scanning configure files for
pkg-config and qmake for well-known patterns (i.e. AC_CHECK_LIB)
* determining license by keeping an internal map of license file
sha256sums to the equivalent license file.
* Checking spec files, debian control files, doap files, pkg-config
files and finally freshmeat for the package description.
* etc, etc.

In my mind there are two, possibly complementary, approaches to this task:
1) We can get users a long way by providing a script which takes a URI
as argument and begins to fill in a copy of the skeleton recipe with:
   - SRC_URI
   - SRC_URI checksums
   - description (using similar heuristics to autospectacle)
2) We can easily expand on 1) to perform more of the functions of
autospectacle but my opinion is that once we start to:
   a) generate a significant set of heuristics
   b) expand downloaded files to poke around inside and,
   c) interact with BitBake
we need to do so within a more structured program than a script. There
are two approaches for this in my mind:
   i) Develop a general program infrastructure for automating packaging
of software, where heuristics and other pieces (templates) are data
files arranged by target system. A user can run the program with a
target package and system and the program will generate as much of a
packaging file as possible. Clearly we&apos;ll only deliver heuristics and
data for Yocto but we&apos;ll steward a project that is capable of much more.
   ii) integrate into the build system to use the build system
infrastructure (functionality, work directories, etc) to boot-strap a
packaging effort.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17905</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2011-12-31 00:09:43 +0000</bug_when>
    <thetext>change Target Milestone to m3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18014</commentid>
    <comment_count>3</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-01-08 19:33:58 +0000</bug_when>
    <thetext>change Target Milestone back to M2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18428</commentid>
    <comment_count>4</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-01-30 19:19:06 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; A script or similar system that would allow you to give is an upstream URL,
&gt; tarball, patch set, package (SRPM, or debian style) and generate a recipe based
                                        ～～～～～～
&gt; on those instructions.
&gt; 
For debian style package, the control file extracted from .deb package doesn&apos;t contain the URI of the source repo or tar ball. So how to get it? If can&apos;t it, I wonder it is not worth to support debain style package</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21156</commentid>
    <comment_count>5</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-05-08 03:38:26 +0000</bug_when>
    <thetext>Patches are merged</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26945</commentid>
    <comment_count>6</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2012-10-26 06:03:09 +0000</bug_when>
    <thetext>Here is my test result:

1. The script &quot;create-recipe&quot; only support &quot;tarball&quot;, not support &quot;rpm&quot;
2. Run script with tarball, there are some unexpected log messages, just like:

build$ create-recipe https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
Downloading package:
https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
Unpacking to : /tmp/oV5xfuTpAa
before ...Parsing content ....
tar (child): /home/jiahongxu/yocto/poky/build/newt/*.tar.bz2：cannot open: that file or direcory.
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Can NOT get license from package itself.
Please update the license and license file manually.
Create bb file: /home/jiahongxu/yocto/poky/build/newt/newt_0.52.bb</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26946</commentid>
    <comment_count>7</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-10-26 06:07:56 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; Here is my test result:
&gt; 
&gt; 1. The script &quot;create-recipe&quot; only support &quot;tarball&quot;, not support &quot;rpm&quot;
&gt; 2. Run script with tarball, there are some unexpected log messages, just
&gt; like:
&gt; 
&gt; build$ create-recipe
&gt; https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
&gt; Downloading package:
&gt; https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
&gt; Unpacking to : /tmp/oV5xfuTpAa
&gt; before ...Parsing content ....
&gt; tar (child): /home/jiahongxu/yocto/poky/build/newt/*.tar.bz2：cannot open:
&gt; that file or direcory.
&gt; tar (child): Error is not recoverable: exiting now
&gt; tar: Child returned status 2
&gt; tar: Error is not recoverable: exiting now
&gt; Can NOT get license from package itself.
&gt; Please update the license and license file manually.
&gt; Create bb file: /home/jiahongxu/yocto/poky/build/newt/newt_0.52.bb

I try to extract tar.gz and tar.bz2 and then get the source code. The error that file doesn&apos;t exist should go to /dev/null.
I will check what cause that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27464</commentid>
    <comment_count>8</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2012-11-15 08:20:20 +0000</bug_when>
    <thetext>Yocto Commit e48fe4ed7aca0f16becd17ec6cc1978a4031c111 update the script to remove the warning information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27845</commentid>
    <comment_count>9</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2012-11-30 08:11:38 +0000</bug_when>
    <thetext>Verified with 1.4_M1. 
gitinfo: 247b6a3754c2c50318e2a73d79981ba0e9cb560b

For a .gz tarball:
##############
$ ./scripts/create-recipe https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
Downloading package: https://fedorahosted.org/releases/n/e/newt/newt-0.52.14.tar.gz
Unpacking to       : /tmp/3gXGbuDr2L
Parsing content    ....
Create bb file: /home/zhaoyi/work/poky/poky.git/newt/newt_0.52.14.bb
#############

For a .bz2 tarball:
#############
$ ./scripts/create-recipe https://fedorahosted.org/releases/s/n/snake/snake-0.11.1.tar.bz2
Downloading package: https://fedorahosted.org/releases/s/n/snake/snake-0.11.1.tar.bz2
Unpacking to       : /tmp/8DAwvqvNwc
Parsing content    ....
Can NOT get license from package source files.
Please update the LICENSE and LIC_FILES_CHKSUM manually.
Create bb file: /home/zhaoyi/work/poky/poky.git/snake/snake_0.11.1.bb
#########</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>