Chapter 3.  Publishing upstream binaries

Contents

3.1. Which instance to use?
3.2. Where to place your project?
3.3. Creating a package
3.4. Getting binaries?

This chapter covers main step of using OBS to publish binaries of your project for multiple distributions.

3.1.  Which instance to use?

3.1.1.  Private OBS instance

OBS is open source project and therefore you can setup your own instance and run it by your own. The main advantage of this approach is that you can keep all your sources and recepies unpublished if you need to (for example because of NDA). Obvious downside of this approach is that you need to maintain your own server/servers for running builds, publishing and mirroring. Also making your project public may attract some potentional contributors.

More information about setting up your own private OBS instance can be found in Chapter 4, OBS Local Setup .

3.1.2.  openSUSE Build Service

Other option is to use some publically available instance of OBS. One good example is openSUSE Build Service - http://build.opensuse.org . This OBS instance can be used by anybody to freely create binaries for any of the supported distributions. Big advanatage is that somebody is already taking care of all the infrastructure. You can store your sources there, build your packages and got them mirrored around the world. You don't need to get your own server a configure it, you can start using it right a way.

3.2.  Where to place your project?

This part helps you to decide on how to name and where to place your project and what project structure to create. This is more important if you are sharing your OBS instance with other people like in openSUSE Build Service.

3.2.1.  Base project

If there are more packages in OBS, like for example in openSUSE Build Service, these packages needs to be somehow divided into projects so it is easier to find what people are looking for and it isn't all just one big mess.

In openSUSE Build Service, packages are divided into categories regarding their function. MySQL is in server:database repository, lighttpd in server:http and for example KMyMoney has it's own subproject in KDE:Apps. So it is a good idea to think about in what category available on the OBS your application will fit the best.

If you need whole project for yourself - for example some of your dependencies is being built in the same project, you need to request creating subproject. In openSUSE Build Service, this is done through asking OBS admins for it on opensuse-buildservice mailing list .It's archive and link for subscribing can be found at http://lists.opensuse.org/opensuse-buildservice/ .

If you need to just put yout package somewhere, you can create it in your home project and then send submitrequest to the project you want your packge to get included in.

3.2.2.  More supported versions?

If you want to support more than just one version of your program, you will need to use several projects for that. There can't be same packages with.

3.2.2.1.  Stable and development version

Let's asume that you have found project suitable for your program. Some projects already have something like STABLE and UNSTABLE subprojects. So you can use these, if you discuss it with maintainers of these project. Other way is to ask somebody from the maintainers of the project to create either these subprojects (if they don't exists) or something similar. Always try to discuss it with the maintainers of the project. They might have good ideas, sugestions and may help you in various ways.

3.2.2.2.  Multiple stable versions

If you want to support multiple version, you would need more projects then just two as suggested in previous section. These special project should contain version they are supposed to support in their name. If you are creating them under some project you are sharing with other packages, having you package name in the name of projects is a good idea as well. Good example can be Gnome. It has GNOME project and many subprojects projects. Among them are for example GNOME:STABLE:2.30, GNOME:STABLE:2.32 and GNOME:STABLE:3.0. These projects holds different stable versions of Gnome with latest fixes.

3.3. Creating a package

Packaging is quite a complex topic. Instead of trying to cover it in this book, it is a good idea to start with available internet documentation. One of the recomended online resource is Portal:Packaging on openSUSE wiki. You can find it at http://en.opensuse.org/Portal:Packaging. It contains links to several packaging tutorials and other packaging related documentation.

3.4. Getting binaries?

[Note]

This sections discuss feature available only in openSUSE Build Service - one of the freely availble instances of OBS.

If you want a nice download page for your software published on openSUSE Build Service, you can use openSUSE download page. You can include it for example using either iframe or object on newer webs . Example of download page can be following one http://software.opensuse.org/download.html?project=openSUSE:Tools&package=osc. You can see how it looks like in Figure 3.1, “openSUSE download page for package from OBS”. It contains links to the packages and instructions how to install them.

Figure 3.1. openSUSE download page for package from OBS

openSUSE download page for package from OBS

Url always has to start with http://software.opensuse.org/download.html?.You can attach any number of '&'-seperated parameters. But at least two of them - project and package - are required. All parameters with descriptions can be found in Table 3.1, “Possible parameters for download page”.

Table 3.1. Possible parameters for download page

parameterdescription
project Project in which your package is located
package Name of your package as it is specified in OBS
bcolor Background color in hexa (for example bcolor=004) to make the download page better match your project page
fcolor Text color in hexa (for example fcolor=fff) to make the download page better match your project page
acolor Link color in hexa (for example acolor=ff0) to make the download page better match your project page
hcolor Highlight color in hexa (for example hcolor=0ff) to make the download page better match your project page

3.4.1. Examples

Now we will take a look at how to include the download page into your project pages. As example we will use osc client from openSUSE:Tools project. To demonstrate the colors change, we will use theme that would match Midnight Commander.

First we will start with recent web page supporting new standarts. On such a website, we would use object to include download code:

  
<object type="text/html" 
   data="http://software.opensuse.org/download.html?project=openSUSE:Tools&amp;package=osc&amp;bcolor=004&amp;acolor=ff0&amp;fcolor=fff&amp;hcolor=0ff"
   width="100%" height="100%">
   <param name="src" 
      value="http://software.opensuse.org/download.html?project=openSUSE:Tools&amp;package=osc&amp;bcolor=004&amp;acolor=ff0&amp;fcolor=fff&amp;hcolor=0ff" />
   Your browser doesn't support objects, please continue to the
   <a href="http://software.opensuse.org/download.html?project=openSUSE:Tools&amp;package=osc&amp;bcolor=004&amp;acolor=ff0&amp;fcolor=fff&amp;hcolor=0ff">
   download page</a>
</object>
  
  

If you are using php on your server, you can make it easier by using following code:

  
<?php
   $url = "http://software.opensuse.org/download.html?project=openSUSE:Tools&amp;package=osc&amp;bcolor=004&amp;acolor=ff0&amp;fcolor=fff&amp;hcolor=0ff";
   echo '
<object type="text/html" 
   data="' . $url . '"
   width="100%" height="100%">
   <param name="src" 
      value="' . $url . '" />
   Your browser doesn't support objects, please continue to the
   <a href="' . $url . '">download page</a>
</object>
';
?>
  
  

If you are running some legacy website, you might have to use iframe:

  
  <iframe src="http://software.opensuse.org/download.html?project=openSUSE:Tools&amp;package=osc&amp;bcolor=004&amp;acolor=ff0&amp;fcolor=fff&amp;hcolor=0ff"/>