Here is how you can make a new package or update existing packages for GnomeDeveloperKit. You can see a list of gnome modules currently tracked in the Developer Kit here.

You can largely follow the packaging guide of Foresight Linux, and should refer there for details. Though packaging can only be easier for the Developer Kit.

Setup Build Environment

Setup Conary

Add this to the beginning of ~/.conaryrc:

contact             your-email
name                your-fullname

Also add this if you have commit permission for the dev kit repository.

user       your-username your-password

Then clone the Git repository at to somewhere (referred as "/home/test/src/buildbot" in the following text) on your system. You will need several files here.

So my ~/.conaryrc looks like,

contact             my-email
name                Zhang Sen
user       jesse password

# to define [gnome:trunk]; replace /home/test/src/buildbot as you need
includeConfigFile   /home/test/src/buildbot/build-system/rc-files/conaryrc


mkdir -p ~/conary/gnome
cd ~/conary/gnome
cvc context gnome:trunk # setup the context (gnome:trunk)

Setup rmake

~/.rmakerc simply looks like,

# replace /home/test/src/buildbot as you need
includeConfigFile   /home/test/src/buildbot/build-system/rc-files/rmakerc

Have a look at existing packages

A package is defined by its 'recipe'. You can checkout out existing recipes as examples.

First change to the directory you created for conary and the developer kit:

cd ~/conary/gnome/

Then checkout:

cvc checkout empathy # for short: cvc co empathy

You will see most packages have a common and simple structure:

   1 loadRecipe('gnomepackage')
   2 class PackageName(GnomePackageRecipe):
   3     name = 'package-name'
   4     version = GnomePackageRecipe._getVersion('package-name')
   6     buildRequires = []

Understanding Recipes

Recipes are python modules. The packaging process is defined by a class. Packaging options are defined as attributes, e.g. name, version, buildRequires. The super-class GnomePackageRecipe defines additional attributes and methods, which you can override (with Python's support of OO) to fine-tune the packaging.

Checkout the packge 'gnomepackage' to have a look at the overall build process. The setup method is what conary will execute:

cvc co gnomepackage

Make new packages

First change to the directory you created for conary and the developer kit:

cd ~/conary/gnome/

Prepare the recipe

Create a new recipe:

cvc newpkg <your-package> --template gnome

(If "error: recipe template 'gnome' not found", then run "sudo conary update foresight-recipes" to install it.)

Make use of existing recipes

It is likely that the package is already in Foresight Linux's repository. You can make use of it. Checkout a package from Foresight repository:

cd <some-other-dir> # change dir to somewhere else, so it doesn't mess up with your own recipes
cvc co <package-name>

Usually you can just copy the buildRequires and other things from this recipe, though some change is needed. e.g. the version from, say, 2.26.1 to GnomePackageRecipe._getVersion('package-name'). And maybe change some methods. Look at the gnomepackage recipe to know why/what to change.

Another possibility is that the package is already in the Dev Kit, but not updated for long. You can check it out and build your recipe upon it:

cvc co <package-name>

Build with cvc

Now try to build the package.

cd <your-package>
cvc cook <your-package>.recipe

Fix errors and get it built. Unfortunately there is no uniform solution to all the various errors here; you may encounter configure problems, compile error, etc. Refer to Foresight Wiki for troubleshooting tips.

When you are done, cvc will report its suggested buildRequires. Add them to the recipe. Also fix other errors/warnings cvc gives.

Install necessary build-requires

You need various development tools and packages for compiling, however the Gnome Developer Kit doesn't contain development tools any more (e.g. the :devel troves of packages).

So if you see such error:

error: Could not find the following troves needed to cook this recipe:
error: unresolved build dependencies

simply install them by sudo conary update GConf:devel.

Besides, git:runtime is a must in order to checkout source from (See Bug 616420 for a relevant error message if git:runtime is missing)

Test Package

Now you can test the package your've just created:

sudo conary update <the-ccs-file-just-appeared>

Edit recipe, cook, install, edit again, cook again, install again. Repeat these steps until you feel it's OK.

Build with rmake

Now, as you may read, cvc uses _your_ system for build the package, and everyone's system can have different versions of libraries, tools, etc. So there is another tool called rmake, which can ensure that a recipe can always produce the same binary, no mattter where it's built. rmake builds a chroot according to the recipe, and performs the packaging inside the chroot.

Note: if you met 'rmake: command not found', then install it:

sudo conary update rmake:runtime

And also start the rmake server: (yes it's a server, so you could well quit the program after you do 'rmake build blah'. The build job won't be stopped unless you do 'rmake stop <job-id>')

sudo service rmake start

Gnome Developer Kit only accepts recipes which build well with rmake. So you should now build it again with rmake:

rmake build <your-package>.recipe --reuse

The --reuse option means rmake will try to reuse the chroot of previous packaging, which can save you some time since creating chroot is quite slow.

Fix problems and update the recipe. Build again, etc, etc.

Commit your efforts

When it builds and runs well, you could ask to include your package in Gnome Developer Kit. File a bug report on bugzilla, attach your recipe, or if you have committed to your personal repository, then something like this line will suffice:

Or if you already have permission to commit:

rmake build <your-package>.recipe # build again without --reuse
rmake commit <job-id> # or rmake ci, for short

Thanks for your efforts! It is done :-)

Update packages

Have a look at how we currently refresh all the packages daily. Basically it's simply a script to drive the following process for all packages.

First you may want to obtain the commit permission.

Change to the working directory:

cd ~/conary/gnome/

Checkout the package:

cvc co <package>
cd <package>

Refresh it (update the source from git):

cvc refresh

Commit the source:

cvc ci -m "new snapshot"

Built it:

rmake build <package>

Fix problems until it builds well.

Commit the binary:

rmake ci <job-id>

Attic/GnomeDeveloperKit/CreatePackage (last edited 2013-11-22 21:07:29 by WilliamJonMcCann)