~bzr-pqm/bzr/bzr.dev

3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
1
Managing the Bazaar PPA
2
=======================
3
4
See also: `Bazaar Developer Document Catalog <index.html>`_.
5
6
7
Background
8
----------
9
5430.4.1 by Vincent Ladeuil
Tiny doc cleanups and tweaks for tools/check-newsbugs.py.
10
We build Ubuntu ``.deb`` packages for Bazaar as an important part of the
11
release process.  These packages are hosted in a few `Personal Package
12
Archives (PPA)`__ on Launchpad.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
13
14
  __ https://help.launchpad.net/PPAQuickStart
15
5430.4.1 by Vincent Ladeuil
Tiny doc cleanups and tweaks for tools/check-newsbugs.py.
16
As of September 2010, there are four PPAs:
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
17
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
18
<https://launchpad.net/~bzr/+archive/ppa>
5325.2.1 by Martin Pool
Small updates to PPA packaging instructions
19
    Final released versions and updates.
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
20
    Most users who want updates to bzr should add this.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
21
5380.3.1 by Martin Pool
Slight updates for ppas: new bzr/proposed archive, and list of active distroseries for easy reference
22
<https://launchpad.net/~bzr/+archive/proposed>
23
    Proposed uploads to move into ~bzr, awaiting testing.
24
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
25
<https://launchpad.net/~bzr-beta-ppa/+archive>
5325.2.1 by Martin Pool
Small updates to PPA packaging instructions
26
    Beta releases.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
27
3749.2.1 by Martin Pool
Updated PPA documentation
28
<https://launchpad.net/~bzr-nightly-ppa/+archive>
29
    Automatic nightly builds from trunk.
30
5325.2.1 by Martin Pool
Small updates to PPA packaging instructions
31
We build a distinct package for each distrorelease.  
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
32
If you upload a release-specific version, you should add a suffix to the
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
33
package version, e.g. ``bzr.1.3-1~bazaar1~dapper1``.
34
5325.2.1 by Martin Pool
Small updates to PPA packaging instructions
35
Dapper uses the ``python-support`` framework and later distributions use
36
``python-central``.  This has little effect on everyday packaging but does
37
mean that some of the control files are quite different.
38
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
39
Every package is first uploaded into the beta ppa.  For final release
40
versions it is also copied to the main PPA.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
41
3749.2.2 by Martin Pool
typo
42
The packaging information is kept in branches of bzr on Launchpad, named
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
43
like
5390.1.1 by Max Bowsher
Update references to the PPA packaging branches to use the Launchpad package branch namespace.
44
<https://code.launchpad.net/~bzr/ubuntu/hardy/bzr/bzr-ppa>.
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
45
or
5390.1.1 by Max Bowsher
Update references to the PPA packaging branches to use the Launchpad package branch namespace.
46
<lp:~bzr/ubuntu/hardy/bzr/bzr-ppa>.  These branches are intended to be used
3749.2.1 by Martin Pool
Updated PPA documentation
47
with the ``bzr-builddeb`` plugin.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
48
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
49
**You should almost always upload to the beta ppa first** and then either 
50
upload again or copy the packages into the release ppa.  That reduces the 
51
risk of breaking the main archive from which people get bzr updates.
52
5380.3.1 by Martin Pool
Slight updates for ppas: new bzr/proposed archive, and list of active distroseries for easy reference
53
54
Supported releases
55
------------------
56
57
We build packages for every supported Ubuntu release
58
<https://wiki.ubuntu.com/Releases>.  Packages need no longer be updated
59
when the release passes end-of-life because all users should
60
have upgraded by then.  
61
62
As of August 2010, the following releases are supported:
63
64
* Maverick 
65
* Lucid LTS
66
* Karmic
67
* Jaunty (support ends October 2010)
68
* Hardy LTS
69
* Dapper LTS (supported but no longer updated for new releases)
70
71
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
72
Preconditions
73
-------------
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
74
75
* You must have a Launchpad account and be a member of the teams
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
76
  that own these PPAs (``~bzr``, ``~bzr-beta-ppa``).
77
78
* You must have a GPG key registered to your Launchpad account.
79
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
80
On reasonably recent versions of Ubuntu you no longer need special dput
81
configuration, because you can just say ::
82
5380.2.1 by Gary van der Merwe
Update ppa doc.
83
  dput ppa:bzr/proposed <source.changes
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
84
  
85
86
However, you may still want to add these lines to ``~/.dput.cf`` prevent 
87
inadvertently attempting to upload into Ubuntu or Debian, which will
88
give a somewhat unclear error::
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
89
90
    [DEFAULT]
