Editing Building packages with sbdmock

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 7: Line 7:
The sbdmock git source tree can be accessed at: http://github.com/kad/sbdmock/tree/master
The sbdmock git source tree can be accessed at: http://github.com/kad/sbdmock/tree/master
-
== Why use sbdmock? ==
+
= Why use sbdmock? =
Before submitting a package to the autobuilder, it is important to test that it will build.  The first step of that is to use ''dpkg-buildpackage'' in the scratchbox environment to create the packages (or a tool like [http://mud-builder.garage.maemo.org/ mud-builder] can be used, which automatically calls ''dpkg-buildpackage'').
Before submitting a package to the autobuilder, it is important to test that it will build.  The first step of that is to use ''dpkg-buildpackage'' in the scratchbox environment to create the packages (or a tool like [http://mud-builder.garage.maemo.org/ mud-builder] can be used, which automatically calls ''dpkg-buildpackage'').
Line 15: Line 15:
''sbdmock'' allows you to test your build in a clean scratchbox target, just like the autobuilder uses.  Of course, if the build in sbdmock fails you will need to debug it.  sbdmock can be used for that as well.
''sbdmock'' allows you to test your build in a clean scratchbox target, just like the autobuilder uses.  Of course, if the build in sbdmock fails you will need to debug it.  sbdmock can be used for that as well.
-
== Getting sbdmock ==
+
= Getting sbdmock =
This is the procedure I used, using Debian squeeze.  Packages for sbdmock may be available for your platform, however I wanted to use the latest development version and, as I expected to make changes to it, I did not want to install it into system directories.
This is the procedure I used, using Debian squeeze.  Packages for sbdmock may be available for your platform, however I wanted to use the latest development version and, as I expected to make changes to it, I did not want to install it into system directories.
-
<ol>
+
1. Install Debian packages for ''git-core'', ''python-pip'', ''python-setuptools'' and ''python-virtualenv'' using:
-
<li>
+
 
-
Install Debian packages for ''git-core'', ''python-pip'', ''python-setuptools'' and ''python-virtualenv'' using:<pre>sudo aptitude install git-core python-pip python-setuptools python-virtualenv</pre>
+
'''sudo aptitude install git-core python-pip python-setuptools python-virtualenv'''
-
</li>
+
 
-
<li>
+
2. Create the python virtual environment:
-
Create the Python virtual environment:<pre>virtualenv sbdmock</pre>
+
 
-
</li>
+
'''virtualenv sbdmock'''
-
<li>
+
 
-
Install minideblib, which is a prerequisite for using sbdmock:<pre>pip install -E sbdmock minideblib</pre>
+
3. Install minideblib, which is a prerequisite for using sbdmock:
-
</li>
+
 
-
<li>
+
'''pip install -E sbdmock minideblib'''
-
Install sbdmock from the git repository:<pre>pip install -E sbdmock -e git://github.com/kad/sbdmock.git#egg=sbdmock</pre>
+
 
-
</li>
+
4. Install sbdmock from the git repository:
-
<li>
+
 
-
Copy the config files to your sbdmock config directory:
+
'''pip install -E sbdmock -e git://github.com/kad/sbdmock.git#egg=sbdmock'''
-
<pre>
+
 
-
mkdir ~/.sbdmock/
+
5. Copy the config files to your sbdmock config directory:
-
cp sbdmock/src/sbdmock/etc/*.cfg ~/.sbdmock/
+
 
-
</pre>
+
'''mkdir ~/.sbdmock/'''
-
</li>
+
'''cp sbdmock/src/sbdmock/etc/*.cfg ~/.sbdmock/'''
-
<li>
+
 
-
Test the sbdmock installation:<pre>sbdmock/bin/sbdmock --help</pre>
+
6. Test the sbdmock installation:
-
</li>
+
 
-
</ol>
+
'''sbdmock/bin/sbdmock --help'''
Alternatively, if you are on a Debian based system, you might prefer to build and install Debian packages instead:
Alternatively, if you are on a Debian based system, you might prefer to build and install Debian packages instead:
<ol>
<ol>
-
<li>
+
<li>Install ''git-core'', ''python-setuptools'' and ''dpkg-dev'':</li>
-
Install ''git-core'', ''python-setuptools'' and ''dpkg-dev'':<pre>sudo aptitude install git-core python-setuptools dpkg-dev</pre>
+
'''sudo aptitude install git-core python-setuptools dpkg-dev
-
</li>
+
<li>Download latest minideblib tarball from http://pypi.python.org/pypi/minideblib</li>
-
<li>
+
<li>Unpack it and build the .deb package:</li>
-
Download latest minideblib tarball from http://pypi.python.org/pypi/minideblib
+
'''tar -xvzf minideblib-*.tar.gz
-
</li>
+
'''cd minideblib-*/
-
<li>
+
'''dpkg-buildpackage -us -uc -rfakeroot
-
Unpack it and build the .deb package:
+
<li>Download sbdmock sources:</li>
-
<pre>
+
'''git clone git://github.com/kad/sbdmock.git sbdmock
-
tar -xvzf minideblib-*.tar.gz
+
<li>Build sbdmock .deb package:</li>
-
cd minideblib-*/
+
'''dpkg-buildpackage -us -uc -rfakeroot -i.git -I.git
-
dpkg-buildpackage -us -uc -rfakeroot
+
<li>Install the built .deb packages:</li>
-
</pre>
+
'''dpkg -i python-minideblib*.deb sbdmock*.deb
-
</li>
+
<li>Copy the config files to your sbdmock config directory:</li>
-
<li>
+
'''mkdir ~/.sbdmock/
-
Download sbdmock sources:<pre>git clone git://github.com/kad/sbdmock.git sbdmock</pre>
+
'''cp /usr/share/doc/sbdmock/examples/*.cfg ~/.sbdmock/
-
</li>
+
<li>Test the sbdmock installation:</li>
-
<li>
+
'''sbdmock --help
-
Build sbdmock .deb package:<pre>dpkg-buildpackage -us -uc -rfakeroot -i.git -I.git</pre>
+
-
</li>
+
-
<li>
+
-
Install the built .deb packages:<pre>dpkg -i python-minideblib*.deb sbdmock*.deb</pre>
+
-
</li>
+
-
<li>
+
-
Copy the config files to your sbdmock config directory:
+
-
<pre>
+
-
mkdir ~/.sbdmock/
+
-
cp /usr/share/doc/sbdmock/examples/*.cfg ~/.sbdmock/
+
-
</pre>
+
-
</li>
+
-
<li>
+
-
Test the sbdmock installation:<pre>sbdmock --help</pre>
+
-
</li>
+
</ol>
</ol>
-
== sbdmock documentation ==
+
= sbdmock documentation =
There is no documentation.  ''sbdmock --help'' gives:
There is no documentation.  ''sbdmock --help'' gives:
Line 115: Line 100:
</pre>
</pre>
-
== sbdmock configuration ==
+
= sbdmock configuration =
The most important part of the configuration is to put the rootstraps where sbdmock can find them.   
The most important part of the configuration is to put the rootstraps where sbdmock can find them.   
-
The rootstrap file names are specified in the configuration files (for example the standard chinook configuration file specifies ''maemo-sdk-rootstrap_4.0_armel.tgz'' as the rootstrap file name). Be aware that the rootstrap file names are relative to your scratchbox home directory. So, you have three options:
+
The rootstrap file names are specified in the configuration files (for example the standard chinook configuration file specifies ''maemo-sdk-rootstrap_4.0_armel.tgz'' as the rootstrap file name). Be aware that the rootstrap file names are relative to your scratchbox home directory. So, you have three options:
 +
 
 +
1) Put the rootstrap files in your scratchbox home directory.  This is easiest and means no changes to the configuration files.  However, depending on how you installed the SDK, they are almost certainly not in that directory at the moment.
 +
 
 +
2) Put a softlink in the scratchbox home directory by logging in to scratchbox'' and using something like:
 +
 
 +
'''ln -s /some/directory/maemo-sdk-rootstrap_4.0_armel.tgz'''
 +
 
 +
Note that this directory has be be accessible from within the scratchbox environment, of course.
-
# Put the rootstrap files in your scratchbox home directory.  This is easiest and means no changes to the configuration files. However, depending on how you installed the SDK, they are almost certainly not in that directory at the moment.
+
3) Edit the configuration file to change the location.  The configuration file is in the ''~/.sbdmock'' directory and the line to change is the one which defines ''<nowiki>config_opts['rootstrap']</nowiki>''.  Again, the file has to be accessible from within the scratchbox environment.
-
# Put a softlink in the scratchbox home directory by logging in to Scratchbox and using something like:<pre>ln -s /some/directory/maemo-sdk-rootstrap_4.0_armel.tgz</pre>Note that this directory has to be accessible from within the Scratchbox environment, of course.
+
-
# Edit the configuration file to change the location.  The configuration file is in the <code>~/.sbdmock</code> directory and the line to change is the one which defines ''<nowiki>config_opts['rootstrap']</nowiki>''.  Again, the file has to be accessible from within the scratchbox environment.
+
Currently the following config files are shipped with sbdmock, although others may be added soon:
Currently the following config files are shipped with sbdmock, although others may be added soon:
-
{| class="wikitable"
+
{| class="wikitable" border="1"
! Configuration name !! SDK version !! Architecture !! Repository !! Rootstrap
! Configuration name !! SDK version !! Architecture !! Repository !! Rootstrap
|-
|-
Line 149: Line 140:
'''Note:''' the ''extras'' configurations are not used by the autobuilder: all building is done in extras-devel.
'''Note:''' the ''extras'' configurations are not used by the autobuilder: all building is done in extras-devel.
-
== Test build ==
+
= Test build =
To test the package defined in ''something.dsc'' will build using the chinook autobuilder use the following command:
To test the package defined in ''something.dsc'' will build using the chinook autobuilder use the following command:
-
  sbdmock/bin/sbdmock -r maemo-chinook-armel-extras-devel -u ''something.dsc''
+
  '''sbdmock/bin/sbdmock -r maemo-chinook-armel-extras-devel -u ''something.dsc'''''
This command must be issued from '''outside''' the scratchbox environment.
This command must be issued from '''outside''' the scratchbox environment.
Line 161: Line 152:
Once the ''-armel-extras-devel'' build is working, it is worth testing ''-i386-extras-devel'', which the autobuilder will build automatically unless your package defines that it is only for armel. Note that the autobuilder never uses the ''-extras'' configurations.
Once the ''-armel-extras-devel'' build is working, it is worth testing ''-i386-extras-devel'', which the autobuilder will build automatically unless your package defines that it is only for armel. Note that the autobuilder never uses the ''-extras'' configurations.
-
== Debugging build problems ==
+
= Debugging build problems =
The test builds described above use the ''sbdmock -u'' option.  This option causes sbdmock to create a completely new scratchbox target, with a unique name, run the build and delete the target again.  This is ideal for automatic builds and test builds but it is not useful when you want to debug a failing build.  In that case, you would like the scratchbox target to remain around so that you can select it and do debugging to see why your build failed, and fix it.
The test builds described above use the ''sbdmock -u'' option.  This option causes sbdmock to create a completely new scratchbox target, with a unique name, run the build and delete the target again.  This is ideal for automatic builds and test builds but it is not useful when you want to debug a failing build.  In that case, you would like the scratchbox target to remain around so that you can select it and do debugging to see why your build failed, and fix it.
Line 169: Line 160:
For example:
For example:
-
  sbdmock/bin/sbdmock -r maemo-chinook-armel-extras-devel --sbtarget TEST_40_ARMEL ''something.dsc''
+
  '''sbdmock/bin/sbdmock -r maemo-chinook-armel-extras-devel --sbtarget TEST_40_ARMEL ''something.dsc'''''
'''Note:''' currently sbdmock does not actually recreate the target completely, so it is important that you specify a target which has the correct compiler, devkit and CPU transparency settings for the configuration you are using.  In other words, use a target which was set up for the correct version of the SDK and the correct architecture.
'''Note:''' currently sbdmock does not actually recreate the target completely, so it is important that you specify a target which has the correct compiler, devkit and CPU transparency settings for the configuration you are using.  In other words, use a target which was set up for the correct version of the SDK and the correct architecture.

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)