| 1 |
<?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 |
<title>Debian-Med Group Policy</title>
|
| 8 |
<articleinfo>
|
| 9 |
<authorgroup>
|
| 10 |
<author>
|
| 11 |
<firstname>Andreas</firstname>
|
| 12 |
<surname>Tille</surname>
|
| 13 |
<contrib>First review </contrib>
|
| 14 |
<email>tille@debian.org</email>
|
| 15 |
</author>
|
| 16 |
<author>
|
| 17 |
<firstname>David</firstname>
|
| 18 |
<surname>Paleino</surname>
|
| 19 |
<contrib>Initial writing </contrib>
|
| 20 |
<email>d.paleino@gmail.com</email>
|
| 21 |
</author>
|
| 22 |
<author>
|
| 23 |
<firstname>Charles</firstname>
|
| 24 |
<surname>Plessy</surname>
|
| 25 |
<contrib>Contributions in 2008</contrib>
|
| 26 |
<email>plessy@debian.org</email>
|
| 27 |
</author>
|
| 28 |
</authorgroup>
|
| 29 |
<releaseinfo>
|
| 30 |
$ policy.xml rev. @REV@ - @DATE@ (@AUTHOR@) $
|
| 31 |
</releaseinfo>
|
| 32 |
</articleinfo>
|
| 33 |
<mediaobject>
|
| 34 |
<objectinfo>
|
| 35 |
<title>Debian-Med Group</title>
|
| 36 |
</objectinfo>
|
| 37 |
<imageobject>
|
| 38 |
<imagedata fileref="/img/debian-med.jpg" format="JPG" align="center" />
|
| 39 |
</imageobject>
|
| 40 |
</mediaobject>
|
| 41 |
<sect1>
|
| 42 |
<title>Introduction</title>
|
| 43 |
<para>Debian-Med is a <quote><ulink url="http://people.debian.org/~tille/cdd">Custom Debian Distribution</ulink></quote>
|
| 44 |
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 |
<para>The Debian-Med project presents packages that are associated
|
| 47 |
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 |
Debian-Med is not a competition to these efforts but a platform to
|
| 53 |
present the packages to the community as a Custom Debian Distribution.</para>
|
| 54 |
</sect1>
|
| 55 |
<sect1>
|
| 56 |
<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 |
<ulink url="http://www.debian.org">www.debian.org</ulink>
|
| 67 |
and to ease the integration of new members.</para>
|
| 68 |
<para>Please contact us on <ulink url="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</ulink>
|
| 69 |
if you want to help to make medical and biological software available
|
| 70 |
to Debian users. Read the <link linkend="membership">Membership</link> section if you're
|
| 71 |
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 |
<ulink url="http://ddtp.debian.org">ddtp.debian.org</ulink>.</para>
|
| 75 |
<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 |
to Debian-Med's source code repository. Very welcome are tutorials that
|
| 78 |
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 |
<sect2>
|
| 82 |
<title id="membership">Membership</title>
|
| 83 |
<para>To request membership to this group, please go on our
|
| 84 |
<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 |
Remember that you must have an Alioth account before requesting
|
| 87 |
membership (see <ulink url="http://alioth.debian.org/account/register.php">here</ulink>
|
| 88 |
to request an Alioth account).</para>
|
| 89 |
</sect2>
|
| 90 |
<sect2>
|
| 91 |
<title id="readings">Essential readings</title>
|
| 92 |
<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 |
<listitem><para>The <ulink url="http://www.debian.org/doc/developers-reference/">Developpers Reference</ulink>: details best packaging practices.</para></listitem>
|
| 95 |
<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 |
</sect1>
|
| 100 |
<sect1>
|
| 101 |
<title>Subversion</title>
|
| 102 |
<para>Our Subversion (SVN) repository is currently hosted on
|
| 103 |
<ulink url="http://alioth.debian.org/">Alioth</ulink>, the hosting
|
| 104 |
facility provided by Debian to free software developers. You can have a look at
|
| 105 |
the repository through Alioth's <ulink url="http://svn.debian.org/wsvn/debian-med/trunk/?rev=0&sc=0">web</ulink>
|
| 106 |
<ulink url="http://svn.debian.org/viewsvn/debian-med">interfaces</ulink>.</para>
|
| 107 |
<sect2>
|
| 108 |
<title>Give me the source!</title>
|
| 109 |
<para>
|
| 110 |
To check sources out from SVN, please do:
|
| 111 |
<itemizedlist>
|
| 112 |
<listitem>
|
| 113 |
<para>If you are a member of Debian-Med or a Debian developper, you have write permission:</para>
|
| 114 |
<blockquote>
|
| 115 |
<para><userinput>
|
| 116 |
<command>svn co</command> <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/...</filename>
|
| 117 |
</userinput></para>
|
| 118 |
</blockquote>
|
| 119 |
</listitem>
|
| 120 |
<listitem>
|
| 121 |
<para>For read-only access, the syntax is slightly different:</para>
|
| 122 |
<blockquote>
|
| 123 |
<para><userinput>
|
| 124 |
<command>svn co</command> <filename class="directory">svn://svn.debian.org/svn/debian-med/trunk/...</filename>
|
| 125 |
</userinput></para>
|
| 126 |
</blockquote>
|
| 127 |
</listitem>
|
| 128 |
</itemizedlist>
|
| 129 |
</para>
|
| 130 |
<para>
|
| 131 |
Another way to check the sources is through the use of the
|
| 132 |
<command>debcheckout</command> command, from the
|
| 133 |
<ulink url="http://packages.debian.org/devscripts">devscripts</ulink>
|
| 134 |
package.
|
| 135 |
</para>
|
| 136 |
</sect2>
|
| 137 |
<sect2>
|
| 138 |
<title>Repository structure</title>
|
| 139 |
<para>The SVN repository is structured as follows:
|
| 140 |
<literallayout>
|
| 141 |
<code>
|
| 142 |
debian-med/
|
| 143 |
└ trunk/
|
| 144 |
├ community/
|
| 145 |
│ ├ debtags/
|
| 146 |
│ ├ infrastructure/
|
| 147 |
│ └ website/
|
| 148 |
└ packages/
|
| 149 |
├ <package A>/
|
| 150 |
│ ├ branches/
|
| 151 |
│ ├ tags/
|
| 152 |
│ └ trunk/
|
| 153 |
│ └ debian/
|
| 154 |
├ <package B>/
|
| 155 |
│ ├ branches/
|
| 156 |
│ ├ tags/
|
| 157 |
│ └ trunk/
|
| 158 |
│ └ debian/
|
| 159 |
…
|
| 160 |
</code>
|
| 161 |
</literallayout>
|
| 162 |
</para>
|
| 163 |
<note><para>We are currently considering an alternative layout in which all
|
| 164 |
the <filename>trunk</filename>, <filename>tags</filename> and
|
| 165 |
<filename>branches</filename> directories are grouped together, so that developpers can checkout trunks without tags.</para></note>
|
| 166 |
</sect2>
|
| 167 |
</sect1>
|
| 168 |
<sect1>
|
| 169 |
<title>Packaging</title>
|
| 170 |
<sect2>
|
| 171 |
<title>Announcing intent to package</title>
|
| 172 |
<para>If you intent to work on a Debian package you should follow
|
| 173 |
the <ulink url="http://www.debian.org/devel/wnpp/#l1">normal Debian rules</ulink> and file a <acronym>WNPP</acronym> bug report.</para>
|
| 174 |
<para>It is a good idea to keep the Debian-Med mailing list
|
| 175 |
<ulink url="mailto:debian-med@lists.debian.org">debian-med@lists.debian.org</ulink>
|
| 176 |
<ulink url="http://www.debian.org/Bugs/Reporting#xcc"> in CC</ulink> and to set it
|
| 177 |
as the owner of the ITP to keep your co-workers informed. This will ensure that we notice
|
| 178 |
if for some reason the package has not been uploaded, when the ITP bug is
|
| 179 |
<ulink url="http://lists.debian.org/msgid-search/1127503245.4308.5.camel@cerdita">
|
| 180 |
automatically closed</ulink> one year later.</para>
|
| 181 |
<para>In addition to this you should add a user tag to this
|
| 182 |
<acronym>WNPP</acronym> bug to indicate which meta-package will likely recommend
|
| 183 |
the new package.</para>
|
| 184 |
<para>This can be done by sending a mail to <ulink url="mailto:request@bugs.debian.org">request@bugs.debian.org</ulink>
|
| 185 |
with the following content:</para>
|
| 186 |
<blockquote>
|
| 187 |
<programlisting>user debian-med@lists.debian.org
|
| 188 |
usertag <bug-number> + wnpp med-<task>
|
| 189 |
thanks</programlisting>
|
| 190 |
</blockquote>
|
| 191 |
<para>For instance if you want to tag an <acronym>ITP</acronym> with
|
| 192 |
bug number #123456 for Debian-Med section biology you would do the
|
| 193 |
following:</para>
|
| 194 |
<blockquote>
|
| 195 |
<programlisting>mailx -s "Tagging bug #123456" request@bugs.debian.org <<...
|
| 196 |
user debian-med@lists.debian.org
|
| 197 |
usertag 123456 + wnpp med-bio
|
| 198 |
thanks
|
| 199 |
...</programlisting>
|
| 200 |
</blockquote>
|
| 201 |
</sect2>
|
| 202 |
</sect1>
|
| 203 |
<sect1>
|
| 204 |
<title>Policy</title>
|
| 205 |
<sect2>
|
| 206 |
<title><filename>debian/control</filename></title>
|
| 207 |
<orderedlist>
|
| 208 |
<listitem>
|
| 209 |
<formalpara>
|
| 210 |
<title>Section</title>
|
| 211 |
<para>Should be <quote>science</quote> for the source package.</para>
|
| 212 |
</formalpara>
|
| 213 |
</listitem>
|
| 214 |
|
| 215 |
<listitem>
|
| 216 |
<formalpara>
|
| 217 |
<title>Priority</title>
|
| 218 |
<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>
|
| 219 |
</formalpara>
|
| 220 |
</listitem>
|
| 221 |
|
| 222 |
<listitem>
|
| 223 |
<formalpara>
|
| 224 |
<title>Maintainer</title>
|
| 225 |
<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>
|
| 226 |
</formalpara>
|
| 227 |
</listitem>
|
| 228 |
|
| 229 |
<listitem>
|
| 230 |
<formalpara>
|
| 231 |
<title>Upload by Debian Maintainers</title>
|
| 232 |
<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>
|
| 233 |
</formalpara>
|
| 234 |
</listitem>
|
| 235 |
|
| 236 |
<listitem>
|
| 237 |
<formalpara>
|
| 238 |
<title>Uploaders</title>
|
| 239 |
<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. It is totally acceptable to do some QA work on a package without adding oneself to the Uploaders field.
|
| 240 |
</para>
|
| 241 |
</formalpara>
|
| 242 |
</listitem>
|
| 243 |
|
| 244 |
<listitem>
|
| 245 |
<formalpara>
|
| 246 |
<title>Standards-Version</title>
|
| 247 |
<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>
|
| 248 |
</formalpara>
|
| 249 |
</listitem>
|
| 250 |
|
| 251 |
<listitem>
|
| 252 |
<formalpara>
|
| 253 |
<title>Homepage</title>
|
| 254 |
<para>should be documented whenever possible</para>
|
| 255 |
</formalpara>
|
| 256 |
</listitem>
|
| 257 |
|
| 258 |
<listitem>
|
| 259 |
<formalpara>
|
| 260 |
<title>Vcs-Svn: and Vcs-Browser:</title>
|
| 261 |
<para>Please use the following template:</para>
|
| 262 |
<programlisting>
|
| 263 |
Vcs-Svn: svn://svn.debian.org/svn/debian-med/trunk/packages/<package>/trunk/
|
| 264 |
Vcs-Browser: http://svn.debian.org/wsvn/debian-med/trunk/packages/<package>/trunk/?rev=0&sc=0
|
| 265 |
</programlisting>
|
| 266 |
</formalpara>
|
| 267 |
</listitem>
|
| 268 |
</orderedlist>
|
| 269 |
</sect2>
|
| 270 |
|
| 271 |
<sect2>
|
| 272 |
<title><filename>debian/copyright</filename></title>
|
| 273 |
<para>We use the <ulink url="http://wiki.debian.org/Proposals/CopyrightFormat">proposed machine-readable format</ulink> for the <filename>debian/copyright</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>
|
| 274 |
</sect2>
|
| 275 |
|
| 276 |
<sect2>
|
| 277 |
<title><filename>debian/changelog</filename></title>
|
| 278 |
<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>
|
| 279 |
</sect2>
|
| 280 |
|
| 281 |
<sect2>
|
| 282 |
<title>Debhelper</title>
|
| 283 |
<para>Debhelper uses compatibility levels to control the behaviour of its commands. The latest level is not always available in <emphasis>Stable</emphasis> or <emphasis>Backports</emphasis>. Please avoid using it unless needed until it is available, to facilitate backporting. We currently recommend to use the level <emphasis>5</emphasis>.</para>
|
| 284 |
</sect2>
|
| 285 |
|
| 286 |
<sect2>
|
| 287 |
<title>CDBS</title>
|
| 288 |
<para>The use of CDBS is welcome as it helps us to factorise our code. Nevertheless, please do not use complex CDBS for non-trivial packages, so that other developpers can quickly understand the package when doing QA work.</para>
|
| 289 |
<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>
|
| 290 |
</sect2>
|
| 291 |
|
| 292 |
<sect2>
|
| 293 |
<title>Injecting a new package</title>
|
| 294 |
<para>To inject a new package to the SVN repository, you must have
|
| 295 |
write access to it; i.e. you must be a member of the <emphasis>debian-med</emphasis> group on Alioth.</para>
|
| 296 |
<para>You can inject a new package only after successfully building
|
| 297 |
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>
|
| 298 |
<blockquote>
|
| 299 |
<para><userinput>
|
| 300 |
<command>svn-inject</command>
|
| 301 |
<option>-o</option>
|
| 302 |
<filename>package.dsc</filename>
|
| 303 |
<filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/packages/</filename>
|
| 304 |
</userinput></para>
|
| 305 |
</blockquote>
|
| 306 |
<para>The <command>svn-inject</command> command is found in the
|
| 307 |
<command>svn-buildpackage</command> package (just
|
| 308 |
<command>apt-get</command> it).</para>
|
| 309 |
<para>Once you injected a new package please make sure that it is
|
| 310 |
mentioned in the apropriate tasks file in the package source of the
|
| 311 |
debian-med <acronym>CDD</acronym> package in SVN. Normally maintainer watch the changes in
|
| 312 |
the Debian-Med packaging pool but it helps if the maintainer of a
|
| 313 |
certain package verifies that everything is in the right place.</para>
|
| 314 |
</sect2>
|
| 315 |
<sect2>
|
| 316 |
<title>Building the packages</title>
|
| 317 |
<para>To build the package, just use the tools that <command>svn-buildpackage</command>
|
| 318 |
carries. First of all, we suggest you to define some aliases for the
|
| 319 |
most common commands:</para>
|
| 320 |
<blockquote>
|
| 321 |
<programlisting>alias svn-b='svn-buildpackage -us -uc -rfakeroot --svn-ignore'
|
| 322 |
alias svn-br='svn-b --svn-dont-purge --svn-reuse'
|
| 323 |
alias svn-bt='svn-buildpackage --svn-tag -rfakeroot'</programlisting>
|
| 324 |
</blockquote>
|
| 325 |
<para>Checkout the sources (see the proper section).</para>
|
| 326 |
<para>Once done, you're ready to do the work. First, cd to the trunk
|
| 327 |
directory, and download the upstream sources (if there is a
|
| 328 |
<filename>debian/watch</filename> file):</para>
|
| 329 |
<blockquote>
|
| 330 |
<para><userinput>
|
| 331 |
<command>echo "origDir=.." >> .svn/deb-layout && uscan --force-download</command>
|
| 332 |
</userinput></para>
|
| 333 |
</blockquote>
|
| 334 |
<para>Alternatively, you can try this, it depends on how the package
|
| 335 |
was built (again, from the <filename class="directory">trunk/</filename> directory):</para>
|
| 336 |
<blockquote>
|
| 337 |
<para><userinput>
|
| 338 |
<command>debian/rules get-orig-source</command>
|
| 339 |
</userinput></para>
|
| 340 |
</blockquote>
|
| 341 |
<para>Once done, edit the files you need, and then build the package with
|
| 342 |
<command>svn-b</command> or <command>svn-br</command>.</para>
|
| 343 |
<para>If you're a Debian-Med member, you can commit your changes:</para>
|
| 344 |
<blockquote>
|
| 345 |
<para><userinput>
|
| 346 |
<command>svn commit</command>
|
| 347 |
</userinput></para>
|
| 348 |
</blockquote>
|
| 349 |
<para>(also <command>svn ci</command>).</para>
|
| 350 |
<para>Otherwise, you can ask to be added to the group (see the Membership
|
| 351 |
section), or send the result of svn diff to the
|
| 352 |
<ulink url="mailto:debian-med@lists.debian.org">mailing list</ulink>
|
| 353 |
(<command>gzip -9</command> it, if it's too large).</para>
|
| 354 |
</sect2>
|
| 355 |
<sect2>
|
| 356 |
<title>Tagging packages</title>
|
| 357 |
<para>It may happen that a package version has been uploaded to Debian
|
| 358 |
repositories, and you forgot to tag the last build with</para>
|
| 359 |
<blockquote>
|
| 360 |
<para><userinput>
|
| 361 |
<command>svn-buildpackage --svn-tag</command>
|
| 362 |
</userinput></para>
|
| 363 |
</blockquote>
|
| 364 |
<para>
|
| 365 |
You can tag this package also retroactively. A first step, creating
|
| 366 |
the tags directory, can be achieved in two ways:
|
| 367 |
<itemizedlist>
|
| 368 |
<listitem>
|
| 369 |
<para>create it locally (it is a sibling of <filename class="directory">trunk/</filename>), and commit:</para>
|
| 370 |
<blockquote>
|
| 371 |
<para><userinput>
|
| 372 |
<command>svn mkdir</command> <filename class="directory">tags</filename>
|
| 373 |
</userinput></para>
|
| 374 |
<para><userinput>
|
| 375 |
<command>svn commit</command>
|
| 376 |
</userinput></para>
|
| 377 |
</blockquote>
|
| 378 |
</listitem>
|
| 379 |
<listitem>
|
| 380 |
<para>create it remotely:</para>
|
| 381 |
<blockquote>
|
| 382 |
<para><userinput>
|
| 383 |
<command>svn mkdir</command> <filename class="directory">svn+ssh://user@svn.debian.org/svn/debian-med/trunk/packages/<package>/tags</filename>
|
| 384 |
</userinput></para>
|
| 385 |
</blockquote>
|
| 386 |
</listitem>
|
| 387 |
</itemizedlist>
|
| 388 |
</para>
|
| 389 |
<para>After the tags directory has been created, you're ready to tag the
|
| 390 |
package:</para>
|
| 391 |
<blockquote>
|
| 392 |
<para><userinput>
|
| 393 |
<command>svn-buildpackage --svn-tag-only --svn-no-autodch</command>
|
| 394 |
</userinput></para>
|
| 395 |
</blockquote>
|
| 396 |
<para>(--svn-no-autodch avoids <filename>debian/changelog</filename> to be marked as UNRELEASED).</para>
|
| 397 |
</sect2>
|
| 398 |
<sect2>
|
| 399 |
<title>Handling patches</title>
|
| 400 |
<para>Often happens that the upstream code doesn't fit well into the
|
| 401 |
Debian distribution: be this wrong paths, missing features, anything
|
| 402 |
that implies editing the source files. When you directly edit
|
| 403 |
upstream's source files, your changes will be put into a .diff.gz file,
|
| 404 |
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
|
| 405 |
<filename class="directory">debian/patches</filename> directory.</para>
|
| 406 |
<para>The most known are <command>quilt</command>, <emphasis>simple-patchsys</emphasis> (from the <emphasis>CDBS</emphasis> package) and <command>dpatch</command>.
|
| 407 |
Please don't use any other patch system in Debian-Med, unless absolutely
|
| 408 |
necessary.</para>
|
| 409 |
<sect3>
|
| 410 |
<title>Using <command>quilt</command></title>
|
| 411 |
<para>Using quilt is rather easy.</para>
|
| 412 |
<para>First, make sure you have correctly setup quilt: open
|
| 413 |
<filename>.quiltrc</filename> in your home directory (create
|
| 414 |
it if you don't have one), and make sure it looks like this:</para>
|
| 415 |
<blockquote>
|
| 416 |
<programlisting>QUILT_DIFF_ARGS="--no-timestamps --no-index"
|
| 417 |
QUILT_REFRESH_ARGS="--no-timestamps --no-index"
|
| 418 |
QUILT_PATCH_OPTS="--unified-reject-files"
|
| 419 |
QUILT_PATCHES="debian/patches"</programlisting>
|
| 420 |
</blockquote>
|
| 421 |
<para>After this, you're ready to start working with quilt.</para>
|
| 422 |
<sect4>
|
| 423 |
<title>Creating a patch</title>
|
| 424 |
<para>To create a patch, use the <command>new</command> command.
|
| 425 |
Run:</para>
|
| 426 |
<blockquote>
|
| 427 |
<para><userinput>
|
| 428 |
<command>quilt new</command> <filename><patch_name>.patch</filename>
|
| 429 |
</userinput></para>
|
| 430 |
</blockquote>
|
| 431 |
<para>This will create (if it doesn't exist yet) a
|
| 432 |
<filename>debian/patches/series</filename> file, which
|
| 433 |
contains all the patches to be applied by quilt. Moreover,
|
| 434 |
the new patch is also the topmost (the currently
|
| 435 |
applied).</para>
|
| 436 |
<para>Now start editing files, with:</para>
|
| 437 |
<blockquote>
|
| 438 |
<para><userinput>
|
| 439 |
<command>quilt edit</command> <filename><file></filename>
|
| 440 |
</userinput></para>
|
| 441 |
</blockquote>
|
| 442 |
<para>and repeat the process for each file the patch is
|
| 443 |
involved with. At the end, run</para>
|
| 444 |
<blockquote>
|
| 445 |
<para><userinput>
|
| 446 |
<command>quilt refresh</command>
|
| 447 |
</userinput></para>
|
| 448 |
</blockquote>
|
| 449 |
<para>This will compare the noted state of the edited files
|
| 450 |
with the current state, and will produce a patch in
|
| 451 |
<filename>debian/patches</filename>. Remember: the patch
|
| 452 |
is currently applied (you can check this with
|
| 453 |
<command>quilt applied</command>).</para>
|
| 454 |
</sect4>
|
| 455 |
<sect4>
|
| 456 |
<title>Applying and unapplying patches</title>
|
| 457 |
<para>Just two easy commands to do the job:</para>
|
| 458 |
<itemizedlist>
|
| 459 |
<listitem><para><command>quilt pop</command> will unapply the topmost patch.</para></listitem>
|
| 460 |
<listitem><para><command>quilt push</command> will apply the next patch in debian/patches/series.</para></listitem>
|
| 461 |
</itemizedlist>
|
| 462 |
<para>You can just add a "-a" flag to the commands above, to
|
| 463 |
respectively apply/unapply all patches in the series.</para>
|
| 464 |
<tip>
|
| 465 |
<para>You can check which patches are applied/unapplied
|
| 466 |
with, respectively, <command>quilt applied</command> and
|
| 467 |
<command>quilt unapplied</command>.</para>
|
| 468 |
</tip>
|
| 469 |
</sect4>
|
| 470 |
<sect4>
|
| 471 |
<title>Editing patches</title>
|
| 472 |
<para>To edit a patch, first make it the topmost:</para>
|
| 473 |
<blockquote>
|
| 474 |
<para><userinput>
|
| 475 |
<command>quilt push</command> <filename><patch_name></filename>
|
| 476 |
</userinput></para>
|
| 477 |
</blockquote>
|
| 478 |
<para>If the patch is already applied, but is not the topmost,
|
| 479 |
run <command>quilt pop</command> until it becomes the currently
|
| 480 |
applied one.</para>
|
| 481 |
<para>You can now run <command>quilt edit</command> on the files
|
| 482 |
you want to change, and, when you're done, <command>quilt
|
| 483 |
refresh</command>.</para>
|
| 484 |
</sect4>
|
| 485 |
<sect4>
|
| 486 |
<title>Renaming patches</title>
|
| 487 |
<para>Sometimes it's useful to rename a patch. Without
|
| 488 |
any hassle, do:</para>
|
| 489 |
<blockquote>
|
| 490 |
<para><userinput>
|
| 491 |
<command>quilt rename -P</command> <filename><old_name>.patch</filename>
|
| 492 |
<filename><new_name>.patch</filename>
|
| 493 |
</userinput></para>
|
| 494 |
</blockquote>
|
| 495 |
</sect4>
|
| 496 |
<sect4>
|
| 497 |
<title>Other commands</title>
|
| 498 |
<para>Please see <command>man 1 quilt</command> to have a
|
| 499 |
comprehensive list of commands.</para>
|
| 500 |
</sect4>
|
| 501 |
<sect4>
|
| 502 |
<title>Integration in the build process</title>
|
| 503 |
<para>Add in the very first part of <filename>debian/rules</filename>
|
| 504 |
(i.e. before the targets), the line:</para>
|
| 505 |
<blockquote>
|
| 506 |
<programlisting>include <filename class="headerfile">/usr/share/quilt/quilt.make</filename></programlisting>
|
| 507 |
</blockquote>
|
| 508 |
<para>Please use this to import patch and unpatch rules instead of writing them, and remember to add the needed dependencies to its
|
| 509 |
targets:</para>
|
| 510 |
<blockquote>
|
| 511 |
<programlisting>...
|
| 512 |
build: patch build-stamp
|
| 513 |
build-stamp: configure
|
| 514 |
...</programlisting>
|
| 515 |
</blockquote>
|
| 516 |
<para>This kind of dependency will ensure that if you also
|
| 517 |
patch the build system, you get a working patched build
|
| 518 |
process.</para>
|
| 519 |
<caution>
|
| 520 |
<para>Don't also put configure as a dependency of
|
| 521 |
build (leave it in build-stamp): that may cause problems
|
| 522 |
during parallel buildings (i.e. the -j flag of make).</para>
|
| 523 |
</caution>
|
| 524 |
<para>Now add a dependency to the clean target:</para>
|
| 525 |
<blockquote>
|
| 526 |
<programlisting>...
|
| 527 |
clean: unpatch
|
| 528 |
...</programlisting>
|
| 529 |
</blockquote>
|
| 530 |
<para>If you've also patched the build system, using upstream's
|
| 531 |
clean target might fail. This is what you should do:</para>
|
| 532 |
<blockquote>
|
| 533 |
<programlisting>...
|
| 534 |
clean: clean-patched unpatch
|
| 535 |
clean-patched:
|
| 536 |
...</programlisting>
|
| 537 |
</blockquote>
|
| 538 |
<para>Obviously, you could always use an approach like this,
|
| 539 |
but it's an useless complication if you don't patch the build
|
| 540 |
system, and you should keep <filename>debian/rules</filename>
|
| 541 |
the simplest you can.</para>
|
| 542 |
</sect4>
|
| 543 |
</sect3>
|
| 544 |
<sect3>
|
| 545 |
<title>Using <command>dpatch</command></title>
|
| 546 |
<sect4>
|
| 547 |
<title>Creating a patch</title>
|
| 548 |
<para>dpatch-edit-patch</para>
|
| 549 |
</sect4>
|
| 550 |
<sect4>
|
| 551 |
<title>Applying and unapplying patches</title>
|
| 552 |
<para>apply(-all), unapply(-all), status</para>
|
| 553 |
</sect4>
|
| 554 |
<sect4>
|
| 555 |
<title>Editing patches</title>
|
| 556 |
<para>dpatch-edit-patch</para>
|
| 557 |
</sect4>
|
| 558 |
<sect4>
|
| 559 |
<title>Renaming patches</title>
|
| 560 |
<para>Is this possible?</para>
|
| 561 |
</sect4>
|
| 562 |
<sect4>
|
| 563 |
<title>Other commands</title>
|
| 564 |
<para>Please see <command>man 1 dpatch</command> for a
|
| 565 |
comprehensive list of commands.</para>
|
| 566 |
</sect4>
|
| 567 |
<sect4>
|
| 568 |
<title>Integration in the build process</title>
|
| 569 |
<para>Follow the instructions for quilt and adapt the path of
|
| 570 |
inclusion to <filename class="headerfile">/usr/share/dpatch/dpatch.make</filename></para>
|
| 571 |
</sect4>
|
| 572 |
</sect3>
|
| 573 |
</sect2>
|
| 574 |
</sect1>
|
| 575 |
</article>
|