/[debian-med]/trunk/community/website/docs/policy.xml
ViewVC logotype

Contents of /trunk/community/website/docs/policy.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6347 - (hide annotations) (download) (as text)
Mon Mar 21 12:15:10 2011 UTC (2 years, 2 months ago) by plessy
File MIME type: text/xml
File size: 44926 byte(s)
SSH tips.
1 plessy 1847 <?xml version='1.0' encoding='UTF-8'?>
2     <?xml-stylesheet type="text/xsl"
3     href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"?>
4     <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
5     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
6     <article xml:base="http://debian-med.alioth.debian.org/">
7 tille 3777 <title>Debian Med Group Policy</title>
8 plessy 1847 <articleinfo>
9 hanska-guest 1277 <authorgroup>
10     <author>
11 plessy 1847 <firstname>Andreas</firstname>
12     <surname>Tille</surname>
13     <contrib>First review </contrib>
14 hanska-guest 1277 <email>tille@debian.org</email>
15     </author>
16     <author>
17 plessy 1847 <firstname>David</firstname>
18     <surname>Paleino</surname>
19     <contrib>Initial writing </contrib>
20 hanska-guest 1277 <email>d.paleino@gmail.com</email>
21     </author>
22 plessy 1847 <author>
23     <firstname>Charles</firstname>
24     <surname>Plessy</surname>
25     <contrib>Contributions in 2008</contrib>
26     <email>plessy@debian.org</email>
27     </author>
28 hanska-guest 1277 </authorgroup>
29     <releaseinfo>
30     $ policy.xml rev. @REV@ - @DATE@ (@AUTHOR@) $
31     </releaseinfo>
32 plessy 1847 </articleinfo>
33 hanska-guest 1277 <mediaobject>
34 plessy 1847 <objectinfo>
35 tille 3777 <title>Debian Med Group</title>
36 plessy 1847 </objectinfo>
37 hanska-guest 1277 <imageobject>
38     <imagedata fileref="/img/debian-med.jpg" format="JPG" align="center" />
39     </imageobject>
40     </mediaobject>
41 plessy 6306 <sect1 id="introduction">
42 hanska-guest 1277 <title>Introduction</title>
43 tille 3777 <para>Debian Med is a <quote><ulink url="http://blends.alioth.debian.org/blends">Debian Pure Blend</ulink></quote>
44 hanska-guest 1277 with the aim to develop Debian into an operating system that is particularly
45     well fit for the requirements for medical practice and research.</para>
46 tille 3777 <para>The Debian Med project presents packages that are associated
47 hanska-guest 1277 with medicine, pre-clinical research, and life sciences. Its developments
48     are mostly focused on three areas for the moment: medical practice,
49     imaging and bioinformatics.</para>
50     <para>Over the previous years, several initiatives have spawned that
51     address the scientific disciplines like chemistry or bioinformatics.
52 tille 3777 Debian Med is not a competition to these efforts but a platform to
53     present the packages to the community as a Debian Pure Blend.</para>
54 hanska-guest 1277 </sect1>
55 plessy 6306 <sect1 id="contribute">
56 hanska-guest 1277 <title>How to Contribute</title>
57     <para>From the developer to the user, there is a long chain of tasks
58     in which we always welcome participation. First we must keep ourselves
59     informed about the software landscape in biology and medicine. Software
60     to be packaged is chosen according to criteria such as users' need and
61     the consistency of the distribution.</para>
62     <para>Once in Debian, the software is monitored for its quality and bugs
63     are fixed, if possible in collaboration with the upstream maintainer(s).
64     All this work would not be very useful if it remains confidential.</para>
65     <para>We also dedicate some time to advertise it to the world via
66 plessy 1847 <ulink url="http://www.debian.org">www.debian.org</ulink>
67 hanska-guest 1277 and to ease the integration of new members.</para>
68 plessy 1847 <para>Please contact us on <ulink url="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</ulink>
69 hanska-guest 1277 if you want to help to make medical and biological software available
70 plessy 1847 to Debian users. Read the <link linkend="membership">Membership</link> section if you're
71 hanska-guest 1277 interested in joining us.</para>
72     <para>If you speak a language other than English, you can contribute
73     rightaway with translations of package descriptions at
74 tille 5212 <ulink url="http://ddtp.debian.net">ddtp.debian.net</ulink>.</para>
75 hanska-guest 1277 <para>When working on these, you will find immediate targets for improvements
76     of the original English versions, too. For these, though, you need access
77 tille 3777 to Debian Med's source code repository. Very welcome are tutorials that
78 hanska-guest 1277 guide Debian users towards the use of packages to their immediate benefit.
79     You may also consider to write respective articles for Magazines, be they
80     online or in print.</para>
81 plessy 6306 <sect2 id="membership">
82     <title>Membership</title>
83 hanska-guest 1277 <para>To request membership to this group, please go on our
84 plessy 1847 <ulink url="http://alioth.debian.org/projects/debian-med">Alioth page</ulink>,
85     or directly follow this <ulink url="http://alioth.debian.org/project/request.php?group_id=30063">link</ulink>.
86 hanska-guest 1277 Remember that you must have an Alioth account before requesting
87 plessy 1847 membership (see <ulink url="http://alioth.debian.org/account/register.php">here</ulink>
88 hanska-guest 1277 to request an Alioth account).</para>
89     </sect2>
90 plessy 6306 <sect2 id="readings">
91     <title>Essential readings</title>
92 plessy 2408 <itemizedlist>
93     <listitem><para>The <ulink url="http://www.debian.org/doc/debian-policy/">Debian Policy</ulink>: packages must conform to it.</para></listitem>
94 tille 5212 <listitem><para>The <ulink url="http://www.debian.org/doc/developers-reference/">Developers Reference</ulink>: details best packaging practices.</para></listitem>
95 plessy 2408 <listitem><para>The <ulink url="http://www.debian.org/doc/maint-guide/">New Maintainer's Guide</ulink>: puts a bit of the two above in practice.</para></listitem>
96     <listitem><para>The <ulink url="http://debian-med.alioth.debian.org/docs/policy.html">Debian Med Policy</ulink> (this document): explains how the work is organised in our team..</para></listitem>
97     </itemizedlist>
98     </sect2>
99 hanska-guest 1277 </sect1>
100 plessy 6306 <sect1 id="repositories">
101 plessy 4307 <title>Repositories</title>
102     <para>We use Subversion (SVN) and Git repositories, hosted on
103 plessy 1847 <ulink url="http://alioth.debian.org/">Alioth</ulink>, the hosting
104 hanska-guest 1277 facility provided by Debian to free software developers. You can have a look at
105 plessy 4307 each repository through Alioth's web interfaces: <ulink url="http://svn.debian.org/wsvn/debian-med/trunk/?rev=0&amp;sc=0">wsvn</ulink>
106     <ulink url="http://svn.debian.org/viewsvn/debian-med">viewsvn</ulink> and
107     <ulink url="http://git.debian.org/">gitweb</ulink>.</para>
108     <para>The Subversion repository is the primary location for our source packages.
109     However, the Git repository is free to use for special cases, for instance when
110     the Subversion tags take a disproportionated size, when the maintainer is
111     much more comfortable with Git than Subversion, when some special features of
112     Git or git-buildpackage are desired, or more simply when the maintainer wants
113     to thake the opportunity to familiarise with Git.
114     </para>
115 plessy 6324 <warning id="umask">
116     <para>
117     For most direct operaitons on the repositories in Alioth, an <command>umask</command> of <literal>002</literal> is necessary to avoid problems of missing write permission to the other team members.
118     </para>
119     </warning>
120 plessy 6306 <sect2 id="source">
121 hanska-guest 1277 <title>Give me the source!</title>
122     <para>
123 plessy 4307 To check sources out from our repostitories, please do:
124 hanska-guest 1277 <itemizedlist>
125     <listitem>
126 tille 5212 <para>If you are a member of Debian Med or a Debian developer, you have write permission:</para>
127 hanska-guest 1277 <blockquote>
128     <para><userinput>
129     <command>svn co</command> <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/...</filename>
130 tille 4308 </userinput></para>
131     <para><userinput>
132 plessy 4307 <command>git clone</command> <filename class="directory">git+ssh://user@alioth.debian.org/git/debian-med/&lt;package&gt;.git</filename>
133 hanska-guest 1277 </userinput></para>
134     </blockquote>
135     </listitem>
136     <listitem>
137 plessy 2409 <para>For read-only access, the syntax is slightly different:</para>
138 hanska-guest 1277 <blockquote>
139     <para><userinput>
140     <command>svn co</command> <filename class="directory">svn://svn.debian.org/svn/debian-med/trunk/...</filename>
141 plessy 4825 </userinput></para>
142     <para><userinput>
143 plessy 4307 <command>git clone</command> <filename class="directory">git://git.debian.org/git/debian-med/&lt;package&gt;.git</filename>
144 hanska-guest 1277 </userinput></para>
145     </blockquote>
146     </listitem>
147     </itemizedlist>
148     </para>
149 plessy 1847 <para>
150     Another way to check the sources is through the use of the
151     <command>debcheckout</command> command, from the
152     <ulink url="http://packages.debian.org/devscripts">devscripts</ulink>
153     package.
154     </para>
155 hanska-guest 1277 </sect2>
156 plessy 6347 <sect2 id="ssh-tips">
157     <title>SSH tips</title>
158     <para id="ssh-config">
159     You can avoid specifying your Alioth user name by setting it in
160     <filename>~/.ssh/config</filename>:<programlisting>
161     Host *.debian.org
162     User your-user-name</programlisting>
163     </para>
164     <para id="ssh-add">
165     You can avoid typing your SSH password again and again using the
166     <code><command>ssh-add</command></code> command. On remote connections
167     the SSH agent needs to be enabled with the command
168     <code><command>eval</command>
169     <option>$(</option><command>ssh-agent</command><option>)</option></code>.
170     </para>
171     </sect2>
172 plessy 6327 <sect2 id="svn-repository-structure">
173     <title>Subversion repository structure</title>
174 hanska-guest 1277 <para>The SVN repository is structured as follows:
175 plessy 1847 <literallayout>
176     <code>
177     debian-med/
178     └ trunk/
179     ├ community/
180     │ ├ debtags/
181     │ ├ infrastructure/
182     │ └ website/
183     └ packages/
184     &lt;package A&gt;/
185     │ ├ branches/
186     │ ├ tags/
187     │ └ trunk/
188     │ └ debian/
189     &lt;package B&gt;/
190     │ ├ branches/
191     │ ├ tags/
192     │ └ trunk/
193     │ └ debian/
194    
195     </code>
196     </literallayout>
197     </para>
198     <note><para>We are currently considering an alternative layout in which all
199     the <filename>trunk</filename>, <filename>tags</filename> and
200 tille 5212 <filename>branches</filename> directories are grouped together, so that developers can checkout trunks without tags.</para></note>
201 hanska-guest 1277 </sect2>
202 plessy 6331 <sect2 id="subversion-tips">
203     <title>Subversion tips</title>
204 plessy 6339 <para id="svn-buildpackage-aliases">
205 plessy 6331 Suggested aliases for
206     <command>svn-buildpackage</command>:<programlisting>
207     alias <command>svn-b</command>='svn-buildpackage -us -uc -rfakeroot --svn-ignore'
208     alias <command>svn-br</command>='svn-b --svn-dont-purge --svn-reuse'
209     alias <command>svn-bt</command>='svn-buildpackage --svn-tag -rfakeroot'</programlisting>
210     </para>
211 plessy 6345 <para id="svn-mergewithupstream">
212     <command>svn-inject</command> sets up correctly the
213     <literal>mergeWithUpstream</literal> property for the SVN directories
214     where packages are stored. In case <command>svn-inject</command> was
215     not used, you can do it by hand with the command
216     <code><command>svn propset</command>
217     <replaceable>mergeWithUpstream</replaceable>
218     <replaceable>1</replaceable> <replaceable>debian</replaceable></code>.
219     </para>
220 plessy 6339 <para id="download-upstream-source">
221 plessy 6331 To download the upstream sources (if there is a
222     <filename>debian/watch</filename> file): <code><command>echo
223     "origDir=.." &gt;&gt; .svn/deb-layout &amp;&amp; uscan
224     --force-download</command></code>. Alternatively, you can try
225     <code><command>debian/rules get-orig-source</command></code>.
226     </para>
227 plessy 6339 <para id="svn-write-access">
228 plessy 6331 If you're a Debian developer or a member of the Debian Med group on
229     Alioth, you can commit your changes: <command>svn commit</command> (also
230     <command>svn ci</command>). Otherwise, you can ask to be added to the
231     group (see the <link linkend="membership">Membership</link> section), or
232     send the result of <command>svn diff</command> to the <ulink
233     url="mailto:debian-med@lists.debian.org">mailing list</ulink>
234     (<command>gzip -9</command> it, if it's too large).
235     </para>
236 plessy 6339 <para id="svn-tag-release">
237 plessy 6335 It may happen that a package version has been uploaded to Debian
238     repositories, and you forgot to tag the last build with
239     <command>svn-buildpackage --svn-tag</command>. You can tag this package
240     also retroactively. A first step, creating
241     the tags directory, can be achieved in two ways: either create it
242     locally as sibling of <filename class="directory">trunk/</filename> with
243     <code><command>svn mkdir</command> <filename class="directory">tags</filename></code>, and commit with
244     <code><command>svn commit</command></code>, or create it remotely with
245     <code><command>svn mkdir</command> <filename class="directory">svn+ssh://user@svn.debian.org/svn/debian-med/trunk/packages/&lt;package&gt;/tags</filename></code>.
246     After the tags directory has been created, you're ready to tag the
247     package: <code><command>svn-buildpackage</command> <option>--svn-tag-only</option> <option>--svn-no-autodch</option></code>.
248     The <option>--svn-no-autodch</option> avoids
249     <filename>debian/changelog</filename> to be marked as <literal>UNRELEASED</literal>.
250     </para>
251 plessy 6344 <para id="example-svn-session">
252     Here is an example session where a package is prepared manually:<programlisting>
253     # Check out debian-med/trunk, cd to debian-med/trunk/packages
254     # Create new project folder with
255     svn mkdir projectname
256     svn mkdir projectname/trunk
257    
258     # Put orig.tar.gz in place
259     mv some_version.orig.tar.gz projectname
260    
261     # Inform svn-buildpackage about the location of the orig.tar.gz
262     echo "origDir=.." > projectname/trunk/.svn/deb-layout
263    
264     # Untar source tree for development
265     cd projectname
266     tar xzvf some_version.orig.tar.gz
267     cd some-version # entering the unpackaged source tree
268     if [ ! -d debian ]; then dh_make ; fi
269     mv debian ../trunk
270     ln -s ../trunk/debian .
271    
272     # continue development
273     fakeroot ./debian/rules binary
274    
275     # until it works, finally
276     cd ..
277    
278     # debian directory is the only thing that is stored in svn, to be merged with upstream
279     svn propset mergeWithUpstream 1 trunk/debian
280    
281     # See if things can be compiled via svn-buildpackage
282     cd trunk
283     svn-buildpackage -rfakeroot -uc -us
284    
285     # check build
286     lintian ../build-area/*changes</programlisting>
287     </para>
288 plessy 6331 </sect2>
289 plessy 6327 <sect2 id="git-repository-structures">
290     <title>Common Git repository structures</title>
291     <para>
292     The area on Alioth that contains the Git repositories (<filename
293     class="directory">/git/debian-med</filename>) is not itself structured,
294     but the repositories can be arranged in different possible layouts.
295     </para>
296     <sect3 id="git-buildpackage">
297     <title><command>git-buildpackage</command></title>
298     <para>
299     Most of our packages using Git and stored in Alioth are managed with
300     the <command>git-buildpackage</command> helper. The
301     <literal>master</literal> branch contains the full source package.
302     The <literal>upstream</literal> branch contains the upstream source,
303     after repacking when necessary (non-free files, large convenience code
304     copies, …). The <literal>pristine-tar</literal> contains the data
305     necessary to recreate an original tarball from the repository with a
306     reproducible checksum.
307     </para>
308     <para>
309     Debian releases are tagged with names like
310     <literal>debian/debianversion</literal> and upstream relases are
311     tagged with names like <literal>upstream/upstreamversion</literal>.
312     </para>
313     </sect3>
314     <sect3 id="git-without-tarball">
315     <title>Social Git</title>
316     <para>
317     For some projects, like the ones hosted on <ulink
318     url="http://www.github.com">Github</ulink> or <ulink
319     url="http://www.gitorious.com">Gitorious</ulink>, it may be easier to
320     forward changes made in the Debian package if this one is itself
321     hosted on the same platform, as a clone. In that case, the layouts
322     may vary from package to packages. However, there are good chances
323     that the branch that contains the Debian source package is called
324     <literal>debian</literal>.
325     </para>
326     </sect3>
327     </sect2>
328 plessy 6321
329     <sect2 id="git-tips">
330     <title>Git tips</title>
331 plessy 6325 <para id="new-repository-with-gbp">
332     Example to create a new git repository for a package where the upstream
333     sources are distributed as file archives (tar, zip, …):<programlisting>
334     <command>mkdir</command> <filename class="directory">package</filename>
335     <command>cd</command> <filename class="directory">package</filename>
336     <command>git init</command>
337     <command>git import-orig</command> <option>--pristine-tar</option> <filename>/path/to/package_version.orig.tar.gz</filename>
338     <command>dh_make</command> <option>-p package_x.y.z</option></programlisting>
339     The above steps will create a repository with the appropriate layout for
340     <command>git-buildpackage</command>, with three branches:
341     <literal>master</literal> (where the Debian development will happen),
342     <literal>pristine-tar</literal> used by the
343     <literal>pristine-tar</literal> tool during the package build process to
344     recreate the original tarball, and <literal>upstream</literal>, which
345     will contain the upstream source.
346 plessy 6321 </para>
347 plessy 6325 <para id="debcheckout-sets-git-options">
348     To display your name and more nicely in the Git log, you should instruct
349     Git to do so (the <option>--global</option> option is to say Git these
350     are the default parameters for every Git repository you commit to,
351     without it the settings will be per-repository only):<programlisting>
352     <command>git config</command> <option><optional>--global</optional></option> <option>user.name "$DEBFULLNAME"</option>
353     <command>git config</command> <option><optional>--global</optional></option> <option>user.email "$DEBEMAIL"</option></programlisting>
354     </para>
355     <para id="debcheckout-git-track">
356     To clone and follow every branch of a git repository containing a
357     package that is already in the Debian archive, you can use the
358     <command>debcheckout</command> command with its
359     <command><option>--git-track='*'</option></command> option. To restrict
360     the tracked branch to the standard ones used by
361     <command>git-buildpackage</command>, <literal>master upstream
362     pristine-tar</literal> can be passed instead of the wildcard.
363     </para>
364     <para id="git-track-new-branches">
365 plessy 6322 Example commands to track new branches: <programlisting>
366 plessy 6325 <command>git branch</command> <option>-t <replaceable>upstream</replaceable> <replaceable>origin/upstream</replaceable></option>
367     <command>git branch</command> <option>-t <replaceable>pristine-tar</replaceable> <replaceable>origin/pristine-tar</replaceable></option></programlisting>
368 plessy 6322 </para>
369 plessy 6325 <para id="git-options-devscripts">
370     If the <package>devscripts</package> variables
371     <varname>DEBEMAIL</varname> and <varname>DEBFULLNAME</varname> are set,
372     <command>debcheckout</command> will set <command>git</command>'s options
373     <varname>user.email</varname> and <varname>user.name</varname>
374     accordingly.
375 plessy 6321 </para>
376 plessy 6325 <para id="git-add-alioth-branch">
377     To push changes to Alioth, a remote branch needs to be configured. This
378     is done automatically after cloning a repository, for instance with
379     <link linkend="debcheckout-git-track">debcheckout</link>. The default
380     remote branch is called <quote>origin</quote>. Here are example
381     commands to set up Alioth as a remote branch on a freshly created
382     repository:<programlisting>
383     <command>git remote add</command> <literal>origin</literal> <filename class="directory">git+ssh://alioth.debian.org/git/debian-med/package.git</filename></programlisting>
384     </para>
385     <para id="create-git-repository-on-alioth">
386     There is a small script called <command>setup-repository</command> in
387     the <filename class="directory">/git/debian-med</filename> directory on
388     Alioth. <code><command>./setup-repository</command>
389     <option>packagename</option> <option>"Description of the
390     package"</option></code> will create a <filename
391     class="directory">packagename.git</filename> repository on with the
392     proper hooks set up for our team.
393     </para>
394     <para id="push-package-to-alioth">
395     To push the package (make sure you've added the alioth remote!), do the
396     following:<code><command>git push</command> <option>origin
397     master</option></code>. For the first push, it's necessary to specify
398     <option>origin master</option>. The next time you will push, a
399     <command>git push</command> will suffice.
400     </para>
401     <para id="git-push-all-tags">
402     <command>git push</command>this will only push the
403     <literal>master</literal> branch unless it is somehow related to other
404     branches), so be sure to also do a run with <option>--all</option>, and one with <option>--tags</option> if you created new tags.
405     </para>
406 plessy 6339 <para id="git-tag-release">
407     To tag a release:
408     <code><command>git tag</command> <option>debian/x.y-z</option></code>.
409     You can also easily retroactively make tags:
410     <code><command>git tag</command> <option>debian/x.y-z</option> <option>&lt;commit hash&gt;</option></code>.
411     Remember to <code><command>git push --tags</command></code>.
412     </para>
413 plessy 6326 <para id="git-layout-variants">
414     In particular for Git repositories that are not stored in Alioth, the
415     layout can differ from <command>git-buildpackage</command> conventions.
416     In that case, look for instance for a branch called <literal>debian</literal>.
417     </para>
418 plessy 6339 <para id="git-debian-version-from-commit">
419 plessy 6329 If upstream manages his sources with Git, the following makefile
420 plessy 6328 script can help producing a version number when no Git tag is
421     available:<programlisting>
422     SOURCEPKG=$(shell dpkg-parsechangelog | sed -n 's/^Source: \(.*\)/\1/p')
423     UPSTREAM=$(shell dpkg-parsechangelog | sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
424     SHA1=$(lastword $(subst ~g, ,$(UPSTREAM)))
425     ORIG=${SOURCEPKG}_${UPSTREAM}.orig.tar.gz
426    
427     describe-current-version:
428     git describe --tags upstream | sed 's,^release-,,;s,-,+,;s,-,~,;'
429    
430     get-orig-source:
431     git archive --format=tar $(SHA1) | gzip -9 > ../$(ORIG)</programlisting>
432 plessy 6339 </para>
433     <para>
434     To make <command>git-buildpackage</command> builds the package with a
435     chroot, you can add the folowwing to the configuration file <filename>~/.gbp.conf</filename> or <filename>debian/gbp.conf</filename>:<programlisting>
436     [DEFAULT]
437     builder = ~/bin/git-pbuilder
438     cleaner = fakeroot debian/rules clean
439     pristine-tar = True
440    
441     [git-buildpackage]
442     # use this for more svn-buildpackage like behaviour:
443     export-dir = ../build-area/
444     tarball-dir = ../tarballs/</programlisting>
445     With this configuration file you're specifying that
446     <command>git-buildpackage</command> will use
447     <filename>~/bin/git-pbuilder</filename> as the builder script. This is
448     an example script you can use:<programlisting>
449     #!/bin/sh
450     set -e
451    
452     pdebuild --pbuilder cowbuilder --debbuildopts "-i\.git -I.git $*"
453     rm ../*_source.changes</programlisting>
454     This will build the package inside the default cowbuilder chroot, while
455     passing any more parameters directly do <command>dpkg-buildpackage</command>.
456     </para>
457 plessy 6321 </sect2>
458    
459 plessy 6306 <sect2 id="subversion-to-git">
460 plessy 4307 <title>Migration of a source package from Subversion to Git.</title>
461     <para>There is no easy way to prepare a Git repository from our Subversion repository that would
462     look like the package was always managed in Git, because we use svn-buildpackage with the
463     mergeWithUpstream property set, which excludes the upstream sources. Nevertheless, the
464     following receipe will genearate a Git repostitory that contains all the history of
465     the debian directory, plus a collection of selected upstream source releases.
466     </para>
467     <itemizedlist>
468     <listitem>
469     <para>Start the conversion as explained in the <ulink url="http://wiki.debian.org/Alioth/Git#ConvertaSVNAliothrepositorytoGit">Alioth/Git</ulink> page of the Debian wiki. To be consistent with a later usage of <command>git-buildpackage</command>, it is preferable to prefix the tag names <quote>debian</quote>. During this conversion, you can take advantage of the file <filename>/trunk/community/infrastructure/comitters</filename> in the Subversion repository, and expand it if necessary.</para>
470     </listitem>
471     <listitem>
472     <para>Import of the upstream original tarballs that you find relevant, for instance the ones that were part of a stable release). When this paragraph was written, it was necessary to follow special instruction detailed in <ulink url="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=471560">bug 471560</ulink>.
473     </para>
474     </listitem>
475     <listitem>
476     <para>Upload to alioth.debian.org/git/debian-med and set up the hooks and other meta-data as explained in the <ulink url="http://wiki.debian.org/Alioth/Git">Alioth/Git</ulink> page of the Debian wiki.
477     </para>
478     </listitem>
479     </itemizedlist>
480 plessy 5517 <para>It is also possible to prepare a Git repository containing some of the package's history using the command <command>git-import-dscs --debsnap</command> from the helper toolkit <command>git-buildpackage</command>. This will download all the versions of a package available in <ulink url="http://snapshot.debian.org">snapshots.debian.org</ulink> and create tags for each of them. Note that as this paragraph is written, the tool is not aware that <emphasis>backports</emphasis> should be a different branch</para>
481 plessy 4307 </sect2>
482 plessy 6306 <sect2 id="updating-git-package">
483 plessy 5518 <title>Updating a source package managed with Git</title>
484     <para>Most source packages maintained as Git repositories in Debian Med are using the <command>git-buildpackage</command> helper toolkit. In doubt, try this one first.</para>
485     <para><command>git-buildpackage</command>'s command <command>git-import-orig</command> allows very easy update of the <emphasis>upstream</emphasis> branch when the original sources are distributed as a compressed archive. Its option <command>--pristine-tar</command> is useful for stablizing the MD5 sum of the “<filename>orig.tar.gz</filename>” produced when building a source package from the repository alone (not doing so results in archive rejection of package updates). With recent versions of git-buildpackage, it is often unnecessary to rename the freshly downloaded original upstream archive.</para>
486     </sect2>
487 hanska-guest 1277 </sect1>
488 plessy 6306 <sect1 id="packaging">
489 hanska-guest 1277 <title>Packaging</title>
490 plessy 6306 <sect2 id="itp">
491 hanska-guest 1277 <title>Announcing intent to package</title>
492     <para>If you intent to work on a Debian package you should follow
493 plessy 1847 the <ulink url="http://www.debian.org/devel/wnpp/#l1">normal Debian rules</ulink> and file a <acronym>WNPP</acronym> bug report.</para>
494 tille 3777 <para>It is a good idea to keep the Debian Med mailing list
495 plessy 1847 <ulink url="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</ulink>
496 plessy 2630 <ulink url="http://www.debian.org/Bugs/Reporting#xcc"> in CC</ulink> and to set it
497     as the owner of the ITP to keep your co-workers informed. This will ensure that we notice
498 plessy 4042 if for some reason the package has not been uploaded.</para>
499     <para>In addition, please add the package to the <quote>task</quote> file where it fits
500     the best, and document your ITP number using the <command>WNPP</command> field name.</para>
501 hanska-guest 1277 </sect2>
502 plessy 1847 </sect1>
503 plessy 6306 <sect1 id="tasks">
504 plessy 4042 <title>Tasks</title>
505     <para>The Debian Med <ulink url="http://blends.alioth.debian.org/blends">Debian Pure Blend</ulink> is organised by <ulink url="http://debian-med.alioth.debian.org/tasks/index">tasks</ulink>, that group packages around broad themes such as <ulink url="http://debian-med.alioth.debian.org/tasks/imaging">medical imaging</ulink> for instance. The tasks list programs that are already packaged in Debian as well as packages in preparation.</para>
506     <para>The tasks files are not hosted in the Debian Med repositories, but in the Debian Blends repository. Nevertheless, all members of the Debian Med project on the Alioth forge have write access to the Blends subversion repository. You can easily check out its sources with the command <command>debcheckout -a debian-med</command>.</para>
507     <para>The syntax of the tasks files is very similar to Debian control files, and described in the <ulink url="http://blends.alioth.debian.org/blends/ch-sentinel.en.html">Debian Blends website</ulink>.</para>
508     </sect1>
509 plessy 6306 <sect1 id="policy">
510 plessy 1847 <title>Policy</title>
511 plessy 6306 <sect2 id="debian-control">
512 plessy 1847 <title><filename>debian/control</filename></title>
513     <orderedlist>
514     <listitem>
515     <formalpara>
516     <title>Section</title>
517     <para>Should be <quote>science</quote> for the source package.</para>
518     </formalpara>
519     </listitem>
520    
521     <listitem>
522     <formalpara>
523     <title>Priority</title>
524     <para>Should be <quote>optional</quote> unless forbidden by the Debian policy (see section 2.5). Packages of priority <quote>extra</quote> are excluded from some QA tests.</para>
525     </formalpara>
526     </listitem>
527    
528     <listitem>
529     <formalpara>
530     <title>Maintainer</title>
531 tille 3777 <para>Maintainer should be Debian Med Packaging Team <email>debian-med-packaging@lists.alioth.debian.org</email>. Please subscribe to this list if you list yourself in the <code>Uploaders:</code> field of one of Debian Med's packages. You can refer to the <ulink url="http://qa.debian.org/developer.php?login=debian-med-packaging@lists.alioth.debian.org">QA page</ulink> corresponding to this email to gather information about the packages.</para>
532 plessy 1847 </formalpara>
533     </listitem>
534    
535     <listitem>
536     <formalpara>
537     <title>Upload by Debian Maintainers</title>
538     <para>Should be enabled with the field <code>DM-Upload-Allowed: yes</code>. This means that when an Uploader becomes Debian Maintainer, he will immediately get the possibility to upload the package to Debian. Please consider this when you sponsor packages in which some Uploaders are added.</para>
539     </formalpara>
540     </listitem>
541    
542     <listitem>
543     <formalpara>
544     <title>Uploaders</title>
545 plessy 6320 <para>Please add yourelf as an uploader when you have a significant interest in a package. Being Uploader means that you are expected to answer to the bug reports. For more occasional works, you can do a <ulink url="http://www.debian.org/doc/developers-reference/pkgs#nmu-team-upload">team upload</ulink>.
546 plessy 1847 </para>
547     </formalpara>
548     </listitem>
549    
550     <listitem>
551     <formalpara>
552     <title>Standards-Version</title>
553     <para>Please always use the latest unless there are concerns for backporting. If no changes are needed, please indicate this fact in the changelog, and increment the value of the field.</para>
554     </formalpara>
555     </listitem>
556    
557     <listitem>
558     <formalpara>
559     <title>Homepage</title>
560     <para>should be documented whenever possible</para>
561     </formalpara>
562     </listitem>
563    
564     <listitem>
565     <formalpara>
566     <title>Vcs-Svn: and Vcs-Browser:</title>
567 plessy 4307 <para>Please use the following templates:
568 plessy 1847 <programlisting>
569 hanska-guest 1277 Vcs-Svn: svn://svn.debian.org/svn/debian-med/trunk/packages/&lt;package&gt;/trunk/
570     Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/&lt;package&gt;/trunk/?rev=0&amp;sc=0
571 plessy 4307 </programlisting>or
572     <programlisting>
573     Vcs-Git: git://git.debian.org/git/debian-med/&lt;package&gt;.git
574     Vcs-Browser: http://git.debian.org/?p=debian-med/&lt;package&gt;.git
575 plessy 1847 </programlisting>
576 plessy 4304 </para>
577 plessy 1847 </formalpara>
578     </listitem>
579     </orderedlist>
580 hanska-guest 1277 </sect2>
581 plessy 1847
582 plessy 6306 <sect2 id="debian-copyright">
583 plessy 1847 <title><filename>debian/copyright</filename></title>
584 plessy 4825 <para>We use the <ulink url="http://wiki.debian.org/Proposals/CopyrightFormat">proposed machine-readable format</ulink> for the <filename>debian/copyright</filename> file. The <computeroutput>Source</computeroutput> field does not need to contain the full URL to the particular version that is being packaged, since this can be determined by the <command>uscan</command> program with the <filename>debian/watch</filename> file. Please list yourself in the <computeroutput>Files: debian/*</computeroutput> section if you think that your contributions are not trivial and therefore subjected to copyright. Please chose a license that is compatible with the program you package. You can also use <quote>same as if it were in the public domain</quote> or <quote>same as the packaged program itself</quote>.</para>
585 plessy 1847 </sect2>
586    
587 plessy 6306 <sect2 id="debian-changelog">
588 plessy 1847 <title><filename>debian/changelog</filename></title>
589     <para>Packages hosted in our Subversion repository, that have been modified but not uploaded must use <emphasis>UNRELEASED</emphasis> as a distribution name. This can be done automatically by declaring <emphasis>DEBCHANGE_RELEASE_HEURISTIC=changelog</emphasis> in <filename>~/.devscripts</filename> and using <command>dch</command>.</para>
590     </sect2>
591 plessy 6306 <sect2 id="debian-readme-source">
592 plessy 2667 <title><filename>debian/README.source</filename></title>
593 plessy 2672 <para>This file is recommended by the Policy (<ulink url="http://www.debian.org/doc/debian-policy/ch-source.html#s-readmesource">§ 4.14</ulink>) from version 3.8.0 for documenting source package handling. Please follow the recommendation. For instance, this file is needed when we use a patch system, when the upstream sources are in another format than gzipped tar achive, when we repack the sources,…</para>
594 plessy 2667 </sect2>
595 plessy 1847
596 plessy 6306 <sect2 id="debhelper">
597 plessy 1847 <title>Debhelper</title>
598 tille 6311 <para>Debhelper uses compatibility levels to control the behaviour of its commands. We currently recommend to use the level <emphasis>8</emphasis> which
599     is available in current <emphasis>Stable</emphasis> (Squeeze) and backported to <emphasis>Oldstable</emphasis>. However, there is no urgent need to
600     touch packages only because it has an older Debhelper version.</para>
601 tille 6312 <para>
602     It is strongly recommended to use the short <emphasis>dh</emphasis> notation in <filename>debian/rules</filename> files which makes code factorisation very
603 tille 6313 simple and easy to understand the packaging for other members of the team. Even complex packaging becomes quite transparant this way.
604 tille 6312 </para>
605 plessy 1847 </sect2>
606    
607 plessy 6306 <sect2 id="cdbs">
608 plessy 1847 <title>CDBS</title>
609 tille 6313 <para>Before the short <emphasis>dh</emphasis> notation of debhelper existed CDBS was the only way to factorise code in <filename>debian/rules</filename> files.
610     So it was recommended in the past but it turned out that CDBS is badly documented and recently introduced incompatible changes. So it is sometimes reasonable
611 plessy 6319 to switch from CDBS to <emphasis>dh</emphasis> if some problems in the packaging might occure.</para>
612 plessy 1847 <para>It is technically possible to build CDBS packages using Debhelper without the <filename>debian/compat</filename> file. Please do not, and always include such a file according to the above guidelines.</para>
613     </sect2>
614 plessy 6310
615     <sect2 id="vcs">
616     <title>Version control systems</title>
617     <para>
618     We are currently using two different version control systems, Subversion and Git.
619     </para>
620     <sect3 id="vcs-svn">
621     <title>Source package stored in a Subversion repository</title>
622     <para>
623 plessy 6346 We use the <literal>MergeWithUpstream</literal> workflow, so please
624     keep all the modifications in the <filename
625     class="directory">debian</filename> directory, and use the
626     <option>-o</option> option of <command>svn-buildpackage</command>, as
627     in the following example: <code><command>svn-inject</command>
628     <option>-o</option> <filename>package.dsc</filename> <filename
629     class="directory">svn+ssh://svn.debian.org/svn/debian-med/trunk/packages/</filename></code>.
630 plessy 6310 </para>
631     </sect3>
632     <sect3 id="vcs-git">
633     <title>Source package stored in a Git repository</title>
634     <para>
635 plessy 6346 Git repositories should be stored in the <filename
636     class="directory">/git/debian-med</filename> directory on Alioth and
637     created with the <link
638     linkend="create-git-repository-on-alioth"><command>setup-repository</command></link>
639     script available there.
640 plessy 6310 </para>
641 plessy 6346 <para>
642     Git repositories managed with a helper tool should announce it. For
643     instance, to show that <command>git-buildpackage</command> is used,
644     the package can contain a configuration file in
645     <filename>debian/gbp.conf</filename>.
646     </para>
647 plessy 6310 </sect3>
648 plessy 6335 <sect3 id="vcs-tags">
649     <title>Tags</title>
650     <para>
651     Tags indicate the revision corresponding to uploaded packages. For
652     Subversion, the version number is used, and for Git,
653     <literal>debian/</literal> is added before the version number. In the
654     Subversion repository, older tags may be deleted to save space.
655     </para>
656     </sect3>
657 plessy 6310 </sect2>
658 plessy 6306 <sect2 id="new-package">
659 plessy 6343 <title>New package</title>
660 plessy 6325 <para>
661 plessy 6346 Try to inject a new package only after successfully building it with
662     <command>dpkg-buildpackage</command> (or any wrapper around it). Use a
663     file like <filename>debian/DRAFT</filename> to mention when the package
664     is a draft.
665 plessy 6325 </para>
666 plessy 6343 </sect2>
667     <sect2 id="new-packages-in-tasks">
668     <title>The Debian Med Blend tasks</title>
669     <para>
670     Once you injected a new package please make sure that it is mentioned
671     in the apropriate tasks file in the SVN source of the
672     <package>debian-med</package> Blend package. Some team members watch
673     the changes in the Debian Med packaging pool but it helps if the
674     maintainer of a new package verifies that everything is in the right
675     place.
676     </para>
677     </sect2>
678 plessy 6339 <sect2 id="building-and-tagging">
679     <title>Building and tagging the packages</title>
680     <para>
681     We prefer that uploaded packages are built in a chroot, to provide
682     similar build environment to the whole team. After upload, please <link linkend="vcs-tags">tag</link>
683     the <link linkend="svn-tag-release">Suvbersion</link> or <link linkend="git-tag-release">Git</link> repository.
684     </para>
685 hanska-guest 1277 </sect2>
686 plessy 6306 <sect2 id="patches">
687 hanska-guest 1277 <title>Handling patches</title>
688 plessy 6330 <para>
689     Often happens that the upstream code doesn't fit well into the
690     Debian distribution: be this wrong paths, missing features, anything
691     that implies editing the source files. When you directly edit
692     upstream's source files, your changes will be put into a .diff.gz file
693     if you use the <literal>1.0</literal> source format and in a monolithic
694     patch if you use the <literal>3.0 (quilt)</literal> format. To better
695     organise the patches and group the by function, please use a patch
696     handling system which keeps patches under the <filename
697     class="directory">debian/patches</filename> directory.
698     </para>
699     <para>
700     The <literal>3.0 (quilt)</literal> Dpkg source format provides its own
701     patch system. Apart from this, the most popular is
702     <command>quilt</command>. <emphasis>simple-patchsys</emphasis>, from
703     the <package>CDBS</package> package, is deprecated since version
704     <literal>0.4.85</literal>. <command>dpatch</command> has been popular
705     as well, but is not compatible with the <literal>3.0 (quilt)</literal>
706     source format. Please don't use any other patch system in Debian Med,
707     unless absolutely necessary.
708     </para>
709 plessy 6306 <sect3 id="quilt">
710 hanska-guest 1277 <title>Using <command>quilt</command></title>
711     <para>Using quilt is rather easy.</para>
712     <para>First, make sure you have correctly setup quilt: open
713     <filename>.quiltrc</filename> in your home directory (create
714     it if you don't have one), and make sure it looks like this:</para>
715     <blockquote>
716     <programlisting>QUILT_DIFF_ARGS="--no-timestamps --no-index"
717     QUILT_REFRESH_ARGS="--no-timestamps --no-index"
718     QUILT_PATCHES="debian/patches"</programlisting>
719     </blockquote>
720     <para>After this, you're ready to start working with quilt.</para>
721 plessy 6306 <sect4 id="quilt-create">
722 hanska-guest 1277 <title>Creating a patch</title>
723     <para>To create a patch, use the <command>new</command> command.
724     Run:</para>
725     <blockquote>
726     <para><userinput>
727     <command>quilt new</command> <filename>&lt;patch_name&gt;.patch</filename>
728     </userinput></para>
729     </blockquote>
730     <para>This will create (if it doesn't exist yet) a
731     <filename>debian/patches/series</filename> file, which
732     contains all the patches to be applied by quilt. Moreover,
733     the new patch is also the topmost (the currently
734     applied).</para>
735     <para>Now start editing files, with:</para>
736     <blockquote>
737     <para><userinput>
738     <command>quilt edit</command> <filename>&lt;file&gt;</filename>
739     </userinput></para>
740     </blockquote>
741     <para>and repeat the process for each file the patch is
742     involved with. At the end, run</para>
743     <blockquote>
744     <para><userinput>
745     <command>quilt refresh</command>
746     </userinput></para>
747     </blockquote>
748     <para>This will compare the noted state of the edited files
749     with the current state, and will produce a patch in
750     <filename>debian/patches</filename>. Remember: the patch
751     is currently applied (you can check this with
752     <command>quilt applied</command>).</para>
753     </sect4>
754 plessy 6306 <sect4 id="quilt-apply">
755 hanska-guest 1277 <title>Applying and unapplying patches</title>
756     <para>Just two easy commands to do the job:</para>
757     <itemizedlist>
758     <listitem><para><command>quilt pop</command> will unapply the topmost patch.</para></listitem>
759     <listitem><para><command>quilt push</command> will apply the next patch in debian/patches/series.</para></listitem>
760     </itemizedlist>
761     <para>You can just add a "-a" flag to the commands above, to
762     respectively apply/unapply all patches in the series.</para>
763     <tip>
764     <para>You can check which patches are applied/unapplied
765     with, respectively, <command>quilt applied</command> and
766     <command>quilt unapplied</command>.</para>
767     </tip>
768     </sect4>
769 plessy 6306 <sect4 id="quilt-edit">
770 hanska-guest 1277 <title>Editing patches</title>
771     <para>To edit a patch, first make it the topmost:</para>
772     <blockquote>
773     <para><userinput>
774     <command>quilt push</command> <filename>&lt;patch_name&gt;</filename>
775     </userinput></para>
776     </blockquote>
777     <para>If the patch is already applied, but is not the topmost,
778     run <command>quilt pop</command> until it becomes the currently
779     applied one.</para>
780     <para>You can now run <command>quilt edit</command> on the files
781     you want to change, and, when you're done, <command>quilt
782     refresh</command>.</para>
783     </sect4>
784 plessy 6306 <sect4 id="quilt-rename">
785 hanska-guest 1277 <title>Renaming patches</title>
786     <para>Sometimes it's useful to rename a patch. Without
787     any hassle, do:</para>
788     <blockquote>
789     <para><userinput>
790     <command>quilt rename -P</command> <filename>&lt;old_name&gt;.patch</filename>
791     <filename>&lt;new_name&gt;.patch</filename>
792     </userinput></para>
793     </blockquote>
794     </sect4>
795 plessy 6306 <sect4 id="quilt-other">
796 hanska-guest 1277 <title>Other commands</title>
797     <para>Please see <command>man 1 quilt</command> to have a
798     comprehensive list of commands.</para>
799     </sect4>
800 plessy 6306 <sect4 id="quilt-integration">
801 hanska-guest 1277 <title>Integration in the build process</title>
802     <para>Add in the very first part of <filename>debian/rules</filename>
803     (i.e. before the targets), the line:</para>
804     <blockquote>
805     <programlisting>include <filename class="headerfile">/usr/share/quilt/quilt.make</filename></programlisting>
806     </blockquote>
807 plessy 1847 <para>Please use this to import patch and unpatch rules instead of writing them, and remember to add the needed dependencies to its
808 hanska-guest 1277 targets:</para>
809     <blockquote>
810     <programlisting>...
811     build: patch build-stamp
812     build-stamp: configure
813     ...</programlisting>
814     </blockquote>
815     <para>This kind of dependency will ensure that if you also
816     patch the build system, you get a working patched build
817     process.</para>
818     <caution>
819     <para>Don't also put configure as a dependency of
820     build (leave it in build-stamp): that may cause problems
821     during parallel buildings (i.e. the -j flag of make).</para>
822     </caution>
823     <para>Now add a dependency to the clean target:</para>
824     <blockquote>
825     <programlisting>...
826     clean: unpatch
827     ...</programlisting>
828     </blockquote>
829     <para>If you've also patched the build system, using upstream's
830     clean target might fail. This is what you should do:</para>
831     <blockquote>
832     <programlisting>...
833     clean: clean-patched unpatch
834     clean-patched:
835     ...</programlisting>
836     </blockquote>
837     <para>Obviously, you could always use an approach like this,
838     but it's an useless complication if you don't patch the build
839     system, and you should keep <filename>debian/rules</filename>
840     the simplest you can.</para>
841     </sect4>
842     </sect3>
843 plessy 6306 <sect3 id="dpatch">
844 hanska-guest 1277 <title>Using <command>dpatch</command></title>
845 plessy 6306 <sect4 id="dpatch-create-patch">
846 hanska-guest 1277 <title>Creating a patch</title>
847     <para>dpatch-edit-patch</para>
848     </sect4>
849 plessy 6306 <sect4 id="dpatch-apply-unapply">
850 hanska-guest 1277 <title>Applying and unapplying patches</title>
851     <para>apply(-all), unapply(-all), status</para>
852     </sect4>
853 plessy 6306 <sect4 id="dpatch-edit-patch">
854 hanska-guest 1277 <title>Editing patches</title>
855     <para>dpatch-edit-patch</para>
856     </sect4>
857 plessy 6306 <sect4 id="dpatch-rename-patch">
858 hanska-guest 1277 <title>Renaming patches</title>
859     <para>Is this possible?</para>
860     </sect4>
861 plessy 6306 <sect4 id="dpatch-other">
862 hanska-guest 1277 <title>Other commands</title>
863     <para>Please see <command>man 1 dpatch</command> for a
864     comprehensive list of commands.</para>
865     </sect4>
866 plessy 6306 <sect4 id="dpatch-integration">
867 hanska-guest 1277 <title>Integration in the build process</title>
868     <para>Follow the instructions for quilt and adapt the path of
869     inclusion to <filename class="headerfile">/usr/share/dpatch/dpatch.make</filename></para>
870     </sect4>
871     </sect3>
872     </sect2>
873     </sect1>
874     </article>

  ViewVC Help
Powered by ViewVC 1.1.5