Editing Mer/Build/Application Building

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{Mer}}
 
-
 
This page assumes you have [[../Install OBS|installed OBS]] and setup an account.
This page assumes you have [[../Install OBS|installed OBS]] and setup an account.
Line 11: Line 9:
== To create a new package ==
== To create a new package ==
-
These osc commands are done in your own area - use your username after "home:" or make sure you are at your [https://build.opensuse.org/project/list_my "Home Project"] on OBS.
+
These osc commands are done in your own area - use your username after "home:" or make sure you are at your "Home Project" on OBS.
Before you can create projects in your home project, you have to create it.
Before you can create projects in your home project, you have to create it.
Line 17: Line 15:
We will use
We will use
* a name of "merpad" (lowercase); this is the ''package'' name
* a name of "merpad" (lowercase); this is the ''package'' name
-
* a title of "MerPad Example"; this is the human readable title
+
* a title of "MerPad Example"; this is the human title
* a description of: "A Mer version of Maemopad. Built on OBS by <yourname>"; this is seen upon installation
* a description of: "A Mer version of Maemopad. Built on OBS by <yourname>"; this is seen upon installation
If you use the CLI interface you can also enter a url.
If you use the CLI interface you can also enter a url.
-
 
-
Obviously, if you have your own source and dsc then amend the details accordingly.
 
==Configure your Home Project to Build against Mer==
==Configure your Home Project to Build against Mer==
-
 
When you upload some source the build-dependencies need to be resolved.  OBS does this by looking at a build target repository; if the dependency isn't there and that repository has its own build target repository then it looks there... and so on.
When you upload some source the build-dependencies need to be resolved.  OBS does this by looking at a build target repository; if the dependency isn't there and that repository has its own build target repository then it looks there... and so on.
Line 40: Line 35:
===Setting up Build Repositories : WWW===
===Setting up Build Repositories : WWW===
-
 
* Click on "Home project" in the left navigation bar in the OBS website
* Click on "Home project" in the left navigation bar in the OBS website
* On the right click on "Add Repository"
* On the right click on "Add Repository"
Line 52: Line 46:
===Setting up Build Repositories : CLI===
===Setting up Build Repositories : CLI===
-
 
To change the build target repositories (part of the project metadata):
To change the build target repositories (part of the project metadata):
-
   osc meta prj home:yourname -e
+
   osc meta prj home:lbt -e
The XML should look like this (make sure you use your own "name=" value) paying special attention to the <code><repository></code> tags:
The XML should look like this (make sure you use your own "name=" value) paying special attention to the <code><repository></code> tags:
-
<source lang="xml">
+
<pre>
<project name="home:yourname">
<project name="home:yourname">
   <title>yourname's Home Project</title>
   <title>yourname's Home Project</title>
Line 69: Line 62:
   </repository>
   </repository>
</project>
</project>
-
</source>
+
</pre>
Here is a full set of [[/XML_Build_Targets|XML Build targets]] for Ubuntu; they aren't needed unless you're doing something clever.
Here is a full set of [[/XML_Build_Targets|XML Build targets]] for Ubuntu; they aren't needed unless you're doing something clever.
==Creating Package==
==Creating Package==
-
 
Each package has its own directory in the project and, by default, is built against any build targets for the project.
Each package has its own directory in the project and, by default, is built against any build targets for the project.
===Creating Package : WWW===
===Creating Package : WWW===
-
 
* Click on "Home project" in the left navigation bar in the OBS website
* Click on "Home project" in the left navigation bar in the OBS website
* Click on "Add Package"
* Click on "Add Package"
-
Note that the 'name' is like a filename (openoffice) whereas 'title' is written out. (Open Office)
+
Fill in the values in the boxes and save changes.
-
 
+
-
(In the XML the name is also fully qualified with a project and :s )
+
-
 
+
-
Fill in the values in the boxes and save changes; we'll use:
+
-
  Name: merpad
+
-
  Title : merpad
+
-
  Description : A test build of Merpad
+
===Creating Package : CLI===
===Creating Package : CLI===
-
 
Run
Run
  osc meta pkg -e home:<username> <package>
  osc meta pkg -e home:<username> <package>
This will tell the OBS server about the package. It pops up an editor where you can edit the name/description in XML format and then save. The XML appears like this:
This will tell the OBS server about the package. It pops up an editor where you can edit the name/description in XML format and then save. The XML appears like this:
-
<source lang="xml">
+
<pre>
<package name="merpad">
<package name="merpad">
   <title>Title of New Package</title>
   <title>Title of New Package</title>
Line 104: Line 87:
HERE
HERE
   </description>
   </description>
-
   <person role="maintainer" userid="username"/>
+
   <person role="maintainer" userid="lbt"/>
-
   <person role="bugowner" userid="username"/>
+
   <person role="bugowner" userid="lbt"/>
   <url>PUT_UPSTREAM_URL_HERE</url>
   <url>PUT_UPSTREAM_URL_HERE</url>
</package>
</package>
Line 120: Line 103:
   </description>
   </description>
-
   <person role="maintainer" userid="username"/>
+
   <person role="maintainer" userid="lbt"/>
-
   <person role="bugowner" userid="username"/>
+
   <person role="bugowner" userid="lbt"/>
   <url>PUT_UPSTREAM_URL_HERE</url>
   <url>PUT_UPSTREAM_URL_HERE</url>
</package>
</package>
-
</source>
+
</pre>
==Uploading Source==
==Uploading Source==
-
 
===Uploading Source : WWW===
===Uploading Source : WWW===
-
 
From your Home Project, you should see a "merpad" entry under Packages.
From your Home Project, you should see a "merpad" entry under Packages.
Select merpad to go to the Package page (you may already be there if you just created it).
Select merpad to go to the Package page (you may already be there if you just created it).
Now click [Add File] and upload the tar.gz and then do it again for the dsc files.
Now click [Add File] and upload the tar.gz and then do it again for the dsc files.
-
 
-
Use these files:
 
-
  http://www.dgreaves.com/pub/merpad_1.0-1.dsc
 
-
  http://www.dgreaves.com/pub/merpad_1.0-1.tar.gz
 
===Uploading Source : CLI===
===Uploading Source : CLI===
Line 152: Line 129:
Once there you can copy in the tarball and dsc file from your application... or in this tutorial we'll get them from the web.
Once there you can copy in the tarball and dsc file from your application... or in this tutorial we'll get them from the web.
-
  wget   http://www.dgreaves.com/pub/merpad_1.0-1.dsc
+
  wget  
-
wget  http://www.dgreaves.com/pub/merpad_1.0-1.tar.gz
+
Then add them to version control
Then add them to version control
Line 167: Line 143:
==Monitoring the Build==
==Monitoring the Build==
-
The OBS builder will now schedule and build the application.
+
The OBS builder will now schedule and build the application
-
 
+
-
Please note that for security reasons the builder is running inside an emulator which is 'killed' when it is finished; so there are alarming messages like <code>Kernel panic - not syncing: Attempted to kill init!</code> and some <code>qemu: Unsupported syscall</code> messages. These can safely be ignored and will be cleaned up one day.
+
===Following the build log : WWW ===
===Following the build log : WWW ===
-
 
In the package page under the build target is a [Build Log] entry.
In the package page under the build target is a [Build Log] entry.
This takes you to a page showing the build log. There are tickboxes to refresh automatically and to autoscroll.
This takes you to a page showing the build log. There are tickboxes to refresh automatically and to autoscroll.
Line 187: Line 160:
==Downloading the Binaries==
==Downloading the Binaries==
-
 
Once OBS has run you can download the binaries and install them by hand.
Once OBS has run you can download the binaries and install them by hand.
Line 209: Line 181:
Then running the application manager should show your MerPad.
Then running the application manager should show your MerPad.
-
==Local Builds==
+
=Local Builds=
OBS lets you run a local build on your desktop.
OBS lets you run a local build on your desktop.
Simply checkout a package:
Simply checkout a package:
-
   osc co home:username/merpad
+
   osc co home:username/maemopad
and run:
and run:
-
   cd home:username/merpad
+
   cd home:username/maemopad
   osc build MerExtrasStable_MerStable_Ubuntu_9.04 armv5el merpad_1.0-1.dsc
   osc build MerExtrasStable_MerStable_Ubuntu_9.04 armv5el merpad_1.0-1.dsc
Line 223: Line 195:
This goes to the server to determine where to get the build-depends (remember the build-target stack) and then downloads them to a local cache. Eventually it installs a bootstrap set to a directory and then does a qemu chroot into it and builds the package.
This goes to the server to determine where to get the build-depends (remember the build-target stack) and then downloads them to a local cache. Eventually it installs a bootstrap set to a directory and then does a qemu chroot into it and builds the package.
-
Note that the following 2 python modules may be required
+
Once it is done you should
-
apt-get install python-m2crypto
+
-
apt-get install python-urlgrabber
+
-
 
+
-
Once it is done you should get a line telling you where the deb is:
+
-
  /scratch3/maemo/Mer/obs/build-MerExtrasStable_MerStable_Ubuntu_9.04-armv5el-merpad/usr/src/packages/DEBS/merpad_1.0-1_armel.deb
+
-
 
+
-
It will ask for a password at one stage.  You can use your local root password for this.  If you get an error complaining about a lack of /usr/lib/common_functions, then create a folder in your home folder, cd into it, and then follow the instructions [http://gitorious.org/mer/build HERE] .  they should ask you to run the command
+
-
 
+
-
  git clone git://gitorious.org/mer/build.git
+
-
 
+
-
in that folder.  This will use git to download a newer 'build' tool for you.  See the pageafter it has finished, run ''make install'' to install the tool, and then go back and run the osc build step again.  It should continue from the password prompt step successfully this time.
+
-
 
+
-
 
+
-
You can also do:
+
-
  sudo chroot /scratch3/maemo/Mer/obs/build-MerExtrasStable_MerStable_Ubuntu_9.04-armv5el-merpad/ su abuild
+
-
and once there, run arm commands inside the chroot.
+
-
=== Co-existing with Scratchbox ===
+
== Co-existing with Scratchbox ==
If you use the OBS local build facility and the scratchbox-1 local builder then you need to know how to teach the two emulators how to co-exist.
If you use the OBS local build facility and the scratchbox-1 local builder then you need to know how to teach the two emulators how to co-exist.
Line 265: Line 221:
to register qemu to handle arm binaries
to register qemu to handle arm binaries
-
A typical error signifying you have this issue is
+
[[Category:Mer]]
-
  Exec format error
+
-
which means the kernel doesn't understand the binary format of the executable.
+

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: