Meego Wiki
Views

Build Infrastructure/Packagers Developers/CLI Part 1

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Running OSC the first time)
(Running OSC the first time)
Line 28: Line 28:
   $ chmod +x ~/bin/losc  
   $ chmod +x ~/bin/losc  
-
When you're using the public meego osc you should use:
+
When you're using pub meego osc you should use:
   exec osc -Ahttps://api'''.pub'''.meego.com "$@"
   exec osc -Ahttps://api'''.pub'''.meego.com "$@"

Revision as of 15:16, 6 February 2011

Contents

How to use the MeeGo / OBS Command Line Interface

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.

OSC Tool Install

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://download.opensuse.org/repositories/openSUSE:/Tools/Fedora_12/openSUSE:Tools.repo
 # wget http://download.opensuse.org/repositories/openSUSE:/Tools:/MeeGo/Fedora_12/openSUSE:Tools:MeeGo.repo
 # yum install osc

The upstream OBS Tutorial describes more generalities about using the tools.

Running OSC the first time

Prepare to run OSC.

Tip: 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 "$@"

The first time, OSC will ask you some questions:

$ losc ls
 
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>

Tip: Configuring OSC using $HOME/.oscrc

OSC may be customized using the file $HOME/.oscrc. Some hints:

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

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