Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
User Guide / Best Practices / Publishing Upstream Binaries

15 Publishing Upstream Binaries

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

15.1 Which Instance to Use?

15.1.1 Private OBS Instance

OBS is open source project and therefore you can set up your own instance and run it by your own. The main advantage of this approach is that you can keep all your sources and build recipes 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 potential contributors.

More information about setting up your own private OBS instance can be found in Book “Administrator Guide”, Chapter 7 “Setting Up a Local OBS Instance” .

15.1.2 openSUSE Build Service

Other option is to use some publicly available instance of OBS. One good example is openSUSE Build Service at http://build.opensuse.org. This OBS instance can be used by anybody to freely create binaries for any of the supported distributions. Big advantage 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 do not need to get your own server and configure it, you can start using it right away.

15.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.

15.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 is not 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 its 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 buildservice mailing list . Its archive and link for subscribing can be found at https://lists.opensuse.org/manage/lists/buildservice.lists.opensuse.org/ .

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

15.2.2 Supporting Additional Versions

If you want to support more than one version of your program, you need to use several projects. The same package cannot be contained in the same project multiple times.

15.2.2.1 Stable and Development Versions

Let's assume 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 do not exist) or something similar. Always try to discuss it with the maintainers of the project. They might have good ideas, suggestions and may help you in various ways.

15.2.2.2 Multiple Stable Versions

If you want to support multiple version, you would need more projects than just two as suggested in previous section. These special projects should contain versions 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.

GNOME is a good example: There is the GNOME project and many subprojects. Among them are, for example, GNOME:STABLE:2.30, GNOME:STABLE:2.32, and GNOME:STABLE:3.0. These projects hold different stable versions of GNOME with latest fixes.

15.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 recommended 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.

15.4 Getting Binaries

Note
Note

The following sections discuss feature available only in openSUSE Build Service—a freely available instances of OBS.

For a nice download page for your software published on openSUSE Build Service, use the openSUSE download page. You can include it for example using either iframe or object on newer websites. An 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 15.1, “openSUSE download page for package from OBS”. It contains links to the packages and instructions how to install them.

openSUSE download page for package from OBS
Figure 15.1: 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 &-separated parameters. But at least two of them - project and package - are required. All parameters with descriptions can be found in Table 15.1, “Parameters for Download Page”.

Table 15.1: 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 hex (for example bcolor=004) to make the download page better match your project page
fcolor Text color in hex (for example fcolor=fff) to make the download page better match your project page
acolor Link color in hex (for example acolor=ff0) to make the download page better match your project page
hcolor Highlight color in hex (for example hcolor=0ff) to make the download page better match your project page

15.4.1 Examples

Now we will take a look at how to include the download page into your project pages. As an example, we will use the osc client from the 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 standards. 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&package=osc&bcolor=004&acolor=ff0&fcolor=fff&hcolor=0ff"
   width="100%" height="100%">
   <param name="src"
      value="http://software.opensuse.org/download.html?project=openSUSE:Tools&package=osc&bcolor=004&acolor=ff0&fcolor=fff&hcolor=0ff" />
   Your browser doesn't support objects, please continue to the
   <a href="http://software.opensuse.org/download.html?project=openSUSE:Tools&package=osc&bcolor=004&acolor=ff0&fcolor=fff&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&package=osc&bcolor=004&acolor=ff0&fcolor=fff&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&package=osc&bcolor=004&acolor=ff0&fcolor=fff&hcolor=0ff"/>