Meego Wiki
Views

Build Infrastructure/Packagers Developers/CLI Part 1

From MeeGo wiki
< Build Infrastructure | Packagers Developers(Difference between revisions)
Jump to: navigation, search
m (linuxfoundation.org -> meego.com)
 
(7 intermediate revisions not shown)
Line 1: Line 1:
-
= How to use the MeeGo / OBS Command Line Interface =
+
= How to use the MeeGo / OBS Command Line Tools =
-
Once you've successfully used the the MeeGo / OBS Web Interface, we'll show you how you can check out packages from the Meego project for local modification and building.
+
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 Tool Install ==
+
== 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://software.opensuse.org/download/openSUSE:/Tools/ here].
+
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://download.opensuse.org/repositories/openSUSE:/Tools/Fedora_12/openSUSE:Tools.repo
+
   # wget http://repo.meego.com/MeeGo/tools/repos/fedora/12/meego-tools.repo
-
  # wget http://download.opensuse.org/repositories/openSUSE:/Tools:/MeeGo/Fedora_12/openSUSE:Tools:MeeGo.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.
-
== Running OSC the first time ==
+
== Configuring OSC using $HOME/.oscrc ==
-
Prepare to run OSC.
+
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:
-
Tip: To use a different source of packages and build server access,
+
<pre>
-
you can easily create a wrapper script to do this for you:
+
[general]
-
  $ cat > ~/bin/losc
+
apiurl = https://api.meego.com
-
  #!/bin/bash
+
-
  exec osc -Ahttps://api.meego.com "$@"
+
-
  $ chmod +x ~/bin/losc
+
-
The first time, OSC will ask you some questions:
+
packagecachedir = /var/obs-tmp/osbuild-packagecache
 +
build-root = /var/obs-tmp/build-root
-
$ losc ls
+
debug = 0
-
 
+
http_debug = 0
-
Your user account / password are not configured yet.
+
-
You will be asked for them below, and they will be stored in
+
-
/home/james/.oscrc for future use.
+
-
+
-
Creating osc configuration file /home/james/.oscrc ...
+
-
Username: <login>
+
-
Password: <password>
+
-
done
+
-
*** certificate verify failed at depth 0
+
-
Subject:  /O=build.linux.com/OU=Domain Control Validated/CN=build.linux.com
+
-
Issuer:  /C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certificates.godaddy.com/repository/CN=Go Daddy Secure Certification Authority/serialNumber=07969287
+
-
Valid:  May 14 21:46:46 2010 GMT - Apr 26 21:10:19 2012 GMT
+
-
Fingerprint(MD5):  C13D91AB12008D2F9FD901A8FADDFC75
+
-
Fingerprint(SHA1):  144018EC455C20F395F18879DFD75E5B500B84F0
+
-
Reason: unable to get local issuer certificate
+
-
Reason: certificate not trusted
+
-
Reason: unable to verify the first certificate
+
-
+
-
The server certificate failed verification
+
-
+
-
Would you like to
+
-
0 - quit (default)
+
-
1 - continue anyways
+
-
2 - trust the server certificate permanently
+
-
9 - review the server certificate
+
-
+
-
Enter choice [0129]: 2
+
-
At this point the configuration is complete and osc completes the 'ls' command, listing available build targets. You should see your home project listed, ex: home:<login>
+
extra-pkgs = gzip
-
== Tip: Configuring OSC using $HOME/.oscrc ==
+
[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.
-
OSC may be customized using the file $HOME/.oscrc. Some hints:
+
=== Tips: su-wrapper setting ===
-
To make it easier to run needed things as root, configure for sudo
+
  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
-
In $HOME/.oscrc set:
+
=== Tips: build-boot setting ===
-
  su-wrapper = sudo
+
  If you tend to build for several different architectures/projects, it can be helpful to keep each build-root seperate, in $HOME/.oscrc, set:
-
And then run 'visudo' and add the line:
+
  build-root = /var/tmp/build-root/%(project)s-%(arch)s-%(package)s
-
  <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:
+
=== Tips: Multiple OBS configration ===
-
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 "$@"
== Summary and next steps ==
== Summary and next steps ==

Latest revision as of 21:35, 11 July 2011

Contents

How to use the MeeGo / OBS Command Line Tools

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 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.

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.

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:

[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.

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

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.

Personal tools