The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Osc Setup

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
(add info on mer obs and some useful configs)
Line 1: Line 1:
This page describes how to setup osc
+
This page describes how to setup osc to build for Mer inside the Mer SDK and a some basic osc usage.
 +
 
 +
= Introduction =
 +
 
 +
osc is a tool to interact with OBS servers. It provides many functions including:
 +
 
 +
* Creating, modifying and deleting the information about projects and packages and downloading/uploading their source code and packaging
 +
* Managing the repositories/targets that projects/packages build against
 +
* Preparing and running local builds of packages
 +
* Making and managing requests to modify packages in projects (so called SRs or Submit Requests)
  
 
= Preparation =
 
= Preparation =
  
You'll need a [http://www.meego.com meego.com] account and have the [[Platform_SDK|SDK setup]].
+
You'll need a [http://www.meego.com meego.com] account and have the [[Platform_SDK|Mer Platform SDK]] setup.
  
= Getting Access =
+
== Getting Access ==
  
 
Contact David or Niels to request access to https://api.pub.meego.com
 
Contact David or Niels to request access to https://api.pub.meego.com
  
irc: come to #meego and ask lbt (David) or X-Fade (Niels)
+
irc: come to freenode's #mer or #nemomobile and ask lbt (David) or X-Fade (Niels)
  
 
Email : david@dgreaves.com or niels@maemo.org
 
Email : david@dgreaves.com or niels@maemo.org
  
= Using osc =
+
== Setup osc credentials ==
  
Run osc the first time with
+
Once your account is enabled, run osc the first time with
  osc -A https://api.pub.meego.com ls
+
  osc -A https://api.pub.meego.com ls Mer:Tools
This will ask you to enter your meego.com user account details. Note that it can take up to 10 minutes before you can access the meego API URL after a password change or user account creation.
+
This will ask you to enter your meego.com user account details and will simply return a list of packages in the Mer:Tools project.  
 +
 
 +
(Note that it can take up to 10 minutes before you can access the meego API URL after a password change or user account creation.)
  
 
From now on, you can omit the API URL in the command.
 
From now on, you can omit the API URL in the command.
  osc ls
+
  osc ls Mer:Tools
  
= Using Multiple API URLs =
+
 
 +
== Create a home project ==
 +
 
 +
Visit https://build.pub.meego.com and select the "create home" option.
 +
 
 +
= Setup a Mer build project =
 +
 
 +
For any commands below the ACC environment variable should be set to your OBS username. eg:
 +
 
 +
  export ACC=lbt
 +
 
 +
== Adding repos to your home ==
 +
 
 +
You can add repositories on the OBS or edit them locally with this command which will launch an editor for you:
 +
 
 +
  osc meta proj home:${ACC} -e
 +
 
 +
Use the 'lbt' home project as a guide; it has a target (ie a repository of binaries used to make a build root) for Mer_Core_i486 and looks like this:
 +
 
 +
  <project name="home:lbt">
 +
    <title>lbt's Home Project</title>
 +
    <description></description>
 +
    <person userid="lbt" role="maintainer"/>
 +
    <person userid="lbt" role="bugowner"/>
 +
    <person userid="bossbot" role="maintainer"/>
 +
    <repository name="Mer_Core_i486">
 +
      <path repository="standard" project="Mer:MDS:Core:i586"/>
 +
      <arch>i586</arch>
 +
    </repository>
 +
  </project>
 +
 
 +
If you need to build for ARM too then you can add a suitable target just before the </project> :
 +
 
 +
  <repository name="Mer_Core_armv7hl">
 +
    <path repository="Core_armv7hl" project="Mer:MDS:Core:armv7hl"/>
 +
    <arch>armv8el</arch>
 +
  </repository>
 +
 
 +
See the [[OBS architecture naming]] page for more info.
 +
 
 +
== Creating projects ==
 +
 
 +
You may create sub-projects using the web user interface (see the 'Subprojects' tab for your home project).
 +
 
 +
These are useful for building against different targets; eg a NemoApps project may point at various Nemo build targets.
 +
 
 +
== Creating packages ==
 +
 
 +
To create a package you could do:
 +
 
 +
  osc meta pkg home:${ACC}:tools powertop -F - << EOF
 +
  <package project="home:${ACC}:tools" name="powertop">
 +
    <title>PowerTOP</title>
 +
    <description>
 +
  PowerTOP is a Linux tool to diagnose issues with power consumption and power management. In addition to being a diagnostic tool, PowerTOP also has an interactive mode where you can experiment with various power management settings for cases where the Linux distribution has not enabled those settings.
 +
 +
  https://01.org/powertop/
 +
 +
    </description>
 +
  </package>
 +
  EOF
 +
 
 +
= Tips and Tricks =
 +
 
 +
== Specifying local build targets and cache location ==
 +
 
 +
The ~/.oscrc comments describe how these work. Some useful values are:
 +
 
 +
* build-root : if you can set this to use an SSD it will make a big difference to local builds
 +
* packagecachedir : a large cache can be very useful. It's not cleaned automatically.
 +
 
 +
== Using Multiple API URLs ==
  
 
If you're using osc with other API URLs, you can edit ~/.oscrc and add each of them and assign them aliases
 
If you're using osc with other API URLs, you can edit ~/.oscrc and add each of them and assign them aliases
Line 28: Line 110:
 
  user = your-meego.com-username
 
  user = your-meego.com-username
 
  pass = your-meego.com-password
 
  pass = your-meego.com-password
  aliases = pub-meego, pub.meego
