/brz/remove-bazaar

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