~bzr-pqm/bzr/bzr.dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
Managing the Bazaar PPA
=======================

See also: `Bazaar Developer Document Catalog <index.html>`_.


Background
----------

We build Ubuntu ``.deb`` packages for Bazaar as an important part of the release
process.  These packages are hosted in a few `Personal Package Archives (PPA)`__ on
Launchpad.

  __ https://help.launchpad.net/PPAQuickStart

As of June 2010, there are three PPAs:

<https://launchpad.net/~bzr/+archive>
    Final released versions and updates.

<https://launchpad.net/~bzr-beta-ppa/+archive>
    Beta releases.

<https://launchpad.net/~bzr-nightly-ppa/+archive>
    Automatic nightly builds from trunk.

We build packages for every supported Ubuntu release
<https://wiki.ubuntu.com/Releases>.  Packages need no longer be updated
when the release passes end-of-life because all users should
have upgraded by then.  

We build a distinct package for each distrorelease.  
If you upload a release-specific version, you should add a suffix to the
package version, e.g. ``bzr.1.3-1~bazaar1~dapper1``.

Dapper uses the ``python-support`` framework and later distributions use
``python-central``.  This has little effect on everyday packaging but does
mean that some of the control files are quite different.

Every package is first uploaded into the beta ppa.  For final release
versions it is also copied to the main PPA.

The packaging information is kept in branches of bzr on Launchpad, named
like
<https://code.launchpad.net/~bzr/bzr/packaging-hardy>.
or
<lp:~bzr/bzr/packaging-hardy>.  These branches are intended to be used
with the ``bzr-builddeb`` plugin.

Preconditions
-------------

* You must have a Launchpad account and be a member of the teams
  that own these PPAs (``~bzr``, ``~bzr-beta-ppa``).

* You must have a GPG key registered to your Launchpad account.

* Configure ``dput`` to upload to our PPA with this section in your
  ``~/.dput.cf``::

    [bzr-beta-ppa]
    fqdn = ppa.launchpad.net
    method = ftp
    incoming = ~bzr-beta-ppa/ubuntu
    login = anonymous
    allow_unsigned_uploads = 0

    [bzr-ppa]
    fqdn = ppa.launchpad.net
    method = ftp
    incoming = ~bzr/ubuntu
    login = anonymous
    allow_unsigned_uploads = 0

  You may also want to add these lines to prevent inadvertently attempting
  to upload into Ubuntu or Debian, which will give a somewhat unclear
  error::

    [DEFAULT]
    default_host_main = notspecified

* Configure ``bzr-builddeb`` to sign the package, which is required for
  Launchpad to build it.  Put this in ``~/.bazaar/builddeb.conf`` ::

      [BUILDDEB]
      builder = dpkg-buildpackage -rfakeroot
      source-builder= dpkg-buildpackage -rfakeroot -S -sa

* You need a Ubuntu (or probably Debian) machine, and ::

    sudo apt-get install build-essential devscripts dput quilt patch libcrypt-ssleay-perl debhelper cdbs python-docutils

  Please update this document if you encounter unmet dependencies or find a
  shorter way to express them.

* You will also want to have the `bzr-builddeb`_ plugin installed, which
  depends on `bzrtools`_.

.. _`bzr-builddeb`: http://launchpad.net/bzr-builddeb
.. _`bzrtools`: http://launchpad.net/bzrtools


Packaging Bazaar
----------------

Short form
~~~~~~~~~~

For people who have already set up everything they need, building the
release packages is as simple as::

  cd ~/dev/bzr/releases/packaging
  export VERSION="1.17~rc1-1~bazaar1"
  export PACKAGE="bzr"
  export UBUNTU_RELEASES="dapper hardy intrepid jaunty karmic"
  ~/dev/bzr/bzr.dev/tools/packaging/update-packaging-branches.sh
  ~/dev/bzr/bzr.dev/tools/packaging/update-changelogs.sh
  ~/dev/bzr/bzr.dev/tools/packaging/update-control.sh 1.16 1.17 1.18
  ~/dev/bzr/bzr.dev/tools/packaging/build-packages.sh
  dput bzr-beta-ppa ${PACKAGE}_$VERSION*.changes

Rinse and repeat for all the plugins by changing VERSION and PACKAGE.

Long Form
~~~~~~~~~

#. You will end up checking out a separate directory for each supported
   release. Such as ``~/dev/bzr/releases/packaging/hardy``. In each of these
   branches, you will produce the package for the release.

   The scripts will also create the branches and produce packages for
   bzrtools and bzr-svn.

#. Decide on the final version number.  It should be of this form::

     bzr-1.17~rc1-1~bazaar1~hardy1

   **Note:** There are three hyphen-separated parts: the *package name*,
   the *upstream version*, and the *packaging version*.

   **Caution:** Upstream betas or release candidates must insert a tilde
   to make them sort before the final release, like this:
   ``bzr-1.17~rc1-1~bazaar1~hardy1``.

   Final releases will use a release string of the form:
   ``bzr-1.17-1~bazaar1~hardy1``

   Set this base of this up as a usable environment variable::

      export VERSION="1.17~rc1-1~bazaar1"

