The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)
Osc Setup
(meego->mer) |
(meego->mer) |
||
Line 29: | Line 29: | ||
== Create a home project == | == Create a home project == | ||
− | Visit https://build. | + | Visit https://build.merproject.org and select the "create home" option. |
= Setup a Mer build project = | = Setup a Mer build project = |
Revision as of 09:49, 23 March 2014
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
Just use your Mer Project username (from the Mer bugzilla)
Setup osc credentials
Once your account is enabled, run osc the first time with
osc -A https://api.merproject.org ls mer-tools:devel
This will ask you to enter your merproject.org user account details and will simply return a list of packages in the devel level mer-tools project.
From now on, you can omit the API URL in the command.
osc ls mer-tools:devel
Create a home project
Visit https://build.merproject.org 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 prj 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.