91
    default_host_main = notspecified
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
92
3749.2.1 by Martin Pool
Updated PPA documentation
93
* Configure ``bzr-builddeb`` to sign the package, which is required for
94
  Launchpad to build it.  Put this in ``~/.bazaar/builddeb.conf`` ::
95
96
      [BUILDDEB]
97
      builder = dpkg-buildpackage -rfakeroot
98
      source-builder= dpkg-buildpackage -rfakeroot -S -sa
99
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
100
* You need a Ubuntu (or probably Debian) machine, and ::
101
4009.1.1 by Vincent Ladeuil
Ppa newcomer updates.
102
    sudo apt-get install build-essential devscripts dput quilt patch libcrypt-ssleay-perl debhelper cdbs python-docutils
103
104
  Please update this document if you encounter unmet dependencies or find a
4009.1.2 by Vincent Ladeuil
Fixed as per Matt, Jelmer and John reviews.
105
  shorter way to express them.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
106
3749.2.1 by Martin Pool
Updated PPA documentation
107
* You will also want to have the `bzr-builddeb`_ plugin installed, which
108
  depends on `bzrtools`_.
109
110
.. _`bzr-builddeb`: http://launchpad.net/bzr-builddeb
111
.. _`bzrtools`: http://launchpad.net/bzrtools
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
112
113
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
114
Packaging Bazaar
115
----------------
116
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
117
Overview of packaging with builddeb
118
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119
120
* First update the oldest supported branch, using ``bzr merge-upstream``.
121
122
* Run ``bzr builddeb -S -- -sa`` to build a source package, then put 
5336.1.2 by Martin Pool
Clarify -S and -sa builddeb flags
123
  that into the ppa.  
124
  
125
  (``-S`` says to make a source-only upload, which is
126
  required for Launchpad's builders.  ``--sa`` says to include the
127
  ``.orig.tgz`` even if this doesn't seem to be the first upload for an
128
  upstream release: this is often needed when rebuilding something that's
129
  previously been uploaded to Debian or Ubuntu or into a different PPA.)
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
130
131
* Now merge across that change into each supported branch with a 
132
  simple ``bzr merge``.
133
  
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
134
Locally testing using pbuilder
135
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
136
137
It may be useful to locally test builds inside pbuilder.  You may want to 
138
use the script from <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=255165> 
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
139
to wrap it, and to give it sensible defaults for your local machine.
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
140
5380.2.1 by Gary van der Merwe
Update ppa doc.
141
Update all packages in proposed before copping the main ppa
142
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143
144
If one updates bzr, and there are plugins that are not compatible with the
145
new version of bzr, this can cause pain for users using the ppa. In order to
146
avoid this, we first get all packages up to date in the proposed ppa, and then
147
copy them to the main ppa.
148
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
149
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
150
Short form
151
~~~~~~~~~~
152
153
For people who have already set up everything they need, building the
154
release packages is as simple as::
155
156
  cd ~/dev/bzr/releases/packaging
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
157
  export VERSION="1.17~rc1-1~bazaar1"
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
158
  export PACKAGE="bzr"
4380.1.4 by John Ferlito
update ubuntu versions
159
  export UBUNTU_RELEASES="dapper hardy intrepid jaunty karmic"
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
160
  ~/dev/bzr/bzr.dev/tools/packaging/update-packaging-branches.sh
5380.2.1 by Gary van der Merwe
Update ppa doc.
161
  * Optionaly merge debian unstable. 
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
162
  ~/dev/bzr/bzr.dev/tools/packaging/update-changelogs.sh
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
163
  ~/dev/bzr/bzr.dev/tools/packaging/update-control.sh 1.16 1.17 1.18
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
164
  ~/dev/bzr/bzr.dev/tools/packaging/build-packages.sh
5380.2.2 by Gary van der Merwe
Fix minor error in previous revision.
165
  dput ppa:bzr/proposed ${PACKAGE}_$VERSION*.changes
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
166
167
Rinse and repeat for all the plugins by changing VERSION and PACKAGE.
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
168
169
Long Form
170
~~~~~~~~~
171
172
#. You will end up checking out a separate directory for each supported
4009.1.1 by Vincent Ladeuil
Ppa newcomer updates.
173
   release. Such as ``~/dev/bzr/releases/packaging/hardy``. In each of these
4009.1.2 by Vincent Ladeuil
Fixed as per Matt, Jelmer and John reviews.
174
   branches, you will produce the package for the release.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
175
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
176
   The scripts will also create the branches and produce packages for
177
   bzrtools and bzr-svn.
178
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
179
#. Decide on the final version number.  It should be of this form::
180
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
181
     bzr-1.17~rc1-1~bazaar1~hardy1
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
182
3749.2.1 by Martin Pool
Updated PPA documentation
183
   **Note:** There are three hyphen-separated parts: the *package name*,
184
   the *upstream version*, and the *packaging version*.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
185
186
   **Caution:** Upstream betas or release candidates must insert a tilde
187
   to make them sort before the final release, like this:
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
188
   ``bzr-1.17~rc1-1~bazaar1~hardy1``.
3641.4.2 by Martin Albisetti
More fixes to address jam's comments. Made all bzr versions in the examples the same.
189
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
190
   Final releases will use a release string of the form:
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
191
   ``bzr-1.17-1~bazaar1~hardy1``
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
192
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
193
   Set this base of this up as a usable environment variable::
194
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
195
      export VERSION="1.17~rc1-1~bazaar1"
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
196
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
197
#. Export the distroreleases that you will be packaging for::
198
4380.1.4 by John Ferlito
update ubuntu versions
199
      export UBUNTU_RELEASES="dapper hardy intrepid jaunty karmic"
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
200
201
#. Export the program you are packaging::
202
203
      export PACKAGE="bzr"
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
204
205
#. Checkout (or update) the packaging branch for each supported release::
206
5390.1.1 by Max Bowsher
Update references to the PPA packaging branches to use the Launchpad package branch namespace.
207
      bzr co lp:~bzr/ubuntu/hardy/bzr/bzr-ppa
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
208
209
   There is a script available to help::
210
211
      tools/packaging/update-packaging-branches.sh
212
5380.2.1 by Gary van der Merwe
Update ppa doc.
213
#. Optionaly, merge the Debian unstable branch into each of the packaging
214
   branches. You can find the Debian unstable branch here:
215
   http://bzr.debian.org/pkg-bazaar/
216
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
217
#. The ``bzr-builddeb`` step will download the original tarball if you do
3749.2.1 by Martin Pool
Updated PPA documentation
218
   not already have it, putting it into a ``tarballs`` directory.
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
219
220
#. For Bazaar plugins, change the ``debian/control`` file to express a
221
   dependency on the correct version of ``bzr``.
222
223
   For bzrtools this is typically::
224
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
225
      Build-Depends-Indep: bzr (>= 1.17~), rsync
226
      Depends: ${python:Depends}, bzr (>= 1.17~), bzr (<< 1.18~), patch
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
227
4380.1.8 by John Ferlito
Update versions
228
   There is a helper script which will update the control file and commit it
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
229
   for all of your ``$UBUNTU_RELEASES``. It is available as::
230
231
    tools/packaging/update-control.sh
232
4380.1.8 by John Ferlito
Update versions
233
   You must supply the versions as arguments as follows
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
234
   OLD_VERSION CURRENT_VERSION NEXT_VERSION, such as::
235
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
236
    tools/packaging/update-control.sh 1.16 1.17 1.18
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
237
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
238
#. Make a new ``debian/changelog`` entry for the new release,
239
   either by using ``dch`` or just editing the file::
240
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
241
      dch -v '1.17~rc1-1~bazaar1~hardy1' -D hardy
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
242
243
   dch will default to the distro you're working in and this isn't checked
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
244
   against the version number (which is just our convention), so make sure
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
245
   to specify it.
