Fvennetier (Talk | contribs) (→Create an archive from your source code repository) |
Fvennetier (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| - | = | + | = OBS source services = |
| - | OBS provides '''source services''' which can download/compress/extract/verify files before actually building a package. There is only small documentation [http://doc.opensuse.org/products/draft/OBS/obs-reference-guide_draft/cha.obs.source_service.html here]. | + | OBS provides '''source services''' which can download/compress/extract/verify files before actually building a package. There is only small documentation [http://doc.opensuse.org/products/draft/OBS/obs-reference-guide_draft/cha.obs.source_service.html here]. You can find two interesting blog posts [http://informatiq.org/content/obs-source-service-git-master-build here] and [http://saigkill.homelinux.net/entry/2011/07/15/how-to-use-three-open-build-service-source-services-to-simplify-the-packaging there]. |
| + | |||
| + | To use source services in your project, simply create a file with name '''<tt>_service</tt>''', and insert in it service definitions surrounded by a global '''<code><services>...</services></code>''' tag. | ||
| + | |||
| + | Notice that all sources services are not installed on all OBS servers (''pub.meego.com'' OBS seems to have only 2 while ''opensuse.org'' OBS has 14 services). | ||
| - | |||
== Create an archive from your source code repository == | == Create an archive from your source code repository == | ||
Contents |
OBS provides source services which can download/compress/extract/verify files before actually building a package. There is only small documentation here. You can find two interesting blog posts here and there.
To use source services in your project, simply create a file with name _service, and insert in it service definitions surrounded by a global <services>...</services> tag.
Notice that all sources services are not installed on all OBS servers (pub.meego.com OBS seems to have only 2 while opensuse.org OBS has 14 services).
A service called tar_scm is available to create a .tar archive from Subversion, Git, Mercurial and Bazaar source code management systems.
Here is a configuration example:
<service name="tar_scm"> <param name="scm">git</param> <param name="url">git://gitorious.org/meego-developer-tools/obs-light.git</param> <param name="subdir">src</param> <param name="filename">obslight</param> <param name="versionprefix">0.4.git</param> </service>
Tag significations:
After having created an archive with the tar_scm service, you may want to extract some files, for example the spec file of your package. The extract_file service is what you need.
Here is an example:
<service name="extract_file"> <param name="archive">*.tar</param> <param name="files">*/deb/* */rpm/obslight.changes */rpm/obslight.spec */rpm/obslight.yaml</param> </service>
Tag significations:
The recompress service allows you to compress or recompress an archive. Two reasons to use it: save space, and make an archive compatible with your spec file (which probably expects .tar.gz or .tar.bz2). Here is an example:
<service name="recompress"> <param name="compression">gz</param> <param name="file">*git*.tar</param> </service>
Tag significations:
You have just configured the tar_scm service, but the archive name is different from the one in your spec file, because the version part of the name has been incremented.
The set_version service allows you to update your .spec and .dsc files with the new version of your archive.
Here is a simple example:
<service name="set_version"/>
The version will be automatically guessed from *.tar.*, *.tgz, *.tbz2 or *.zip files.
However there are optional parameters (syntax <param name="parameter_name">value</param>):