This is a quick tutorial how to branch packages on OBS (hosted by Kolab Systems), for improving the Debian packages.
Please see also the step by step instructions in the Kolab documentation.
My steps show how to fix the bug 2404:
- Register a user https://obs.kolabsys.com/user/register_user
- Create a home project by clicking “Home Project” in the upper right corner.
- Go to project “Kolab Winterfell”: https://obs.kolabsys.com/project/show?project=Kolab%3AWinterfell
- Since the problem is a missing file (auth_cache.py) in package pykolab, go to package https://obs.kolabsys.com/package/show?package=pykolab&project=Kolab%3AWinterfell
- Branch the package by clicking “Branch package”. Confirm with “OK”
- Now you are redirected to your branched version of the package, in my example: https://obs.kolabsys.com/package/show?package=pykolab&project=home%3Atimotheus%3Abranches%3AKolab%3AWinterfell
- Go back to your project, https://obs.kolabsys.com/project/show?project=home%3Atimotheus%3Abranches%3AKolab%3AWinterfell; click on Repositories, and remove all distributions that are of no interest to you. That way there are no unnecessary builds on the server. I keep only Debian 7.0. If the 64 bit version is what you want, you can also disable the 32 bit build, by hovering over the green icon, and selecting “Explicitly disable”.
Also make sure that the “publish” flag is set for the distribution that you want to use.
- Now go back to “Overview”, and click on package “pykolab”. You could actually edit files directly in the web interface, and that would trigger a new build. But for the issue regarding the missing file, we need to edit a file inside the debian.tar.gz, and it is easier to use the osc command line tool for that.
- Install osc on your own local machine. It is a bit like a git client. It is availabe for many distributions.
- Checkout your project to your local machine:
osc -A https://obs.kolabsys.com:444/ checkout home:timotheus:branches:Kolab:Winterfell cd home:timotheus:branches:Kolab:Winterfell/pykolab
- Now you untar the file debian.tar.gz, and edit the file
tar xzf debian.tar.g
- check https://cgit.kolab.org/pykolab/tree/pykolab/auth/ldap for the missing files, and add new lines, and save:
- tar the file again, and delete the debian directory:
tar czf debian.tar.gz debian
rm -Rf debian
- In order for the package to be actually installed when you want to test it, and because it is good practise anyway, you have to update the files debian.changelog and pykolab.dsc as well:
pykolab.dsc: modify the line with Version, eg. Version: 0.6.8-0~kolab1 to Version: 0.6.8-0~kolab1.1
debian.changelog: copy the top lines, change the version number the same way as in pykolab.dsc, modify the description, and your author name
- Before you can commit, make sure you add the following lines to your file ~/.oscrc:
- Now commit your changes with the osc tool:
osc commit -m “adding missing files auth_cache.py and syncrepl.py, fixing bug 2404”
- This will upload your changes to the OBS server, and immediately trigger a rebuild of the package pykolab.
- You can now install your packages, similar to installing the nightly packages, just replace the username in /etc/apt/sources.list.d/kolab.list
Edit: you should add the development packages too, since currently 3.1 is not stable for Debian yet:
username=timotheus cat > /etc/apt/sources.list.d/kolab.list <<FINISH deb http://obs.kolabsys.com:82/Kolab:/3.1/Debian_7.0/ ./ deb http://obs.kolabsys.com:82/Kolab:/3.1:/Updates/Debian_7.0/ ./ deb http://obs.kolabsys.com:82/Kolab:/Winterfell/Debian_7.0/ ./ deb http://obs.kolabsys.com:82/home:/$username:/branches:/Kolab:/Winterfell/Debian_7.0/ ./ FINISH wget http://obs.kolabsys.com:82/Kolab:/3.1/Debian_7.0/Release.key apt-key add Release.key; rm -rf Release.key wget http://obs.kolabsys.com:82/Kolab:/3.1:/Updates/Debian_7.0/Release.key apt-key add Release.key; rm -rf Release.key wget http://obs.kolabsys.com:82/Kolab:/Winterfell/Debian_7.0/Release.key apt-key add Release.key; rm -rf Release.key wget http://obs.kolabsys.com:82/home:/$username:/branches:/Kolab:/Winterfell/Debian_7.0/Release.key apt-key add Release.key; rm -rf Release.key cat > /etc/apt/preferences.d/kolab <<FINISH Package: * Pin: origin obs.kolabsys.com Pin-Priority: 501 FINISH apt-get update apt-get install kolab
- When you have tested your packages, you can click “Submit package” on your pykolab project page: https://obs.kolabsys.com/package/show?package=pykolab&project=home%3Atimotheus%3Abranches%3AKolab%3AWinterfell to allow your fixes to go upstream again!
You can see the submit request here: https://obs.kolabsys.com/request/show/168
- To reinstall the Debian server for testing, I am using this script: reinstallKolabDebian.sh
- For compiling Debian locally with osc, first you need to install the osc and the build package:
wget http://download.opensuse.org/repositories/openSUSE:Tools/Debian_7.0/Release.key apt-key add - < Release.key echo 'deb http://download.opensuse.org/repositories/openSUSE:Tools/Debian_7.0/ /' >> /etc/apt/sources.list.d/osc.list apt-get update apt-get install osc build
Otherwise you would get this error:
Error: you need build.rpm with version 2007.3.12 or newer. See http://download.opensuse.org/repositories/openSUSE:/Tools/
The command for the local build looks like this:
osc build Debian_7.0 x86_64 roundcubemail-plugins-kolab.dsc
HowTo improve Debian packages using OBS