summaryrefslogtreecommitdiff
path: root/debian/README.source
diff options
context:
space:
mode:
Diffstat (limited to 'debian/README.source')
-rw-r--r--debian/README.source147
1 files changed, 147 insertions, 0 deletions
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 000000000..919b04f36
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,147 @@
1Debian OpenSSH source package handling
2======================================
3
4The Debian package of OpenSSH is maintained in Bazaar
5(http://bazaar-vcs.org/, or the 'bzr' package in Debian). You will need at
6least version 1.16.1; the version in Debian testing as of the time of
7writing (2009-12-21) is fine, or you can use the version in lenny-backports.
8URLs are as follows:
9
10 Anonymous branch: http://bzr.debian.org/pkg-ssh/openssh/trunk
11 Web browsing: http://bzr.debian.org/loggerhead/pkg-ssh/openssh/trunk
12 Authenticated, for developers with commit access only:
13 bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/trunk
14
15Although it's possible that I may use something like bzr-loom in the future
16to better manage things like the Kerberos/GSSAPI patch, right now there's no
17funny business and all that developers need to do is:
18
19 # To check out:
20 bzr co bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/trunk openssh
21
22 # To update:
23 bzr up
24
25 # To edit:
26 # hack hack hack, and 'bzr add' any new files
27 debcommit # or bzr commit
28 # note that this pushes automatically; you can use 'bzr unbind' to
29 # temporarily prevent this, or 'bzr branch' to create a local branch which
30 # you can merge later
31
32 # To release:
33 dch -r && debcommit -r
34
35If you have lots of branches, you'll probably want to use a shared
36repository to save space. Run 'bzr init-repo .' in an ancestor directory of
37all your OpenSSH working directories. For example, I have a shared
38repository in ~/src/debian/openssh/, upstream checkouts in
39~/src/debian/openssh/upstream/, and my own working trees in
40~/src/debian/openssh/trunk/.
41
42Merging new upstream releases
43-----------------------------
44
45(Most developers will not need to read this section.)
46
47Thanks to the import from Portable OpenSSH CVS provided by Launchpad
48(https://code.launchpad.net/~vcs-imports/openssh/main, accessible by the
49shortcut 'lp:openssh' from the bzr client), the Debian branch is a true DVCS
50branch from upstream. This is a worthwhile property, but preserving it does
51take a little bit of work.
52
53Launchpad only imports CVS HEAD, but upstream sometimes produces releases
54from a branch. We use the same software used by Launchpad to import the
55branch as well, but a few small hacks are necessary to do good branch
56imports. In Bazaar, it's important that the same file in different branches
57should have the same file-id, otherwise merge attempts will try to delete
58and re-add the file which usually doesn't work out very well. Occasionally a
59file is added to CVS HEAD and then also added to a branch, and cscvs isn't
60quite smart enough to spot this and copy over the file-id. We need to help
61it out.
62
63To fetch the necessary code:
64
65 bzr get lp:~cjwatson/launchpad-cscvs/openssh-branch-imports
66 # or 'bzr pull' in the appropriate directory to update this, if you
67 # already have a copy
68
69To import a branch, V_5_3 in this example:
70
71 export PATH="/path/to/cscvs/openssh-branch-imports:$PATH"
72 export PYTHONPATH=/path/to/cscvs/openssh-branch-imports/modules:/path/to/cscvs/openssh-branch-imports
73 # in a CVS checkout of :ext:anoncvs@anoncvs.mindrot.org:/cvs module
74 # openssh:
75 cscvs cache -b
76 # or 'cscvs cache -u' if you've done this before and want to update
77 cvs up -rV_5_3
78
79 # Now we need to get a few bits of information from cscvs' cache.
80 sqlite CVS/Catalog.sqlite
81 sqlite> select csnum,log from changeset where branch = 'V_5_3' order by startdate;
82 # There will be a solid block of "Creation of branch V_5_3" changesets at
83 # the start; look for the first revision *after* this. Substitute this in
84 # the following wherever you see "CSX".
85 sqlite> select revision,filename from revision where branch = 'V_5_3' and csnum >= CSX and revision not like '%.%.%' order by filename;
86 # Anything listed here will need to be added to the openssh_ids dictionary
87 # in modules/CVS/StorageLayer.py in cscvs. Please send Colin Watson a
88 # patch if you do this.
89
90 # Next, look up the branchpoint revision in the main bzr import (bzr get
91 # lp:openssh). It's usually easiest to just look it up by commit message
92 # and double-check the timestamp. Substitute this revision number for
93 # "BPR" in the following. /path/to/openssh/main is wherever you've checked
94 # out lp:openssh.
95 bzr get -rBPR /path/to/openssh/main /path/to/openssh/5.3
96 # If you're using Bazaar signed commits with a GPG agent, make sure that
97 # your agent has seen your passphrase recently. Now you can start the
98 # actual import!
99 cscvs -D4 totla -SC V_5_3.CSX: /path/to/openssh/5.3
100 # If this fails at the end with a "directories differ" message, you may
101 # have forgotten to switch your CVS checkout to the appropriate branch
102 # with 'cvs up -r...' above. Otherwise you'll have to debug this for
103 # yourself. It's also worth double-checking that any files added to the
104 # branch have file-ids matching those on the trunk, using 'bzr ls -R
105 # --show-ids'.
106
107Now we have a Bazaar branch corresponding to what's in CVS. Previous such
108branches are available from Launchpad, for reference purposes:
109
110 https://code.launchpad.net/openssh
111
112However, upstream releases involve a 'make distprep' step as well to
113construct the tarball, and we need to import the results of this as well to
114get a clean package.
115
116Start by unpacking the upstream tarball (remember to check its GPG signature
117first!). Copy the .bzr directory from the upstream branch you prepared
118earlier. Now we have another branch, but with a working tree corresponding
119to the upstream tarball. Modifications and deletions are handled
120automatically, but we need to handle additions explicitly to make sure
121file-ids are correct (see above). Run:
122
123 bzr add --file-ids-from=/path/to/openssh/debian/trunk
124 bzr st --show-ids
125 # compare this with 'bzr ls --show-ids' in the Debian trunk to make sure
126 # the result will be mergeable
127 bzr ci -m 'Import 5.3p1 tarball'
128
129Next, merge this into the gssapi branch
130(bzr+ssh://bzr.debian.org/bzr/pkg-ssh/openssh/gssapi/). For this branch, we
131want to ignore the normal results of merging and take only the patch from
132http://www.sxw.org.uk/computing/patches/openssh.html; of course such a patch
133needs to exist first! To do this, run this in the gssapi branch:
134
135 bzr merge /path/to/openssh/tarball/branch
136 bzr revert -rrevno:-1:/path/to/openssh/tarball/branch .
137 patch -p1 </path/to/openssh/gssapi/patch
138 bzr add --file-ids-from=/path/to/openssh/debian/trunk
139 # you may need to deal with applying configure.ac changes to configure
140 # here
141 bzr ci -m 'import openssh-5.3p1-gsskex-all-20100124.patch'
142
143You should now be able to 'bzr merge' from the gssapi branch into the Debian
144trunk, resolve conflicts, and commit. If you see lots of "Contents conflict"
145messages, you may have got the file-ids wrong. Once you've committed the
146merge, you can throw away the tarball branch, as all its history will have
147been incorporated.