#. Export the distroreleases that you will be packaging for::

      export UBUNTU_RELEASES="dapper hardy intrepid jaunty karmic"

#. Export the program you are packaging::

      export PACKAGE="bzr"

#. Checkout (or update) the packaging branch for each supported release::

      bzr co lp:~bzr/bzr/packaging-hardy

   There is a script available to help::

      tools/packaging/update-packaging-branches.sh

#. The ``bzr-builddeb`` step will download the original tarball if you do
   not already have it, putting it into a ``tarballs`` directory.

#. For Bazaar plugins, change the ``debian/control`` file to express a
   dependency on the correct version of ``bzr``.

   For bzrtools this is typically::

      Build-Depends-Indep: bzr (>= 1.17~), rsync
      Depends: ${python:Depends}, bzr (>= 1.17~), bzr (<< 1.18~), patch

   There is a helper script which will update the control file and commit it
   for all of your ``$UBUNTU_RELEASES``. It is available as::

    tools/packaging/update-control.sh

   You must supply the versions as arguments as follows
   OLD_VERSION CURRENT_VERSION NEXT_VERSION, such as::

    tools/packaging/update-control.sh 1.16 1.17 1.18

#. Make a new ``debian/changelog`` entry for the new release,
   either by using ``dch`` or just editing the file::

      dch -v '1.17~rc1-1~bazaar1~hardy1' -D hardy

   dch will default to the distro you're working in and this isn't checked
   against the version number (which is just our convention), so make sure
   to specify it.

   Make sure you have the correct email address for yourself (you may need
   export DEBEMAIL=`bzr whoami` if it isn't already set), version number, and
   distribution.  It should look something like this::

       bzr (1.17~rc1-1~bazaar1~hardy1) hardy; urgency=low

        * New upstream release.

       -- John Sample <sample@example.com>  Mon, 31 Mar 2008 12:36:27 +1100

   If you need to upload the package again to fix a problem, normally you
   should increment the last number in the version number, following the
   distro name.  Make sure not to omit the initial ``-1``, and make sure
   that the distro name in the version is consistent with the target name
   outside the parenthesis.

   You will also want to commit these changes into the packaging branch.

   There is a helper script which will build all the packages
   for all of your ``$UBUNTU_RELEASES``. It is available as::

      tools/packaging/update-changelogs.sh

#. Build the source packages::

      cd packaging-$DISTRO; bzr builddeb -S

   This will create a ``.changes`` file.  If you didn't configure builddeb
   to automatically sign them, you can use ::

      debsign -m$UID *.changes

   where ``$UID`` is the gpg key you want to use to sign the changes.

   There is a helper script which will build the package
   for all of your ``$UBUNTU_RELEASES``. It is available as::

      tools/packaging/build-packages.sh

#. Upload into the beta PPA for each release::

     dput bzr-beta-ppa bzr*1.17-1*.changes

#. For final release versions, also copy it into the ``~bzr`` PPA::

     dput bzr-ppa ../bzr_1.17-1\~bazaar1\~hardy1\_source.changes

   Alternatively, you can use Launchpad's "copy" feature to copy the
   packages between repositories.

#. You should soon get an "upload accepted" mail from Launchpad, which
   means that your package is waiting to be built.  You can then track its
   progress in <https://launchpad.net/~bzr-beta-ppa/+archive> and
   <https://launchpad.net/~bzr-beta-ppa/+archive/+builds>.


Packaging bzr-svn
~~~~~~~~~~~~~~~~~

bzr-svn uses a packaging branch that contains both the source
(including any changes against upstream) and the ``debian/`` directory.

To build bzr-svn:

#. Get a checkout of ``lp:~bzr/bzr-svn/hardy-ppa/``

#. Merge from ``http://bzr.debian.org/pkg-bazaar/bzr-svn/unstable/``

   This should bring in both upstream and packaging changes for the new
   release, and it's updated as part of the bzr-svn release process.

   It's quite possible you will need to resolve some conflicts.

#. Run ``dch -v 0.4.15-1~bazaar1-hardy1 -D hardy`` or similar

#. Run ``bzr builddeb --source``

   bzr-builddeb will automatically check out the appropriate tag from the
   main branch of bzr-svn, build, and package it.

#. ``dput bzr-beta-ppa ../bzr-svn_0.4.15-1~bazaar1~hardy1_source.changes``


Monitoring the contents of PPAs
-------------------------------

If you add all the bzr PPAs to your ``sources.list`` then you can see a
summary of current package versions with::

  apt-cache madison bzr


..
   vim: filetype=rst textwidth=74 ai shiftwidth=4