Saturday, October 20, 2012

How to use three Open Build Service Source Services to simplify the packaging


I think this might be served up from a dyndns home system, so am capturing it here.  On the hunt for OBS info.

this puzzle part relates to obs2obs copy and tag creation.

http://saigkill.homelinux.net/entry/2011/07/15/how-to-use-three-open-build-service-source-services-to-simplify-the-packaging

This is a short HowTo about using the OBS Source Services.
Sometimes a packager has a package who changes the Sourcecode very often. So the packager has to choose: On the first hand he can checkout the code from git or svn makes a tar.gz or bz2 from it or he can use the Source Services from the Buildservice. But how to do that?
In the following Example i'm using calligra from the KDE:Active Repository.
First of all i have uploaded the needed specs and *.changes files and all optional Sources. Then i'm going to the "Sources" Tab.In my case it looks like:

There we have two ranges. The first is called "Source Services" and the second "Source Files". If you are creating an new package this range is empty.
In my case i have filled the "Source Files" Range with my files. All my uploaded Files are in Section (2) from the Image. The Files in Section (3) will be automaticly created by the Source Services. But in your case this is empty Range.
But let us show the "Source Service" Section:

If you go to (1) "Add Service for Source Processing" you see this:

In this Overview you can choose your wanted Source Processor. In my case i choosed: tar_scm, recompress and update_sources.
If you choose tar_scm you can fill out a little form. It looks like:

In the field "url" you can add the full git adress. In my case it is "git://anongit.kde.org/calligra". Other Repositories like "git://anongit.kde.org/scratch/cschumac/polka.git" are possible too. In the field "scm" you can choose the Version Control System like git, svn, hg and bzr.
In the Standardform the field "versionprefix" isn't available. But it works.
The Source Services recompress and update_sources coming out without any configuration and working out of the box. So the OBS works like:
  1. fetch the data from scm
  2. recompress the *.tar to *.tar.gz
  3. make a temp spec file with changed versiontag (used that from the source)
  4. make a build
My Problem was now that i got a File like %{name}-%{gitversion} so it looks like calligra-1234567.tar.gz But my goal was to get calligra-2.3.90.git1234567.tar.gz. So i must set the versionprefix.
For doing that you must edit the file "_service". You can just click on it and choose "Edit File". The File itself is a simple XML File, so it is human readable. :-)
That's my file content:

<services>
  <service name="tar_scm"><param name="url">git://anongit.kde.org/calligra</param><param name="scm">git</param>
<param name="versionprefix">2.3.80.git</param></service>
<service name="recompress"><param name="file">*.tar</param><param name="compression">gz</param></service><service name="set_version"/></services>  
The _services file is the control file for all services in that package. For adding the parameter "versionprefix" i've added the marked line.
After that i got my prefered format.
The Source Services are a mighty. You can download a special file and use it, or you can check the checksum with md5. I can see in this Source Services a very good potencial.
If you want to read more about that, just go to doc.openSUSE.org.
ATM it looks for me, that if you must start the services manually daily, if you want to update the sources. But all in all you can save time if you use that great tools.
If you liked this short intro or not, i'm happy about comments and trachbacks ;-)

No comments:

Post a Comment