Personal tools
     DOCUMENTATION

Appliance Development:Cooking Package Recipes

From rPath Wiki

Jump to: navigation, search
Image:Rpath-color-16x16-1bitalpha.png  APPLIANCE DEVELOPMENT

Cooking refers to the process the Conary uses to change source files of a package or application into binary. When cooking, Conary builds a changeset file that represents the entire contents of the cooked package.

The process of cooking a Conary recipe is as follows:

  • Local Cooking
  • Testing a Changeset
  • Cooking to a Repository

Local cooking creates the changeset on your local computer where you can install and test locally while repository cooking builds the changeset onto the repository where your project members may download and install the package. Standard practice is to build the package locally before cooking into the repository. The cooking process will also inform us of dependencies that we can add to our buildRequires line in our recipe. As Conary informs us of these requirements, we can eliminate them until the recipe is successfully cooked (no unhandled Conary messages displayed). Let's do this with our balsa recipe from the previous page in the guide.

Cooking Locally

Cooking your recipe locally creates a changeset (.ccs file) inside the package directory that is installable on your local system. You can install the changeset and test the package before cooking it to the repository where it is accessible to your project members.

Cook as shown below:

 
user@localhost> cvc cook balsa.recipe
+ Building balsa=projectname.rpath.org@label:branch-1[]
+ Cleaning your old build tree
+ cd '/home/ddevine/conary/builds/balsa/balsa-2.3.17/';  CLASSPATH="" CFLAGS="-O2 -march=i686 -g" CXXFLAGS="-O2 -march=i686 -g " CPPFLAGS="" LDFLAGS="-g" CC=gcc CXX=g++  ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info   
checking for a BSD-compatible install... /usr/bin/install -c
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking for gtk+ >= 2.10... yes
checking pkg-config is at least version 0.9.0... yes
checking for BALSA... yes
checking for BALSA_AB... yes
checking for HTML... yes
checking for gtk_html_print_page_with_header_footer in -lgtkhtml-3.14... yes
checking whether to build with gpgme/GnuPG support... no
checking whether to use LDAP... no
checking whether to use SQLite... no
checking whether to build ESMTP support... yes
checking for smtp_start_session in -lesmtp... no
configure: error: *** You enabled ESMTP but esmtp library is not found.
error: Shell command "cd '/home/ddevine/conary/builds/balsa/balsa-2.3.17/';  CLASSPATH="" CFLAGS="-O2 -march=i686 -g" CXXFLAGS="-O2 -march=i686 -g " CPPFLAGS="" LDFLAGS="-g" CC=gcc CXX=g++  ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info   " exited with exit code 1
/usr/lib/python2.4/site-packages/conary/build/packagerecipe.py:1010: RuntimeError: Shell command "cd '/home/ddevine/conary/builds/balsa/balsa-2.3.17/';  CLASSPATH="" CFLAGS="-O2 -march=i686 -g" CXXFLAGS="-O2 -march=i686 -g " CPPFLAGS="" LDFLAGS="-g" CC=gcc CXX=g++  ./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info   " exited with exit code 1
user@localhost>


Resolving Requirements and Dependencies

The output of the cvc cook command has been shortened to highlight the error given by Conary. The line configure: error: *** You enabled ESMTP but esmtp library is not found tells you that Balsa requires ESMTP. A quick search of rBuilder Online repositories states that ESMTP can be found inside of the libesmtp package. Since this package is a requirement for compilation, you need to install this on your current system:

 
user@lcoalhost> sudo conary update libesmtp

Cooking the recipe again with the libesmtp package installed results in a complete process where a balsa-2.3.17.ccs file is generated in the current directory. It is necessary to go back through any the output the cook generated looking specifically for Conary messages with the warning: in front of them. These messages will inform you of suggestions to include in the buildRequires portion of the recipe. For the balsa recipe, the output display you see will be similar to the output below:

 
warning: reportMissingBuildRequires: Suggested buildRequires additions: ['ORBit2:devel', 'aspell:devel', 'atk:devel', 'cairo:devel', 'desktop-file-utils:runtime', 'expat:devel', 'freetype:devel', 'gettext:runtime', 'glib:devel', 'gnome-vfs:devel', 'gtk:devel', 'gtk:runtime', 'libICE:devel', 'libSM:devel', 'libX11:devel', 'libXrender:devel', 'libart_lgpl:devel', 'libbonobo:devel', 'libbonoboui:devel', 'libesmtp:devel', 'libgnomecanvas:devel', 'libgnomeui:devel', 'libnotify:devel', 'libpng:devel', 'pango:devel', 'pcre:devel', 'perl:runtime', 'pkgconfig:devel', 'popt:devel', 'scrollkeeper:runtime', 'zlib:devel']
+ looking up pathids from repository history
+ pathId lookup complete
Created component: balsa:data /caffeine.rpath.org@coffee:venti-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:debuginfo /caffeine.rpath.org@coffee:venti-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:doc /caffeine.rpath.org@coffee:venti-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:lib /caffeine.rpath.org@coffee:venti-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:locale /caffeine.rpath.org@coffee:venti-1//local@local:COOK/2.3.17-1-0.1 is: x86

Pull the items listed inside brackets and input them into the buildRequires portion of your recipe as shown below:

 
buildRequires = [ 'ORBit2:devel', 'aspell:devel', 'atk:devel', 'cairo:devel', 'desktop-file-utils:runtime', 'expat:devel', 'freetype:devel', 'gettext:runtime', 'glib:devel', 'gnome-vfs:devel', 'gtk:devel', 'gtk:runtime', 'libICE:devel', 'libSM:devel', 'libX11:devel', 'libXrender:devel', 'libart_lgpl:devel', 'libbonobo:devel', 'libbonoboui:devel', 'libesmtp:devel', 'libgnomecanvas:devel', 'libgnomeui:devel', 'libnotify:devel', 'libpng:devel', 'pango:devel', 'pcre:devel', 'perl:runtime', 'pkgconfig:devel', 'popt:devel', 'scrollkeeper:runtime', 'zlib:devel' ]

Continue cooking and adding in buildRequires information that is given to you at the end output of cvc cook until you have a successful cvc cook with no warning: messages.

 
user@localhost> cvc cook balsa.recipe
...
...
+ looking up pathids from repository history
+ pathId lookup complete
Created component: balsa:data /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:debuginfo /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:doc /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:lib /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:locale /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Created component: balsa:runtime /projectname.rpath.org@label:branch-1//local@local:COOK/2.3.17-1-0.1 is: x86
Changeset written to: balsa-2.3.17.ccs

You now have a balsa-2.3.17.ccs file in your current directory. This changeset file is installable locally where you can make sure it functions as it should. You can also install in a controlled environment called a chroot. Chroot's are covered later in the Appliance Development Guide.


<< PREVIOUS: Package Recipe Structure NEXT: Testing Packages with Changesets >>