Difference between revisions of "Development/Building Packages"
(Initial version.) |
|||
(19 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
= How you can build | = Maintenance workflow = | ||
Each package in Maemo Leste uses a specific git-based workflow which makes it easy to track history and maintain in an easy way. | |||
Taking the https://github.com/maemo-leste/libcal/ package as an example - a valid repository contains at least two git branches: | |||
# master | |||
# maemo/beowulf | |||
Ideally, the branches should have no difference, but sometimes this may vary. | |||
Your git repository should contain your code, and a '''debian''' directory - which contains the debian package build logic. | |||
The <i>compat</i> level of the package should be no less than '''9''' and preferably it should use '''debhelper'''. | |||
Once you have your package ready and it builds locally on your Maemo Leste VM/device, there are just a couple more things to | |||
do to make it ready for building on Jenkins: | |||
== The git tag == | |||
In '''debian/changelog''' you should have your package version. It is very important to have a git tag that reflects this version | |||
so Jenkins and jenkins-debian-glue can figure out which revision to build. | |||
Keep in mind that the git tag should '''only''' contain the upstream version and no package revisions or epochs, for example if we have: | |||
<code>libcal (0.3-2) unstable; urgency=medium</code> | |||
Our git tag would be <i>0.3</i>, and '''not''' <i>0.3-2</i> | |||
Once tagged, push the tag to git origin. | |||
NB: The tags are used to checkout the source code itself, the debian directory is always taken from git HEAD, so there is no need to update the tag when changing the packaging (i.e. in debian directory). Tag shall be updated only when there are changes to the source files. | |||
== gbp.conf == | |||
Your '''debian''' directory should contain a file called '''gbp.conf''' with the following contents: | |||
<code> | |||
[DEFAULT] | |||
upstream-tag=%(version)s | |||
</code> | |||
Once all this is in place, make sure that you have a '''maemo/$codename''' branch containing all this ready and pushed. | |||
= How you can build packages = | |||
Building a packages is easier than one might think, it requires roughly the following steps: | Building a packages is easier than one might think, it requires roughly the following steps: | ||
#. Access to a Devuan/Debian system (you can use a [[Virtual_Machine|VM running Maemo Leste]] or a [[:Category:Device|Device running Maemo Leste]]. | #. Access to a Devuan/Debian system (you can use a [[Virtual_Machine|VM running Maemo Leste]] or a [[:Category:Device|Device running Maemo Leste]]. | ||
#. Source code of a package, obtain either via '''git''' or '''apt source <packagename>'''. | #. Source code of a package, obtain either via '''git''' or '''apt source <packagename>''' | ||
#. Build a package using '''dpkg-buildpackage -uc -b''' | #. Install build dependencies (run from source directory): '''sudo apt-get build-dep .''' | ||
#. Build a package using '''dpkg-buildpackage -uc -b''' | |||
You can now install the package you have just built with '''dpkg -i somename.deb''' | You can now install the package you have just built with '''dpkg -i somename.deb''' | ||
Also see: https://wiki.debian.org/HowToPackageForDebian | Also see: https://wiki.debian.org/HowToPackageForDebian | ||
Line 17: | Line 60: | ||
For now, we will take care of updating tags and branches. | For now, we will take care of updating tags and branches. | ||
= How packages end up in the repository = | = How packages end up in the repository = | ||
Line 23: | Line 65: | ||
There are currently two repositories: | There are currently two repositories: | ||
* The main repository: https://maedevu.maemo.org/leste | * The main repository: https://maedevu.maemo.org/leste | ||
* The | * The extras repository: https://maedevu.maemo.org/extras | ||
Packages in this repository get build by Jenkins, to which a select group of people has access. (Parazyd, Wizzup | The packages in the extras repository are not core, but useful applications nonetheless. | ||
The codenames and an /etc/apt/sources.list file entry would look like the following: | |||
<code> | |||
deb https://maedevu.maemo.org/leste beowulf main contrib non-free | |||
deb https://maedevu.maemo.org/extras beowulf main contrib non-free | |||
</code> | |||
Packages in this repository get build by Jenkins, to which a select group of people has access. (Parazyd, Wizzup) | |||
== How packages are built using Jenkins == | == How packages are built using Jenkins == | ||
Read only access to the http frontend: | Read only access to the http frontend: https://phoenix.maemo.org/ (write-access can be granted) | ||
All packages are hosted on https://github.com/maemo-leste and a current list of all the packages in Jenkins can be found here: | All packages are hosted on https://github.com/maemo-leste and a current list of all the packages in Jenkins can be found here: | ||
Line 39: | Line 91: | ||
Every repository has a branch for each release, for example: | Every repository has a branch for each release, for example: | ||
# maemo/ | # maemo/beowulf - main branch for Devuan Beowulf target | ||
# maemo/ | # maemo/beowulf-devel - optional branch for Devuan Beowulf with unstable/testing version | ||
See [[Development/Branches]] for more information on the usual branches flow. | See [[Development/Branches]] for more information on the usual branches flow. | ||
= Maemo Leste Extras = | |||
If you wish to maintain your own package in Maemo Leste, you can apply a package at https://github.com/maemo-leste-extras/bugtracker | |||
Have a look at the README in that repository and open a ticket. | |||
== Consideration for HAM == | |||
For packages built for extras to appear correctly in Hildon Application Manager, be aware that Maemo packaging system | |||
included a few enhancements that HAM assumes. The most important one is that your application will '''only''' appear in HAM if the | |||
<code>debian/control</code> file has a correct <code>section</code> clause as explained on the [https://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing#Sections|Maemo Packaging Wiki]. This wiki page also explains how to have HAM show your application's icon. Note that having an icon showing in HAM is a separate issue from having an icon show up in the application list (Hildon Home). The latter is done through | |||
<code>.desktop</code> files, while the former is done in <code>debian/control</code>. | |||
== Adding an icon to the package in HAM == | |||
In case you want to add an icon that is shown in HAM when listing the packages, we provide a debhelper plugin that can | |||
handle this with a simple PNG file. In your package's debian directory, add your PNG icon as '''maemo-icon.png'''. | |||
Next, have your Build-Depends contain '''maemo-system-services-dev'''. maemo-system-services-dev will pull in the debhelper plugin. | |||
Following this, in your '''debian/control''', under your '''Package''', add the following entry: | |||
<pre> | |||
XB-Maemo-Icon-26: ${maemo:icon26} | |||
</pre> | |||
And finally, in '''debian/rules''', assuming you're using debhelper, add this: | |||
<pre> | |||
override_dh_gencontrol: | |||
dh_maemo_icon | |||
dh_gencontrol | |||
</pre> | |||
Finally, if using quilt, add the icon in '''debian/source/include-binaries''' | |||
<pre>$ echo debian/maemo-icon.png >> debian/source/include-binaries</pre> | |||
Further reading: https://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing#Sections |
Latest revision as of 16:14, 14 April 2021
Maintenance workflow
Each package in Maemo Leste uses a specific git-based workflow which makes it easy to track history and maintain in an easy way.
Taking the https://github.com/maemo-leste/libcal/ package as an example - a valid repository contains at least two git branches:
- master
- maemo/beowulf
Ideally, the branches should have no difference, but sometimes this may vary. Your git repository should contain your code, and a debian directory - which contains the debian package build logic. The compat level of the package should be no less than 9 and preferably it should use debhelper.
Once you have your package ready and it builds locally on your Maemo Leste VM/device, there are just a couple more things to do to make it ready for building on Jenkins:
The git tag
In debian/changelog you should have your package version. It is very important to have a git tag that reflects this version so Jenkins and jenkins-debian-glue can figure out which revision to build.
Keep in mind that the git tag should only contain the upstream version and no package revisions or epochs, for example if we have:
libcal (0.3-2) unstable; urgency=medium
Our git tag would be 0.3, and not 0.3-2
Once tagged, push the tag to git origin.
NB: The tags are used to checkout the source code itself, the debian directory is always taken from git HEAD, so there is no need to update the tag when changing the packaging (i.e. in debian directory). Tag shall be updated only when there are changes to the source files.
gbp.conf
Your debian directory should contain a file called gbp.conf with the following contents:
[DEFAULT]
upstream-tag=%(version)s
Once all this is in place, make sure that you have a maemo/$codename branch containing all this ready and pushed.
How you can build packages
Building a packages is easier than one might think, it requires roughly the following steps:
- . Access to a Devuan/Debian system (you can use a VM running Maemo Leste or a Device running Maemo Leste.
- . Source code of a package, obtain either via git or apt source <packagename>
- . Install build dependencies (run from source directory): sudo apt-get build-dep .
- . Build a package using dpkg-buildpackage -uc -b
You can now install the package you have just built with dpkg -i somename.deb
Also see: https://wiki.debian.org/HowToPackageForDebian
Submitting changes
If you make changes to a package, please submit a pull request for the repository of that package, likely: https://github.com/maemo-leste/PACKAGENAME
For now, we will take care of updating tags and branches.
How packages end up in the repository
There are currently two repositories:
- The main repository: https://maedevu.maemo.org/leste
- The extras repository: https://maedevu.maemo.org/extras
The packages in the extras repository are not core, but useful applications nonetheless.
The codenames and an /etc/apt/sources.list file entry would look like the following:
deb https://maedevu.maemo.org/leste beowulf main contrib non-free
deb https://maedevu.maemo.org/extras beowulf main contrib non-free
Packages in this repository get build by Jenkins, to which a select group of people has access. (Parazyd, Wizzup)
How packages are built using Jenkins
Read only access to the http frontend: https://phoenix.maemo.org/ (write-access can be granted)
All packages are hosted on https://github.com/maemo-leste and a current list of all the packages in Jenkins can be found here:
https://github.com/maemo-leste/jenkins-integration/blob/master/config.py
Every repository has a branch for each release, for example:
- maemo/beowulf - main branch for Devuan Beowulf target
- maemo/beowulf-devel - optional branch for Devuan Beowulf with unstable/testing version
See Development/Branches for more information on the usual branches flow.
Maemo Leste Extras
If you wish to maintain your own package in Maemo Leste, you can apply a package at https://github.com/maemo-leste-extras/bugtracker Have a look at the README in that repository and open a ticket.
Consideration for HAM
For packages built for extras to appear correctly in Hildon Application Manager, be aware that Maemo packaging system
included a few enhancements that HAM assumes. The most important one is that your application will only appear in HAM if the
debian/control
file has a correct section
clause as explained on the Packaging Wiki. This wiki page also explains how to have HAM show your application's icon. Note that having an icon showing in HAM is a separate issue from having an icon show up in the application list (Hildon Home). The latter is done through
.desktop
files, while the former is done in debian/control
.
Adding an icon to the package in HAM
In case you want to add an icon that is shown in HAM when listing the packages, we provide a debhelper plugin that can handle this with a simple PNG file. In your package's debian directory, add your PNG icon as maemo-icon.png. Next, have your Build-Depends contain maemo-system-services-dev. maemo-system-services-dev will pull in the debhelper plugin. Following this, in your debian/control, under your Package, add the following entry:
XB-Maemo-Icon-26: ${maemo:icon26}
And finally, in debian/rules, assuming you're using debhelper, add this:
override_dh_gencontrol: dh_maemo_icon dh_gencontrol
Finally, if using quilt, add the icon in debian/source/include-binaries
$ echo debian/maemo-icon.png >> debian/source/include-binaries
Further reading: https://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Packaging,_Deploying_and_Distributing#Sections