Updated; Build Service Collaboration

9 08 2008

The new openSUSE Build Service collaboration mechanism rocks. I’ve been playing
with it for a couple of days, and thought I blog about my findings, incase
someone finds them useful.

How to get started
Create yourself an OBS account by going to https://build.opensuse.org/, then click “Register | Login”
Install the osc package. Easiest way to do that, is by browsing to
http://software.opensuse.org/search, search for osc, then use the 1-Click Install for the  openSUSE:Tools:Devel repository.
Find a package that you want to contribute to, in my case, I use http://spreadsheets.google.com/ccc?key=pXWjzV1g7sCrvwZoLVGMFWQ&hl=en which contains all GNOME packages that needs to be updated.

Now that you found a package, do the following (I will use cheese as an example package. Also, whenever you see “MBoman”, it should be replaced with your OBS user name);

1. Create a branch where you can work on the package

> osc branch openSUSE:Factory cheese

Note: The branch has been created of a different project,
GNOME:Factory,
which is the primary location of where development for
that package takes place.
That’s also where you would normally make changes against.
A direct branch of the specified package can be forced
with the –nodevelproject option.

A working copy of the branched package can be checked out with:

osc co home:MBoman:branches:GNOME:Factory/cheese

2. Check out the package

> osc co home:MBoman:branches:GNOME:Factory/cheese
A home:MBoman:branches:GNOME:Factory/cheese/cheese-2.22.3.tar.bz2
A home:MBoman:branches:GNOME:Factory/cheese/cheese.changes
A home:MBoman:branches:GNOME:Factory/cheese/cheese.spec
A home:MBoman:branches:GNOME:Factory/cheese/ready

3. Download the latest package (most of the GNOME packages can be found at http://ftp.gnome.org/pub/GNOME/sources/) to home:MBoman:branches:GNOME:Factory/cheese

4. Change to the package directory

> cd home\:MBoman\:branches\:GNOME\:Factory/cheese/

Let’s say that the package in GNOME:Factory was cheese-2.22.3.tar.bz2 and we downloaded cheese-2.23.6.tar.bz2

1. We need to delete the older version from this project (note! *Never* use rm when deleting files here)

> osc del cheese-2.22.3.tar.bz2
D cheese-2.22.3.tar.bz2

2. Then add the new version

> osc add cheese-2.23.6.tar.bz2
A cheese-2.23.6.tar.bz2

3. We then need to change the .spec file to reflect this new version
Open up cheese.spec in your favorite editor, then find the line starting with “Version:”
For this example, you should see something like this;
Version:        2.22.3

Replace the above version with the version of the new package, so it looks like this;
Version:        2.23.6

4. Next, we need to find out what changed between 2.22.3 and 2.23.6. There are a couple of ways to do this, and not all of them works for every package :-/

1) See if you can find a news file for all versions between 2.22.3 and 2.23.6 on the ftp server where you download the package from
2) See if there is a usable NEWS file in svn (http://svn.gnome.org/viewvc/cheese/trunk/)
3) Unpack the tar ball and see if there is a usable NEWS and/or ChangeLog file in there

5. Once you found out what changed, open up cheese.changes in your favorite editor
Couple of things to remember;

* Follow the same format as previous entries
* Wrap lines that exceeds 76 characters
* Don’t use more that 40-50 lines to describe the changes as rpm copies the entire changelog to rpmdb.
* If there are bug entries (ie, #123456), figure out what bugzilla the bugentry comes from, and then change from #123456 to bgo#12346. Note that bgo should be replaced with the proper bugzilla entry from the list at http://en.opensuse.org/SUSE_Package_Conventions/Changelogs#11.1_Bugnumbers_in_changelog

6. I found it very useful to run ‘osc st’ at this stage. It’ll list all changes you’ve done. For a version upgrade, we will want to see 1 or more adds, 1 or more deletes and both .spec and .changes files modified;

> osc st
D cheese-2.22.3.tar.bz2
A cheese-2.23.6.tar.bz2
M cheese.changes
M cheese.spec

7. Commit your changes and see if the package builds. Describe what you’ve done with the -m switch;

> osc commit -m “Updated to 2.23.6”

8. Check the status to make sure the package builds;

> osc r

9. Once the package builds, submit it to the GNOME maintainers (again, use the -m switch to describe your changes);

> osc submitreq create -m ‘Updated to 2.23.6’

The GNOME maintainers will get a notification that you submitted this request.
Once they act upon it, you will get an email back. Basically, it’ll be approved or declined.

You can list existing submissions using this command;

> osc submitreq list GNOME:Factory
666 new (mboman) home:MBoman:branches:GNOME:Factory/cheese -> GNOME:Factory
‘Updated to 2.23.6’

Other things to note;
If you delete or add patches, make sure that you note that in the .changes file as well. Clarify why a patch was deleted.

Advertisements

Actions

Information

One response

9 08 2008
Rodrigo Moya

As for step 8, I find quicker to use osc directly:

osc bl openSUSE_Factory i586

run from the home:$user:branches:…/cheese directory

thus you don’t need the extra step of login into build.o.o

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: