Worldcitizen (Talk | contribs) (→Running OSC the first time) |
|||
| (4 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
| - | = How to use the MeeGo / OBS Command Line | + | = How to use the MeeGo / OBS Command Line Tools = |
| - | Once you've successfully | + | The command line tool `osc' can be used to access OBS services. The following content will show you how to install and configure it. Once you've successfully setuped the OBS command line tool, the next part will show you how to check out packages from the MeeGo project/package for local modification and building. |
| - | == OSC | + | == OSC Installation == |
You will need to install some tools in order to access and build packages. This includes the command line client 'osc', and packages that it relies on. | You will need to install some tools in order to access and build packages. This includes the command line client 'osc', and packages that it relies on. | ||
| - | The easiest method is to use your distribution's package manager to pull the osc package and its requirements. Package repositories for many distributions are available [http:// | + | The easiest method is to use your distribution's package manager to pull the osc package and its requirements. Package repositories for many distributions are available [http://repo.meego.com/MeeGo/tools/repos/ here]. |
For example, with Fedora 12: | For example, with Fedora 12: | ||
# cd /etc/yum.repos.d | # cd /etc/yum.repos.d | ||
| - | # wget http:// | + | # wget http://repo.meego.com/MeeGo/tools/repos/fedora/12/meego-tools.repo |
| - | + | ||
# yum install osc | # yum install osc | ||
The upstream [http://en.opensuse.org/openSUSE:Build_Service_Tutorial OBS Tutorial] describes more generalities about using the tools. | The upstream [http://en.opensuse.org/openSUSE:Build_Service_Tutorial OBS Tutorial] describes more generalities about using the tools. | ||
| - | == | + | == Configuring OSC using $HOME/.oscrc == |
| - | + | OSC should be customized using the file $HOME/.oscrc for OBS service apiurl and the account settings. | |
| + | When you run osc for the first time, the osc itself will create one for you with several questions. And | ||
| + | the following is a stripped sample oscrc: | ||
| - | + | <pre> | |
| - | + | [general] | |
| - | + | apiurl = https://api.meego.com | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | packagecachedir = /var/obs-tmp/osbuild-packagecache | |
| - | + | build-root = /var/obs-tmp/build-root | |
| - | + | debug = 0 | |
| + | http_debug = 0 | ||
| - | + | extra-pkgs = gzip | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | [https://api.meego.com] | |
| + | user=user1 | ||
| + | pass = passwd-in-plain-text | ||
| + | aliases=mg | ||
| + | </pre> | ||
| + | In the above sample, "apiurl", "user", and "pass" keys should be replaced with the valid ones. | ||
| - | == | + | === Tips: su-wrapper setting === |
| - | + | To make it easier to run needed things as root, configure for sudo | |
| + | In $HOME/.oscrc set: | ||
| + | su-wrapper = sudo | ||
| + | And then run 'visudo' and add the line: | ||
| + | <yourlogin> ALL=NOPASSWD: /usr/bin/build | ||
| - | + | === Tips: build-boot setting === | |
| + | If you tend to build for several different architectures/projects, it can be helpful to keep each build-root seperate, in $HOME/.oscrc, set: | ||
| + | build-root = /var/tmp/build-root/%(project)s-%(arch)s-%(package)s | ||
| - | + | === Tips: Multiple OBS configration === | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | To use a different source of packages and build server access, you can easily create a wrapper script to do this for you: | |
| - | + | $ cat > ~/bin/losc | |
| + | #!/bin/bash | ||
| + | exec osc -Ahttps://api.meego.com "$@" | ||
| + | $ chmod +x ~/bin/losc | ||
| + | |||
| + | When you're using pub meego osc you should use: | ||
| + | exec osc -Ahttps://api'''.pub'''.meego.com "$@" | ||
| + | instead of | ||
| + | exec osc -Ahttps://api.meego.com "$@" | ||
== Summary and next steps == | == Summary and next steps == | ||
Contents |
The command line tool `osc' can be used to access OBS services. The following content will show you how to install and configure it. Once you've successfully setuped the OBS command line tool, the next part will show you how to check out packages from the MeeGo project/package for local modification and building.
You will need to install some tools in order to access and build packages. This includes the command line client 'osc', and packages that it relies on.
The easiest method is to use your distribution's package manager to pull the osc package and its requirements. Package repositories for many distributions are available here.
For example, with Fedora 12: # cd /etc/yum.repos.d # wget http://repo.meego.com/MeeGo/tools/repos/fedora/12/meego-tools.repo # yum install osc
The upstream OBS Tutorial describes more generalities about using the tools.
OSC should be customized using the file $HOME/.oscrc for OBS service apiurl and the account settings. When you run osc for the first time, the osc itself will create one for you with several questions. And the following is a stripped sample oscrc:
[general] apiurl = https://api.meego.com packagecachedir = /var/obs-tmp/osbuild-packagecache build-root = /var/obs-tmp/build-root debug = 0 http_debug = 0 extra-pkgs = gzip [https://api.meego.com] user=user1 pass = passwd-in-plain-text aliases=mg
In the above sample, "apiurl", "user", and "pass" keys should be replaced with the valid ones.
To make it easier to run needed things as root, configure for sudo In $HOME/.oscrc set: su-wrapper = sudo And then run 'visudo' and add the line: <yourlogin> ALL=NOPASSWD: /usr/bin/build
If you tend to build for several different architectures/projects, it can be helpful to keep each build-root seperate, in $HOME/.oscrc, set: build-root = /var/tmp/build-root/%(project)s-%(arch)s-%(package)s
To use a different source of packages and build server access, you can easily create a wrapper script to do this for you:
$ cat > ~/bin/losc #!/bin/bash exec osc -Ahttps://api.meego.com "$@" $ chmod +x ~/bin/losc
When you're using pub meego osc you should use:
exec osc -Ahttps://api.pub.meego.com "$@"
instead of
exec osc -Ahttps://api.meego.com "$@"
This guide gave an introduction on how to set up and initialize the 'osc' tool. Next you will check out your project from the server and build it. Click here to open the 2nd part.