Fvennetier (Talk | contribs) |
Fvennetier (Talk | contribs) |
||
| Line 1: | Line 1: | ||
= How to build latest source from Git using OBS and source services = | = How to build latest source from Git using OBS and 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]. | ||
== Create an archive from your repository == | == Create an archive from your repository == | ||
| - | A service called '''tar_scm''' is available to create a ''.tar'' archive from Subversion, Git, Mercurial and Bazaar source code management systems. | + | 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: | ||
| + | <code> | ||
| + | <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> | ||
| + | </code> | ||
| + | Tag significations: | ||
| + | * '''scm''' : the type of source code management system you want to get source from. Available values are ''svn, git, hg, bzr''. | ||
| + | * '''url''' (''required''): the checkout URL of your repository. | ||
| + | * '''subdir''' (''optional''): the name of the sub-directory of your repository you want to checkout. | ||
| + | * '''filename''' (''optional''): the name of the tar file which will be created. If not specified, the last part of the URL will be used (without ''.git'' for Git repositories). | ||
| + | * '''versionprefix''' (''optional''): the base version string that will be appended to the file name. | ||
| + | * '''version''' (''optional''): the version string that will be appended to the file name. If not specified, the timestamp of the last commit is used (number of seconds since the epoch) for Git or the revision number for Subversion. | ||
| + | * '''exclude''' (''optional''): name of a file to exclude when creating the archive. Can be used multiple times. | ||
| + | |||
== Extract build-control files == | == Extract build-control files == | ||
| + | |||
| + | <code> | ||
| + | <service name="extract_file"> | ||
| + | <param name="archive">*.tar</param> | ||
| + | <param name="files">*/deb/* */rpm/obslight.changes */rpm/obslight.spec */rpm/obslight.yaml</param> | ||
| + | </service> | ||
| + | </code> | ||
== Change archive compression == | == Change archive compression == | ||
| + | <code> | ||
| + | <service name="recompress"> | ||
| + | <param name="file">*git*.tar</param> | ||
| + | <param name="compression">gz</param> | ||
| + | </service> | ||
| + | </code> | ||
== Update build-control files == | == Update build-control files == | ||
| + | <code> | ||
| + | <service name="set_version"/> | ||
| + | </code> | ||
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.
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:
<service name="extract_file"> <param name="archive">*.tar</param> <param name="files">*/deb/* */rpm/obslight.changes */rpm/obslight.spec */rpm/obslight.yaml</param> </service>
<service name="recompress"> <param name="file">*git*.tar</param> <param name="compression">gz</param> </service>
<service name="set_version"/>