+
  aliases = cobs
 
    
 
    
 
  <nowiki>[https://api.opensuse.org]</nowiki>
 
  <nowiki>[https://api.opensuse.org]</nowiki>
Line 34: Line 116:
 
  pass = password
 
  pass = password
 
  aliases = opensuse
 
  aliases = opensuse
 +
 +
Note the '''apiurl''' value in that file defines the default OBS instance.
  
 
And to use the alias:
 
And to use the alias:
  osc -A pub-meego ls
+
  osc -A cobs ls
 
  osc -A opensuse ls
 
  osc -A opensuse ls
  
= Copying packages between OBS instances =
+
== Copying packages between OBS instances ==
 
It is possible (and quite handy :)) to copy packages between different OBS instances:
 
It is possible (and quite handy :)) to copy packages between different OBS instances:
 
  osc -A source_api copypac -t destination_api source_prj source_pkg destination_prj [destination_pkg]
 
  osc -A source_api copypac -t destination_api source_prj source_pkg destination_prj [destination_pkg]
Line 50: Line 134:
 
  osc -A https://api.opensuse.org copypac -t https://api.pub.meego.com Application:Geo monav home:MartinK:nemo
 
  osc -A https://api.opensuse.org copypac -t https://api.pub.meego.com Application:Geo monav home:MartinK:nemo
  
NOTE: You probably need a user account on both OBS instances.
+
NOTE: You usually need a user account on both OBS instances.

Revision as of 23:51, 7 October 2012

This page describes how to setup osc to build for Mer inside the Mer SDK and a some basic osc usage.

Contents

Introduction

osc is a tool to interact with OBS servers. It provides many functions including:

  • Creating, modifying and deleting the information about projects and packages and downloading/uploading their source code and packaging
  • Managing the repositories/targets that projects/packages build against
  • Preparing and running local builds of packages
  • Making and managing requests to modify packages in projects (so called SRs or Submit Requests)

Preparation

You'll need a meego.com account and have the Mer Platform SDK setup.

Getting Access

Contact David or Niels to request access to https://api.pub.meego.com

irc: come to freenode's #mer or #nemomobile and ask lbt (David) or X-Fade (Niels)

Email : david@dgreaves.com or niels@maemo.org

Setup osc credentials

Once your account is enabled, run osc the first time with

osc -A https://api.pub.meego.com ls Mer:Tools

This will ask you to enter your meego.com user account details and will simply return a list of packages in the Mer:Tools project.

(Note that it can take up to 10 minutes before you can access the meego API URL after a password change or user account creation.)

From now on, you can omit the API URL in the command.

osc ls Mer:Tools


Create a home project

Visit https://build.pub.meego.com and select the "create home" option.

Setup a Mer build project

For any commands below the ACC environment variable should be set to your OBS username. eg:

 export ACC=lbt

Adding repos to your home

You can add repositories on the OBS or edit them locally with this command which will launch an editor for you:

 osc meta proj home:${ACC} -e

Use the 'lbt' home project as a guide; it has a target (ie a repository of binaries used to make a build root) for Mer_Core_i486 and looks like this:

 <project name="home:lbt">
   <title>lbt's Home Project</title>
   <description></description>
   <person userid="lbt" role="maintainer"/>
   <person userid="lbt" role="bugowner"/>
   <person userid="bossbot" role="maintainer"/>
   <repository name="Mer_Core_i486">
     <path repository="standard" project="Mer:MDS:Core:i586"/>
     <arch>i586</arch>
   </repository>
 </project>

If you need to build for ARM too then you can add a suitable target just before the </project> :

 <repository name="Mer_Core_armv7hl">
   <path repository="Core_armv7hl" project="Mer:MDS:Core:armv7hl"/>
   <arch>armv8el</arch>
 </repository>

See the OBS architecture naming page for more info.

Creating projects

You may create sub-projects using the web user interface (see the 'Subprojects' tab for your home project).

These are useful for building against different targets; eg a NemoApps project may point at various Nemo build targets.

Creating packages

To create a package you could do:

 osc meta pkg home:${ACC}:tools powertop -F - << EOF
 <package project="home:${ACC}:tools" name="powertop">
   <title>PowerTOP</title>
   <description>
 PowerTOP is a Linux tool to diagnose issues with power consumption and power management. In addition to being a diagnostic tool, PowerTOP also has an interactive mode where you can experiment with various power management settings for cases where the Linux distribution has not enabled those settings.

 https://01.org/powertop/

   </description>
 </package>
 EOF

Tips and Tricks

Specifying local build targets and cache location

The ~/.oscrc comments describe how these work. Some useful values are:

  • build-root : if you can set this to use an SSD it will make a big difference to local builds
  • packagecachedir : a large cache can be very useful. It's not cleaned automatically.

Using Multiple API URLs

If you're using osc with other API URLs, you can edit ~/.oscrc and add each of them and assign them aliases

[https://api.pub.meego.com/]
user = your-meego.com-username
pass = your-meego.com-password
aliases = cobs
 
[https://api.opensuse.org]
user = username
pass = password
aliases = opensuse

Note the apiurl value in that file defines the default OBS instance.

And to use the alias:

osc -A cobs ls
osc -A opensuse ls

Copying packages between OBS instances

It is possible (and quite handy :)) to copy packages between different OBS instances:

osc -A source_api copypac -t destination_api source_prj source_pkg destination_prj [destination_pkg]

Examples:

With the above mentioned aliases:

osc -A opensuse copypac -t pub-meego Application:Geo monav home:MartinK:nemo

Just with the API URL:

osc -A https://api.opensuse.org copypac -t https://api.pub.meego.com Application:Geo monav home:MartinK:nemo

NOTE: You usually need a user account on both OBS instances.

Personal tools