/[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 6327 - (hide annotations) (download) (as text)
Sun Mar 20 05:39:43 2011 UTC (2 years, 1 month ago) by plessy
File MIME type: text/xml
File size: 44649 byte(s)
Briefly describe possible Git layouts.
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 plessy 2866 <para>You can avoid specifying your Alioth user name by setting it in <filename>~/.ssh/config</filename>:</para>
136     <blockquote>
137     <programlisting>
138     Host *.debian.org
139     User yourusername
140     </programlisting>
141     </blockquote>
142 hanska-guest 1277 </listitem>
143     <listitem>
144 plessy 2409 <para>For read-only access, the syntax is slightly different:</para>
145 hanska-guest 1277 <blockquote>
146     <para><userinput>
147     <command>svn co</command> <filename class="directory">svn://svn.debian.org/svn/debian-med/trunk/...</filename>
148 plessy 4825 </userinput></para>
149     <para><userinput>
150 plessy 4307 <command>git clone</command> <filename class="directory">git://git.debian.org/git/debian-med/&lt;package&gt;.git</filename>
151 hanska-guest 1277 </userinput></para>
152     </blockquote>
153     </listitem>
154     </itemizedlist>
155     </para>
156 plessy 1847 <para>
157     Another way to check the sources is through the use of the
158     <command>debcheckout</command> command, from the
159     <ulink url="http://packages.debian.org/devscripts">devscripts</ulink>
160     package.
161     </para>
162 hanska-guest 1277 </sect2>
163 plessy 6327 <sect2 id="svn-repository-structure">
164     <title>Subversion repository structure</title>
165 hanska-guest 1277 <para>The SVN repository is structured as follows:
166 plessy 1847 <literallayout>
167     <code>
168     debian-med/
169     └ trunk/
170     ├ community/
171     │ ├ debtags/
172     │ ├ infrastructure/
173     │ └ website/
174     └ packages/
175     &lt;package A&gt;/
176     │ ├ branches/
177     │ ├ tags/
178     │ └ trunk/
179     │ └ debian/
180     &lt;package B&gt;/
181     │ ├ branches/
182     │ ├ tags/
183     │ └ trunk/
184     │ └ debian/
185    
186     </code>
187     </literallayout>
188     </para>
189     <note><para>We are currently considering an alternative layout in which all
190     the <filename>trunk</filename>, <filename>tags</filename> and
191 tille 5212 <filename>branches</filename> directories are grouped together, so that developers can checkout trunks without tags.</para></note>
192 hanska-guest 1277 </sect2>
193 plessy 6327 <sect2 id="git-repository-structures">
194     <title>Common Git repository structures</title>
195     <para>
196     The area on Alioth that contains the Git repositories (<filename
197     class="directory">/git/debian-med</filename>) is not itself structured,
198     but the repositories can be arranged in different possible layouts.
199     </para>
200     <sect3 id="git-buildpackage">
201     <title><command>git-buildpackage</command></title>
202     <para>
203     Most of our packages using Git and stored in Alioth are managed with
204     the <command>git-buildpackage</command> helper. The
205     <literal>master</literal> branch contains the full source package.
206     The <literal>upstream</literal> branch contains the upstream source,
207     after repacking when necessary (non-free files, large convenience code
208     copies, …). The <literal>pristine-tar</literal> contains the data
209     necessary to recreate an original tarball from the repository with a
210     reproducible checksum.
211     </para>
212     <para>
213     Debian releases are tagged with names like
214     <literal>debian/debianversion</literal> and upstream relases are
215     tagged with names like <literal>upstream/upstreamversion</literal>.
216     </para>
217     </sect3>
218     <sect3 id="git-without-tarball">
219     <title>Social Git</title>
220     <para>
221     For some projects, like the ones hosted on <ulink
222     url="http://www.github.com">Github</ulink> or <ulink
223     url="http://www.gitorious.com">Gitorious</ulink>, it may be easier to
224     forward changes made in the Debian package if this one is itself
225     hosted on the same platform, as a clone. In that case, the layouts
226     may vary from package to packages. However, there are good chances
227     that the branch that contains the Debian source package is called
228     <literal>debian</literal>.
229     </para>
230     </sect3>
231     </sect2>
232 plessy 6321
233     <sect2 id="git-tips">
234     <title>Git tips</title>
235 plessy 6325 <para id="new-repository-with-gbp">
236     Example to create a new git repository for a package where the upstream
237     sources are distributed as file archives (tar, zip, …):<programlisting>
238     <command>mkdir</command> <filename class="directory">package</filename>
239     <command>cd</command> <filename class="directory">package</filename>
240     <command>git init</command>
241     <command>git import-orig</command> <option>--pristine-tar</option> <filename>/path/to/package_version.orig.tar.gz</filename>
242     <command>dh_make</command> <option>-p package_x.y.z</option></programlisting>
243     The above steps will create a repository with the appropriate layout for
244     <command>git-buildpackage</command>, with three branches:
245     <literal>master</literal> (where the Debian development will happen),
246     <literal>pristine-tar</literal> used by the
247     <literal>pristine-tar</literal> tool during the package build process to
248     recreate the original tarball, and <literal>upstream</literal>, which
249     will contain the upstream source.
250 plessy 6321 </para>
251 plessy 6325 <para id="debcheckout-sets-git-options">
252     To display your name and more nicely in the Git log, you should instruct
253     Git to do so (the <option>--global</option> option is to say Git these
254     are the default parameters for every Git repository you commit to,
255     without it the settings will be per-repository only):<programlisting>
256     <command>git config</command> <option><optional>--global</optional></option> <option>user.name "$DEBFULLNAME"</option>
257     <command>git config</command> <option><optional>--global</optional></option> <option>user.email "$DEBEMAIL"</option></programlisting>
258     </para>
259     <para id="debcheckout-git-track">
260     To clone and follow every branch of a git repository containing a
261     package that is already in the Debian archive, you can use the
262     <command>debcheckout</command> command with its
263     <command><option>--git-track='*'</option></command> option. To restrict
264     the tracked branch to the standard ones used by
265     <command>git-buildpackage</command>, <literal>master upstream
266     pristine-tar</literal> can be passed instead of the wildcard.
267     </para>
268     <para id="git-track-new-branches">
269 plessy 6322 Example commands to track new branches: <programlisting>
270 plessy 6325 <command>git branch</command> <option>-t <replaceable>upstream</replaceable> <replaceable>origin/upstream</replaceable></option>
271     <command>git branch</command> <option>-t <replaceable>pristine-tar</replaceable> <replaceable>origin/pristine-tar</replaceable></option></programlisting>
272 plessy 6322 </para>
273 plessy 6325 <para id="git-options-devscripts">
274     If the <package>devscripts</package> variables
275     <varname>DEBEMAIL</varname> and <varname>DEBFULLNAME</varname> are set,
276     <command>debcheckout</command> will set <command>git</command>'s options
277     <varname>user.email</varname> and <varname>user.name</varname>
278     accordingly.
279 plessy 6321 </para>
280 plessy 6325 <para id="git-add-alioth-branch">
281     To push changes to Alioth, a remote branch needs to be configured. This
282     is done automatically after cloning a repository, for instance with
283     <link linkend="debcheckout-git-track">debcheckout</link>. The default
284     remote branch is called <quote>origin</quote>. Here are example
285     commands to set up Alioth as a remote branch on a freshly created
286     repository:<programlisting>
287     <command>git remote add</command> <literal>origin</literal> <filename class="directory">git+ssh://alioth.debian.org/git/debian-med/package.git</filename></programlisting>
288     </para>
289     <para id="create-git-repository-on-alioth">
290     There is a small script called <command>setup-repository</command> in
291     the <filename class="directory">/git/debian-med</filename> directory on
292     Alioth. <code><command>./setup-repository</command>
293     <option>packagename</option> <option>"Description of the
294     package"</option></code> will create a <filename
295     class="directory">packagename.git</filename> repository on with the
296     proper hooks set up for our team.
297     </para>
298     <para id="push-package-to-alioth">
299     To push the package (make sure you've added the alioth remote!), do the
300     following:<code><command>git push</command> <option>origin
301     master</option></code>. For the first push, it's necessary to specify
302     <option>origin master</option>. The next time you will push, a
303     <command>git push</command> will suffice.
304     </para>
305     <para id="git-push-all-tags">
306     <command>git push</command>this will only push the
307     <literal>master</literal> branch unless it is somehow related to other
308     branches), so be sure to also do a run with <option>--all</option>, and one with <option>--tags</option> if you created new tags.
309     </para>
310 plessy 6326 <para id="git-layout-variants">
311     In particular for Git repositories that are not stored in Alioth, the
312     layout can differ from <command>git-buildpackage</command> conventions.
313     In that case, look for instance for a branch called <literal>debian</literal>.
314     </para>
315 plessy 6321 </sect2>
316    
317 plessy 6306 <sect2 id="subversion-to-git">
318 plessy 4307 <title>Migration of a source package from Subversion to Git.</title>
319     <para>There is no easy way to prepare a Git repository from our Subversion repository that would
320     look like the package was always managed in Git, because we use svn-buildpackage with the
321     mergeWithUpstream property set, which excludes the upstream sources. Nevertheless, the
322     following receipe will genearate a Git repostitory that contains all the history of
323     the debian directory, plus a collection of selected upstream source releases.
324     </para>
325     <itemizedlist>
326     <listitem>
327     <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>
328     </listitem>
329     <listitem>
330     <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>.
331     </para>
332     </listitem>
333     <listitem>
334     <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.
335     </para>
336     </listitem>
337     </itemizedlist>
338 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>
339 plessy 4307 </sect2>
340 plessy 6306 <sect2 id="updating-git-package">
341 plessy 5518 <title>Updating a source package managed with Git</title>
342     <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>
343     <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>
344     </sect2>
345 hanska-guest 1277 </sect1>
346 plessy 6306 <sect1 id="packaging">
347 hanska-guest 1277 <title>Packaging</title>
348 plessy 6306 <sect2 id="itp">
349 hanska-guest 1277 <title>Announcing intent to package</title>
350     <para>If you intent to work on a Debian package you should follow
351 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>
352 tille 3777 <para>It is a good idea to keep the Debian Med mailing list
353 plessy 1847 <ulink url="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</ulink>
354 plessy 2630 <ulink url="http://www.debian.org/Bugs/Reporting#xcc"> in CC</ulink> and to set it
355     as the owner of the ITP to keep your co-workers informed. This will ensure that we notice
356 plessy 4042 if for some reason the package has not been uploaded.</para>
357     <para>In addition, please add the package to the <quote>task</quote> file where it fits
358     the best, and document your ITP number using the <command>WNPP</command> field name.</para>
359 hanska-guest 1277 </sect2>
360 plessy 1847 </sect1>
361 plessy 6306 <sect1 id="tasks">
362 plessy 4042 <title>Tasks</title>
363     <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>
364     <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>
365     <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>
366     </sect1>
367 plessy 6306 <sect1 id="policy">
368 plessy 1847 <title>Policy</title>
369 plessy 6306 <sect2 id="debian-control">
370 plessy 1847 <title><filename>debian/control</filename></title>
371     <orderedlist>
372     <listitem>
373     <formalpara>
374     <title>Section</title>
375     <para>Should be <quote>science</quote> for the source package.</para>
376     </formalpara>
377     </listitem>
378    
379     <listitem>
380     <formalpara>
381     <title>Priority</title>
382     <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>
383     </formalpara>
384     </listitem>
385    
386     <listitem>
387     <formalpara>
388     <title>Maintainer</title>
389 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>
390 plessy 1847 </formalpara>
391     </listitem>
392    
393     <listitem>
394     <formalpara>
395     <title>Upload by Debian Maintainers</title>
396     <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>
397     </formalpara>
398     </listitem>
399    
400     <listitem>
401     <formalpara>
402     <title>Uploaders</title>
403 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>.
404 plessy 1847 </para>
405     </formalpara>
406     </listitem>
407    
408     <listitem>
409     <formalpara>
410     <title>Standards-Version</title>
411     <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>
412     </formalpara>
413     </listitem>
414    
415     <listitem>
416     <formalpara>
417     <title>Homepage</title>
418     <para>should be documented whenever possible</para>
419     </formalpara>
420     </listitem>
421    
422     <listitem>
423     <formalpara>
424     <title>Vcs-Svn: and Vcs-Browser:</title>
425 plessy 4307 <para>Please use the following templates:
426 plessy 1847 <programlisting>
427 hanska-guest 1277 Vcs-Svn: svn://svn.debian.org/svn/debian-med/trunk/packages/&lt;package&gt;/trunk/
428     Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/&lt;package&gt;/trunk/?rev=0&amp;sc=0
429 plessy 4307 </programlisting>or
430     <programlisting>
431     Vcs-Git: git://git.debian.org/git/debian-med/&lt;package&gt;.git
432     Vcs-Browser: http://git.debian.org/?p=debian-med/&lt;package&gt;.git
433 plessy 1847 </programlisting>
434 plessy 4304 </para>
435 plessy 1847 </formalpara>
436     </listitem>
437     </orderedlist>
438 hanska-guest 1277 </sect2>
439 plessy 1847
440 plessy 6306 <sect2 id="debian-copyright">
441 plessy 1847 <title><filename>debian/copyright</filename></title>
442 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>
443 plessy 1847 </sect2>
444    
445 plessy 6306 <sect2 id="debian-changelog">
446 plessy 1847 <title><filename>debian/changelog</filename></title>
447     <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>
448     </sect2>
449 plessy 6306 <sect2 id="debian-readme-source">
450 plessy 2667 <title><filename>debian/README.source</filename></title>
451 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>
452 plessy 2667 </sect2>
453 plessy 1847
454 plessy 6306 <sect2 id="debhelper">
455 plessy 1847 <title>Debhelper</title>
456 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
457     is available in current <emphasis>Stable</emphasis> (Squeeze) and backported to <emphasis>Oldstable</emphasis>. However, there is no urgent need to
458     touch packages only because it has an older Debhelper version.</para>
459 tille 6312 <para>
460     It is strongly recommended to use the short <emphasis>dh</emphasis> notation in <filename>debian/rules</filename> files which makes code factorisation very
461 tille 6313 simple and easy to understand the packaging for other members of the team. Even complex packaging becomes quite transparant this way.
462 tille 6312 </para>
463 plessy 1847 </sect2>
464    
465 plessy 6306 <sect2 id="cdbs">
466 plessy 1847 <title>CDBS</title>
467 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.
468     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
469 plessy 6319 to switch from CDBS to <emphasis>dh</emphasis> if some problems in the packaging might occure.</para>
470 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>
471     </sect2>
472 plessy 6310
473     <sect2 id="vcs">
474     <title>Version control systems</title>
475     <para>
476     We are currently using two different version control systems, Subversion and Git.
477     </para>
478     <sect3 id="vcs-svn">
479     <title>Source package stored in a Subversion repository</title>
480     <para>
481     <emphasis>This section is in construction, see <link linkend="svn-inject">below</link> for te moment.</emphasis>
482     </para>
483     </sect3>
484     <sect3 id="vcs-git">
485     <title>Source package stored in a Git repository</title>
486     <para>
487     Git repositories managed with a helper tool should announce it. For instance, to show that <command>git-buildpackage</command> is used, the package can contain a configuration file in <filename>debian/gbp.conf</filename>.
488     </para>
489     </sect3>
490     </sect2>
491 plessy 1847
492 plessy 6306 <sect2 id="new-package">
493 hanska-guest 1277 <title>Injecting a new package</title>
494 plessy 6306 <sect3 id="svn-inject">
495 hanska-guest 4323 <title>Subversion</title>
496 hanska-guest 1277 <para>To inject a new package to the SVN repository, you must have
497 plessy 1847 write access to it; i.e. you must be a member of the <emphasis>debian-med</emphasis> group on Alioth.</para>
498 hanska-guest 1277 <para>You can inject a new package only after successfully building
499 plessy 1847 it with <command>dpkg-buildpackage</command> (or any wrapper around it). We use the MergeWithUpstream workflow, so please keep all the modifications in the <filename>debian</filename> directory, and use the <option>-o</option> of <command>svn-buildpackage</command>, as in the following example:</para>
500 hanska-guest 1277 <blockquote>
501     <para><userinput>
502     <command>svn-inject</command>
503 plessy 1847 <option>-o</option>
504 hanska-guest 1277 <filename>package.dsc</filename>
505     <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/packages/</filename>
506     </userinput></para>
507     </blockquote>
508     <para>The <command>svn-inject</command> command is found in the
509     <command>svn-buildpackage</command> package (just
510     <command>apt-get</command> it).</para>
511     <para>Once you injected a new package please make sure that it is
512     mentioned in the apropriate tasks file in the package source of the
513 tille 3777 debian-med Blend package in SVN. Normally maintainer watch the changes in
514     the Debian Med packaging pool but it helps if the maintainer of a
515 hanska-guest 1277 certain package verifies that everything is in the right place.</para>
516 hanska-guest 4323 </sect3>
517 plessy 6325 <sect3 id="new-git-repo">
518     <title>New package stored in a Git repository.</title>
519     <para>
520     Git repositories should be stored in the
521     <filename class="directory">/git/debian-med</filename> directory on Alioth and created with the <link
522     linkend="create-git-repository-on-alioth"><command>setup-repository</command></link>
523     script available there.
524     </para>
525     </sect3>
526     </sect2>
527 plessy 6306 <sect2 id="building-and-tagging">
528 plessy 4825 <title>Building and tagging the packages</title>
529 plessy 6306 <sect3 id="building">
530 hanska-guest 1277 <title>Building the packages</title>
531 plessy 6306 <sect4 id="building-subversion">
532 hanska-guest 4323 <title>Subversion</title>
533 hanska-guest 1277 <para>To build the package, just use the tools that <command>svn-buildpackage</command>
534     carries. First of all, we suggest you to define some aliases for the
535     most common commands:</para>
536     <blockquote>
537     <programlisting>alias svn-b='svn-buildpackage -us -uc -rfakeroot --svn-ignore'
538     alias svn-br='svn-b --svn-dont-purge --svn-reuse'
539     alias svn-bt='svn-buildpackage --svn-tag -rfakeroot'</programlisting>
540     </blockquote>
541     <para>Checkout the sources (see the proper section).</para>
542     <para>Once done, you're ready to do the work. First, cd to the trunk
543     directory, and download the upstream sources (if there is a
544     <filename>debian/watch</filename> file):</para>
545     <blockquote>
546     <para><userinput>
547     <command>echo "origDir=.." &gt;&gt; .svn/deb-layout &amp;&amp; uscan --force-download</command>
548     </userinput></para>
549     </blockquote>
550     <para>Alternatively, you can try this, it depends on how the package
551     was built (again, from the <filename class="directory">trunk/</filename> directory):</para>
552     <blockquote>
553     <para><userinput>
554     <command>debian/rules get-orig-source</command>
555     </userinput></para>
556     </blockquote>
557     <para>Once done, edit the files you need, and then build the package with
558     <command>svn-b</command> or <command>svn-br</command>.</para>
559 tille 3777 <para>If you're a Debian Med member, you can commit your changes:</para>
560 hanska-guest 1277 <blockquote>
561     <para><userinput>
562     <command>svn commit</command>
563     </userinput></para>
564     </blockquote>
565     <para>(also <command>svn ci</command>).</para>
566     <para>Otherwise, you can ask to be added to the group (see the Membership
567     section), or send the result of svn diff to the
568 plessy 1847 <ulink url="mailto:debian-med@lists.debian.org">mailing list</ulink>
569 hanska-guest 1277 (<command>gzip -9</command> it, if it's too large).</para>
570 hanska-guest 4323 </sect4>
571 plessy 6306 <sect4 id="building-git">
572 hanska-guest 4323 <title>Git</title>
573     <para>You should use <command>git-buildpackage</command> to build the
574     packages with git. Be sure to run it from the <quote>master</quote>
575     branch.</para>
576     <para>Unfortunately, by default <command>git-buildpackage</command>
577     builds the package without using any chroot (the same as
578     <command>svn-buildpackage</command>), but it's configurable to run
579     it inside a chroot.</para>
580     <para>You can use this configuration file, <filename>~/.gbp.conf</filename>:</para>
581     <blockquote>
582     <programlisting>[DEFAULT]
583     builder = ~/bin/git-pbuilder
584     cleaner = fakeroot debian/rules clean
585     pristine-tar = True
586    
587     [git-buildpackage]
588     # use this for more svn-buildpackage like behaviour:
589     export-dir = ../build-area/
590     tarball-dir = ../tarballs/</programlisting>
591     </blockquote>
592     <para>With this configuration file you're specifying that
593     <command>git-buildpackage</command> will use <filename>~/bin/git-pbuilder</filename>
594     as the builder script. This is an example script you can use:</para>
595     <blockquote>
596     <programlisting>#!/bin/sh
597     set -e
598    
599     pdebuild --pbuilder cowbuilder --debbuildopts "-i\.git -I.git $*"
600     rm ../*_source.changes</programlisting>
601     </blockquote>
602     <para>This will build the package inside the default cowbuilder chroot, while
603     passing any more parameters directly do <command>dpkg-buildpackage</command>.</para>
604     </sect4>
605     </sect3>
606 plessy 6306 <sect3 id="tagging">
607 hanska-guest 1277 <title>Tagging packages</title>
608 plessy 6306 <sect4 id="tagging-subversion">
609 hanska-guest 4323 <title>Subversion</title>
610 hanska-guest 1277 <para>It may happen that a package version has been uploaded to Debian
611     repositories, and you forgot to tag the last build with</para>
612     <blockquote>
613     <para><userinput>
614     <command>svn-buildpackage --svn-tag</command>
615     </userinput></para>
616     </blockquote>
617     <para>
618     You can tag this package also retroactively. A first step, creating
619     the tags directory, can be achieved in two ways:
620     <itemizedlist>
621     <listitem>
622     <para>create it locally (it is a sibling of <filename class="directory">trunk/</filename>), and commit:</para>
623     <blockquote>
624     <para><userinput>
625     <command>svn mkdir</command> <filename class="directory">tags</filename>
626     </userinput></para>
627     <para><userinput>
628     <command>svn commit</command>
629     </userinput></para>
630     </blockquote>
631     </listitem>
632     <listitem>
633     <para>create it remotely:</para>
634     <blockquote>
635     <para><userinput>
636     <command>svn mkdir</command> <filename class="directory">svn+ssh://user@svn.debian.org/svn/debian-med/trunk/packages/&lt;package&gt;/tags</filename>
637     </userinput></para>
638     </blockquote>
639     </listitem>
640     </itemizedlist>
641     </para>
642     <para>After the tags directory has been created, you're ready to tag the
643     package:</para>
644     <blockquote>
645     <para><userinput>
646     <command>svn-buildpackage --svn-tag-only --svn-no-autodch</command>
647     </userinput></para>
648     </blockquote>
649     <para>(--svn-no-autodch avoids <filename>debian/changelog</filename> to be marked as UNRELEASED).</para>
650 hanska-guest 4323 </sect4>
651 plessy 6306 <sect4 id="tagging-git">
652 hanska-guest 4323 <title>Git</title>
653     <para>Tagging a release with git is pretty straightforward:</para>
654     <blockquote>
655     <para><userinput>
656     <command>git tag</command>
657     <option>tagname</option>
658     </userinput></para>
659     </blockquote>
660     <para>The tag names usually follow the scheme <quote>debian/x.y-z</quote>,
661     this will ensure compatibility with other tools as well (like
662     <command>git import-dsc</command>).</para>
663     <para>You can also easily retroactively make tags:</para>
664     <blockquote>
665     <para><userinput>
666     <command>git checkout</command>
667     <option>&lt;commit hash&gt;</option>
668     </userinput></para>
669     </blockquote>
670     <para>You're now at the point in history when you released the package.
671     Just tag it as you would normally do.</para>
672     <para>After tagging, be sure to <command>git push --tags</command>, so that
673     other people can benefit from it too.</para>
674     </sect4>
675     </sect3>
676 hanska-guest 1277 </sect2>
677 plessy 6306 <sect2 id="patches">
678 hanska-guest 1277 <title>Handling patches</title>
679     <para>Often happens that the upstream code doesn't fit well into the
680     Debian distribution: be this wrong paths, missing features, anything
681     that implies editing the source files. When you directly edit
682     upstream's source files, your changes will be put into a .diff.gz file,
683 plessy 1847 which should instead contain only debian. To better organise the patches and group the by function, please use a patch handling system which keeps patches under the
684     <filename class="directory">debian/patches</filename> directory.</para>
685     <para>The most known are <command>quilt</command>, <emphasis>simple-patchsys</emphasis> (from the <emphasis>CDBS</emphasis> package) and <command>dpatch</command>.
686 tille 3777 Please don't use any other patch system in Debian Med, unless absolutely
687 hanska-guest 1277 necessary.</para>
688 plessy 6306 <sect3 id="quilt">
689 hanska-guest 1277 <title>Using <command>quilt</command></title>
690     <para>Using quilt is rather easy.</para>
691     <para>First, make sure you have correctly setup quilt: open
692     <filename>.quiltrc</filename> in your home directory (create
693     it if you don't have one), and make sure it looks like this:</para>
694     <blockquote>
695     <programlisting>QUILT_DIFF_ARGS="--no-timestamps --no-index"
696     QUILT_REFRESH_ARGS="--no-timestamps --no-index"
697     QUILT_PATCHES="debian/patches"</programlisting>
698     </blockquote>
699     <para>After this, you're ready to start working with quilt.</para>
700 plessy 6306 <sect4 id="quilt-create">
701 hanska-guest 1277 <title>Creating a patch</title>
702     <para>To create a patch, use the <command>new</command> command.
703     Run:</para>
704     <blockquote>
705     <para><userinput>
706     <command>quilt new</command> <filename>&lt;patch_name&gt;.patch</filename>
707     </userinput></para>
708     </blockquote>
709     <para>This will create (if it doesn't exist yet) a
710     <filename>debian/patches/series</filename> file, which
711     contains all the patches to be applied by quilt. Moreover,
712     the new patch is also the topmost (the currently
713     applied).</para>
714     <para>Now start editing files, with:</para>
715     <blockquote>
716     <para><userinput>
717     <command>quilt edit</command> <filename>&lt;file&gt;</filename>
718     </userinput></para>
719     </blockquote>
720     <para>and repeat the process for each file the patch is
721     involved with. At the end, run</para>
722     <blockquote>
723     <para><userinput>
724     <command>quilt refresh</command>
725     </userinput></para>
726     </blockquote>
727     <para>This will compare the noted state of the edited files
728     with the current state, and will produce a patch in
729     <filename>debian/patches</filename>. Remember: the patch
730     is currently applied (you can check this with
731     <command>quilt applied</command>).</para>
732     </sect4>
733 plessy 6306 <sect4 id="quilt-apply">
734 hanska-guest 1277 <title>Applying and unapplying patches</title>
735     <para>Just two easy commands to do the job:</para>
736     <itemizedlist>
737     <listitem><para><command>quilt pop</command> will unapply the topmost patch.</para></listitem>
738     <listitem><para><command>quilt push</command> will apply the next patch in debian/patches/series.</para></listitem>
739     </itemizedlist>
740     <para>You can just add a "-a" flag to the commands above, to
741     respectively apply/unapply all patches in the series.</para>
742     <tip>
743     <para>You can check which patches are applied/unapplied
744     with, respectively, <command>quilt applied</command> and
745     <command>quilt unapplied</command>.</para>
746     </tip>
747     </sect4>
748 plessy 6306 <sect4 id="quilt-edit">
749 hanska-guest 1277 <title>Editing patches</title>
750     <para>To edit a patch, first make it the topmost:</para>
751     <blockquote>
752     <para><userinput>
753     <command>quilt push</command> <filename>&lt;patch_name&gt;</filename>
754     </userinput></para>
755     </blockquote>
756     <para>If the patch is already applied, but is not the topmost,
757     run <command>quilt pop</command> until it becomes the currently
758     applied one.</para>
759     <para>You can now run <command>quilt edit</command> on the files
760     you want to change, and, when you're done, <command>quilt
761     refresh</command>.</para>
762     </sect4>
763 plessy 6306 <sect4 id="quilt-rename">
764 hanska-guest 1277 <title>Renaming patches</title>
765     <para>Sometimes it's useful to rename a patch. Without
766     any hassle, do:</para>
767     <blockquote>
768     <para><userinput>
769     <command>quilt rename -P</command> <filename>&lt;old_name&gt;.patch</filename>
770     <filename>&lt;new_name&gt;.patch</filename>
771     </userinput></para>
772     </blockquote>
773     </sect4>
774 plessy 6306 <sect4 id="quilt-other">
775 hanska-guest 1277 <title>Other commands</title>
776     <para>Please see <command>man 1 quilt</command> to have a
777     comprehensive list of commands.</para>
778     </sect4>
779 plessy 6306 <sect4 id="quilt-integration">
780 hanska-guest 1277 <title>Integration in the build process</title>
781     <para>Add in the very first part of <filename>debian/rules</filename>
782     (i.e. before the targets), the line:</para>
783     <blockquote>
784     <programlisting>include <filename class="headerfile">/usr/share/quilt/quilt.make</filename></programlisting>
785     </blockquote>
786 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
787 hanska-guest 1277 targets:</para>
788     <blockquote>
789     <programlisting>...
790     build: patch build-stamp
791     build-stamp: configure
792     ...</programlisting>
793     </blockquote>
794     <para>This kind of dependency will ensure that if you also
795     patch the build system, you get a working patched build
796     process.</para>
797     <caution>
798     <para>Don't also put configure as a dependency of
799     build (leave it in build-stamp): that may cause problems
800     during parallel buildings (i.e. the -j flag of make).</para>
801     </caution>
802     <para>Now add a dependency to the clean target:</para>
803     <blockquote>
804     <programlisting>...
805     clean: unpatch
806     ...</programlisting>
807     </blockquote>
808     <para>If you've also patched the build system, using upstream's
809     clean target might fail. This is what you should do:</para>
810     <blockquote>
811     <programlisting>...
812     clean: clean-patched unpatch
813     clean-patched:
814     ...</programlisting>
815     </blockquote>
816     <para>Obviously, you could always use an approach like this,
817     but it's an useless complication if you don't patch the build
818     system, and you should keep <filename>debian/rules</filename>
819     the simplest you can.</para>
820     </sect4>
821     </sect3>
822 plessy 6306 <sect3 id="dpatch">
823 hanska-guest 1277 <title>Using <command>dpatch</command></title>
824 plessy 6306 <sect4 id="dpatch-create-patch">
825 hanska-guest 1277 <title>Creating a patch</title>
826     <para>dpatch-edit-patch</para>
827     </sect4>
828 plessy 6306 <sect4 id="dpatch-apply-unapply">
829 hanska-guest 1277 <title>Applying and unapplying patches</title>
830     <para>apply(-all), unapply(-all), status</para>
831     </sect4>
832 plessy 6306 <sect4 id="dpatch-edit-patch">
833 hanska-guest 1277 <title>Editing patches</title>
834     <para>dpatch-edit-patch</para>
835     </sect4>
836 plessy 6306 <sect4 id="dpatch-rename-patch">
837 hanska-guest 1277 <title>Renaming patches</title>
838     <para>Is this possible?</para>
839     </sect4>
840 plessy 6306 <sect4 id="dpatch-other">
841 hanska-guest 1277 <title>Other commands</title>
842     <para>Please see <command>man 1 dpatch</command> for a
843     comprehensive list of commands.</para>
844     </sect4>
845 plessy 6306 <sect4 id="dpatch-integration">
846 hanska-guest 1277 <title>Integration in the build process</title>
847     <para>Follow the instructions for quilt and adapt the path of
848     inclusion to <filename class="headerfile">/usr/share/dpatch/dpatch.make</filename></para>
849     </sect4>
850     </sect3>
851     </sect2>
852     </sect1>
853     </article>

  ViewVC Help
Powered by ViewVC 1.1.5