246
4009.1.1 by Vincent Ladeuil
Ppa newcomer updates.
247
   Make sure you have the correct email address for yourself (you may need
4009.1.2 by Vincent Ladeuil
Fixed as per Matt, Jelmer and John reviews.
248
   export DEBEMAIL=`bzr whoami` if it isn't already set), version number, and
4009.1.1 by Vincent Ladeuil
Ppa newcomer updates.
249
   distribution.  It should look something like this::
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
250
4665.4.2 by John Ferlito
update version numbers in ppa.txt examples
251
       bzr (1.17~rc1-1~bazaar1~hardy1) hardy; urgency=low
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
252
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
253
        * New upstream release.
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
254
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
255
       -- John Sample <sample@example.com>  Mon, 31 Mar 2008 12:36:27 +1100
256
257
   If you need to upload the package again to fix a problem, normally you
258
   should increment the last number in the version number, following the
259
   distro name.  Make sure not to omit the initial ``-1``, and make sure
260
   that the distro name in the version is consistent with the target name
261
   outside the parenthesis.
262
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
263
   You will also want to commit these changes into the packaging branch.
264
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
265
   There is a helper script which will build all the packages
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
266
   for all of your ``$UBUNTU_RELEASES``. It is available as::
267
268
      tools/packaging/update-changelogs.sh
269
270
#. Build the source packages::
271
5390.1.1 by Max Bowsher
Update references to the PPA packaging branches to use the Launchpad package branch namespace.
272
      cd bzr-$DISTRO; bzr builddeb -S
3649.4.1 by John Arbash Meinel
Merge in Lukáš's helper scripts.
273
3749.2.1 by Martin Pool
Updated PPA documentation
274
   This will create a ``.changes`` file.  If you didn't configure builddeb
275
   to automatically sign them, you can use ::
276
277
      debsign -m$UID *.changes
278
279
   where ``$UID`` is the gpg key you want to use to sign the changes.
280
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
281
   There is a helper script which will build the package
282
   for all of your ``$UBUNTU_RELEASES``. It is available as::
283
284
      tools/packaging/build-packages.sh
285
5380.2.1 by Gary van der Merwe
Update ppa doc.
286
#. Upload into the PPA for each release::
287
288
     dput dput ppa:bzr/proposed bzr*1.17-1*.changes
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
289
290
#. You should soon get an "upload accepted" mail from Launchpad, which
291
   means that your package is waiting to be built.  You can then track its
292
   progress in <https://launchpad.net/~bzr-beta-ppa/+archive> and
293
   <https://launchpad.net/~bzr-beta-ppa/+archive/+builds>.
294
295
3870.1.1 by Martin Pool
Add some notes on ppa packaging of bzr-svn
296
Packaging bzr-svn
297
~~~~~~~~~~~~~~~~~
298
4853.1.1 by Patrick Regan
Removed trailing whitespace from files in doc directory
299
bzr-svn uses a packaging branch that contains both the source
3960.4.1 by Jelmer Vernooij
Remove unnecessary commands for building bzr-svn.
300
(including any changes against upstream) and the ``debian/`` directory.
3870.1.1 by Martin Pool
Add some notes on ppa packaging of bzr-svn
301
302
To build bzr-svn:
303
304
#. Get a checkout of ``lp:~bzr/bzr-svn/hardy-ppa/``
305
4380.1.2 by John Ferlito
Fix typo and bzr-svn branch name in ppa.txt
306
#. Merge from ``http://bzr.debian.org/pkg-bazaar/bzr-svn/unstable/``
4380.1.8 by John Ferlito
Update versions
307
3870.1.2 by Martin Pool
Note about merging bzr-svn from jelmer's branch
308
   This should bring in both upstream and packaging changes for the new
309
   release, and it's updated as part of the bzr-svn release process.
310
4380.1.1 by John Ferlito
Update packaging scripts to make deployment a bit easier
311
   It's quite possible you will need to resolve some conflicts.
312
3870.1.1 by Martin Pool
Add some notes on ppa packaging of bzr-svn
313
#. Run ``dch -v 0.4.15-1~bazaar1-hardy1 -D hardy`` or similar
314
315
#. Run ``bzr builddeb --source``
316
317
   bzr-builddeb will automatically check out the appropriate tag from the
318
   main branch of bzr-svn, build, and package it.
319
320
#. ``dput bzr-beta-ppa ../bzr-svn_0.4.15-1~bazaar1~hardy1_source.changes``
321
322
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
323
Monitoring the contents of PPAs
324
-------------------------------
325
326
If you add all the bzr PPAs to your ``sources.list`` then you can see a
327
summary of current package versions with::
328
329
  apt-cache madison bzr
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
330
  
331
  
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
332
Testing the contents of the PPA
333
-------------------------------
334
335
A somewhat crude but useful way to test the contents of the PPA is to
336
install the relevant packages into an schroot::
337
338
 schroot -c hardy-test -u root -- \
339
   apt-get install -o 'APT::Install-Suggests="true"' \
340
   -o 'APT::Install-Recommends="true"' \
341
   bzr
342
343
This should make sure everything can be installed; it won't guarantee that 
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
344
  
5418.2.2 by Martin Pool
Small tweaks to ppa guidance
345
5336.1.1 by Martin Pool
Slightly improved docs about ppa packaging
346
Packaging dependencies
347
----------------------
348
349
Some of our updates to bzr in previous releases require backports of our
350
dependencies.  Specific branches holding these backports:
351
352
 * ``lp:~bzr/ubuntu/dapper/configobj/dapper-backport``
3549.3.1 by Martin Pool
Updated instructions in packaging into the PPA
353
354
355
..
356
   vim: filetype=rst textwidth=74 ai shiftwidth=4