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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6322 by plessy, Sun Mar 20 01:17:13 2011 UTC revision 6399 by tille, Wed Mar 30 07:35:52 2011 UTC
# Line 22  Line 22 
22                          <author>                          <author>
23          <firstname>Charles</firstname>          <firstname>Charles</firstname>
24          <surname>Plessy</surname>          <surname>Plessy</surname>
25                                  <contrib>Contributions in 2008</contrib>                                  <contrib>Contributions in 2008 and 2011</contrib>
26                                  <email>plessy@debian.org</email>                                  <email>plessy@debian.org</email>
27                          </author>                          </author>
28                  </authorgroup>                  </authorgroup>
29                  <releaseinfo>                  <releaseinfo>
30                          $ policy.xml rev. @REV@ - @DATE@ (@AUTHOR@) $                          $ policy.xml rev. @REV@ - @DATE@ (@AUTHOR@) $
31                  </releaseinfo>                  </releaseinfo>
32                    <releaseinfo>
33                            Source: svn://svn.debian.org/debian-med/trunk/community/website/docs/policy.xml
34                    </releaseinfo>
35    </articleinfo>    </articleinfo>
36          <mediaobject>          <mediaobject>
37      <objectinfo>      <objectinfo>
# Line 110  Line 113 
113                    the Subversion tags take a disproportionated size, when the maintainer is                    the Subversion tags take a disproportionated size, when the maintainer is
114                    much more comfortable with Git than Subversion, when some special features of                    much more comfortable with Git than Subversion, when some special features of
115                    Git or git-buildpackage are desired, or more simply when the maintainer wants                    Git or git-buildpackage are desired, or more simply when the maintainer wants
116                    to thake the opportunity to familiarise with Git.                    to take the opportunity to familiarise with Git.
117                  </para>                  </para>
118                    <warning id="umask">
119                            <para>
120                                    For most direct operations 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.
121                            </para>
122                    </warning>
123                  <sect2 id="source">                  <sect2 id="source">
124                          <title>Give me the source!</title>                          <title>Give me the source!</title>
125                          <para>                          <para>
126                                  To check sources out from our repostitories, please do:                                  To check sources out from our repositories, please do:
127                                  <itemizedlist>                                  <itemizedlist>
128                                          <listitem>                                          <listitem>
129                                                  <para>If you are a member of Debian Med or a Debian developer, you have write permission:</para>                                                  <para>
130                                                  <blockquote>                                                          If you are a member of Debian Med or a Debian developer, you have
131                                                          <para><userinput>                                                          write permission:<programlisting>
132                                                                  <command>svn co</command> <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/...</filename>  <command>svn co</command> <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/...</filename>
133                                                          </userinput></para>  <command>git clone</command> <filename class="directory">git+ssh://user@alioth.debian.org/git/debian-med/&lt;package&gt;.git</filename></programlisting>
134                                                          <para><userinput>                                                  </para>
                                                                 <command>git clone</command> <filename class="directory">git+ssh://user@alioth.debian.org/git/debian-med/&lt;package&gt;.git</filename>  
                                                         </userinput></para>  
                                                 </blockquote>  
                                                 <para>You can avoid specifying your Alioth user name by setting it in <filename>~/.ssh/config</filename>:</para>  
                                                 <blockquote>  
                                                         <programlisting>  
 Host *.debian.org  
         User yourusername  
                                                         </programlisting>  
                                                 </blockquote>  
135                                          </listitem>                                          </listitem>
136                                          <listitem>                                          <listitem>
137                                                  <para>For read-only access, the syntax is slightly different:</para>                                                  <para>
138                                                  <blockquote>                                                          For read-only access, the syntax is slightly
139                                                          <para><userinput>                                                          different:<programlisting>
140                                                                  <command>svn co</command> <filename class="directory">svn://svn.debian.org/svn/debian-med/trunk/...</filename>  <command>svn co</command> <filename class="directory">svn://svn.debian.org/svn/debian-med/trunk/...</filename>
141                                                          </userinput></para>  <command>git clone</command> <filename class="directory">git://git.debian.org/git/debian-med/&lt;package&gt;.git</filename></programlisting>
142                                                          <para><userinput>                                                  </para>
                                                                 <command>git clone</command> <filename class="directory">git://git.debian.org/git/debian-med/&lt;package&gt;.git</filename>  
                                                         </userinput></para>  
                                                 </blockquote>  
143                                          </listitem>                                          </listitem>
144                                  </itemizedlist>                                  </itemizedlist>
145                          </para>                          </para>
# Line 152  Host *.debian.org Line 147  Host *.debian.org
147                                  Another way to check the sources is through the use of the                                  Another way to check the sources is through the use of the
148                                  <command>debcheckout</command> command, from the                                  <command>debcheckout</command> command, from the
149                                  <ulink url="http://packages.debian.org/devscripts">devscripts</ulink>                                  <ulink url="http://packages.debian.org/devscripts">devscripts</ulink>
150                                  package.                                  package.  Its <option>-a</option> option checks out or clone for write
151                                    access.
152                            </para>
153                    </sect2>
154                    <sect2 id="ssh-tips">
155                            <title>SSH tips</title>
156                            <para id="ssh-config">
157                                    You can avoid specifying your Alioth user name by setting it in
158                                    <filename>~/.ssh/config</filename>:<programlisting>
159    Host *.debian.org
160            User your-user-name</programlisting>
161                            </para>
162                            <para id="ssh-add">
163                                    You can avoid typing your SSH password again and again using the
164                                    <code><command>ssh-add</command></code> command.  On remote connections
165                                    the SSH agent needs to be enabled with the command
166                                    <code><command>eval</command>
167                                    <option>$(</option><command>ssh-agent</command><option>)</option></code>.
168                            </para>
169                            <para id="wiki-alioth">
170                                    In case of trouble getting SSH working it is a good idea to read
171                                    <ulink url="http://wiki.debian.org/Alioth/SSH">this wiki article</ulink>.
172                          </para>                          </para>
173                  </sect2>                  </sect2>
174                  <sect2 id="repository-structure">                  <sect2 id="svn-repository-structure">
175                          <title>Repository structure</title>                          <title>Subversion repository structure</title>
176                          <para>The SVN repository is structured as follows:                          <para>The SVN repository is structured as follows:<programlisting>
       <literallayout>  
       <code>  
177  debian-med/  debian-med/
178   └ trunk/   └ trunk/
179      ├ community/      ├ community/
# Line 177  debian-med/ Line 191  debian-med/
191         │  ├ tags/         │  ├ tags/
192         │  └ trunk/         │  └ trunk/
193         │     └ debian/         │     └ debian/
194         …         …</programlisting>
        </code>  
        </literallayout>  
195        </para>        </para>
196                          <note><para>We are currently considering an alternative layout in which all                          <note><para>We are currently considering an alternative layout in which all
197                          the <filename>trunk</filename>, <filename>tags</filename> and                          the <filename>trunk</filename>, <filename>tags</filename> and
198                          <filename>branches</filename> directories are grouped together, so that developers can checkout trunks without tags.</para></note>                          <filename>branches</filename> directories are grouped together, so that developers can checkout trunks without tags.</para></note>
199                          <para>The Git repository is not structured: each package is in its own Git repository.                  </sect2>
200                             But all of them are under the same <filename>debian-med</filename> directory.</para>                  <sect2 id="subversion-tips">
201                            <title>Subversion tips</title>
202                            <para id="svn-buildpackage-aliases">
203                                    Suggested aliases for
204                                    <command>svn-buildpackage</command>:<programlisting>
205    alias <command>svn-b</command>='svn-buildpackage -us -uc -rfakeroot --svn-ignore'
206    alias <command>svn-br</command>='svn-b --svn-dont-purge --svn-reuse'
207    alias <command>svn-bt</command>='svn-buildpackage --svn-tag -rfakeroot'</programlisting>
208                            </para>
209                            <para id="svn-mergewithupstream">
210                                    <command>svn-inject</command> sets up correctly the
211                                    <literal>mergeWithUpstream</literal> property for the SVN directories
212                                    where packages are stored.  In case <command>svn-inject</command> was
213                                    not used, you can do it by hand with the command
214                                    <code><command>svn propset</command>
215                                    <replaceable>mergeWithUpstream</replaceable>
216                                    <replaceable>1</replaceable> <replaceable>debian</replaceable></code>.
217                            </para>
218                            <para id="download-upstream-source">
219                                    To download the upstream sources (if there is a
220                                    <filename>debian/watch</filename> file): <code><command>echo
221                                    "origDir=.." &gt;&gt; .svn/deb-layout &amp;&amp; uscan
222                                    --force-download</command></code>. Alternatively, you can try
223                                    <code><command>debian/rules get-orig-source</command></code>.
224                            </para>
225                            <para id="svn-write-access">
226                                    If you're a Debian developer or a member of the Debian Med group on
227                                    Alioth, you can commit your changes: <command>svn commit</command> (also
228                                    <command>svn ci</command>).  Otherwise, you can ask to be added to the
229                                    group (see the <link linkend="membership">Membership</link> section), or
230                                    send the result of <command>svn diff</command> to the <ulink
231                                    url="mailto:debian-med@lists.debian.org">mailing list</ulink>
232                                    (<command>gzip -9</command> it, if it's too large).
233                            </para>
234                            <para id="svn-tag-release">
235                                    It may happen that a package version has been uploaded to Debian
236                                    repositories, and you forgot to tag the last build with
237                                    <command>svn-buildpackage --svn-tag</command>.  You can tag this package
238                                    also retroactively.  A first step, creating
239                                    the tags directory, can be achieved in two ways: either create it
240                                    locally as sibling of <filename class="directory">trunk/</filename> with
241                                    <code><command>svn mkdir</command> <filename class="directory">tags</filename></code>, and commit with
242                                    <code><command>svn commit</command></code>, or create it remotely with
243                                    <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>.
244                                    After the tags directory has been created, you're ready to tag the
245                                    package: <code><command>svn-buildpackage</command> <option>--svn-tag-only</option> <option>--svn-no-autodch</option></code>.
246                                    The <option>--svn-no-autodch</option> avoids
247                                    <filename>debian/changelog</filename> to be marked as <literal>UNRELEASED</literal>.
248                            </para>
249                            <para id="example-svn-session">
250                                    Here is an example session where a package is prepared manually:<programlisting>
251    # Check out debian-med/trunk, cd to debian-med/trunk/packages
252    # Create new project folder with
253    svn mkdir projectname
254    svn mkdir projectname/trunk
255    
256    # Put orig.tar.gz in place
257    mv some_version.orig.tar.gz projectname
258    
259    # Inform svn-buildpackage about the location of the orig.tar.gz
260    echo "origDir=.." > projectname/trunk/.svn/deb-layout
261    
262    # Untar source tree for development
263    cd projectname
264    tar xzvf some_version.orig.tar.gz
265    cd some-version # entering the unpackaged source tree
266    if [ ! -d debian ]; then dh_make ; fi
267    mv debian ../trunk
268    ln -s ../trunk/debian .
269    
270    # continue development
271    fakeroot ./debian/rules binary
272    
273    # until it works, finally
274    cd ..
275    
276    # debian directory is the only thing that is stored in svn, to be merged with upstream
277    svn propset mergeWithUpstream 1 trunk/debian
278    
279    # See if things can be compiled via svn-buildpackage
280    cd trunk
281    svn-buildpackage -rfakeroot -uc -us
282    
283    # check build
284    lintian ../build-area/*changes</programlisting>
285                            </para>
286                    </sect2>
287                    <sect2 id="git-repository-structures">
288                            <title>Common Git repository structures</title>
289                            <para>
290                                    The area on Alioth that contains the Git repositories (<filename
291                                    class="directory">/git/debian-med</filename>) is not itself structured,
292                                    but the repositories can be arranged in different possible layouts.
293                            </para>
294                            <sect3 id="git-buildpackage">
295                                    <title><command>git-buildpackage</command></title>
296                                    <para>
297                                            Most of our packages using Git and stored in Alioth are managed with
298                                            the <command>git-buildpackage</command> helper.  The
299                                            <literal>master</literal> branch contains the full source package.
300                                            The <literal>upstream</literal> branch contains the upstream source,
301                                            after repacking when necessary (non-free files, large convenience code
302                                            copies, …). The <literal>pristine-tar</literal> contains the data
303                                            necessary to recreate an original tarball from the repository with a
304                                            reproducible checksum.
305                                    </para>
306                                    <para>
307                                            Debian releases are tagged with names like
308                                            <literal>debian/debianversion</literal> and upstream releases are
309                                            tagged with names like <literal>upstream/upstreamversion</literal>.
310                                    </para>
311                            </sect3>
312                            <sect3 id="git-without-tarball">
313                                    <title>Social Git</title>
314                                    <para>
315                                      For some projects, like the ones hosted on <ulink
316                                      url="http://www.github.com">GitHub</ulink> or <ulink
317                                      url="http://www.gitorious.com">Gitorious</ulink>, it may be easier to
318                                      forward changes made in the Debian package if this one is itself
319                                      hosted on the same platform, as a clone. In that case, the layouts
320                                      may vary from package to packages.  However, there are good chances
321                                      that the branch that contains the Debian source package is called
322                                      <literal>debian</literal>.
323                                     </para>
324                            </sect3>
325                  </sect2>                  </sect2>
326    
327                  <sect2 id="git-tips">                  <sect2 id="git-tips">
328                          <title>Git tips</title>                          <title>Git tips</title>
329                          <para>                          <para id="new-repository-with-gbp">
330                                  To clone and follow every branch of a git repository containing a package that is already in the Debian archive, you can use the <command>debcheckout</command> command with its <command><option>--git-track='*'</option></command> option. To restrict the tracked branch to the standard ones used by <command>git-buildpackage</command>, <literal>master,upstream,pristine-tar</literal> can be passed instead of the wildcard.                                  Example to create a new git repository for a package where the upstream
331                                    sources are distributed as file archives (tar, zip, …):<programlisting>
332    <command>mkdir</command> <filename class="directory">package</filename>
333    <command>cd</command> <filename class="directory">package</filename>
334    <command>git init</command>
335    <command>git import-orig</command> <option>--pristine-tar</option> <filename>/path/to/package_version.orig.tar.gz</filename>
336    <command>dh_make</command> <option>-p package_x.y.z</option></programlisting>
337                                    The above steps will create a repository with the appropriate layout for
338                                    <command>git-buildpackage</command>, with three branches:
339                                    <literal>master</literal> (where the Debian development will happen),
340                                    <literal>pristine-tar</literal> used by the
341                                    <literal>pristine-tar</literal> tool during the package build process to
342                                    recreate the original tarball, and <literal>upstream</literal>, which
343                                    will contain the upstream source.
344                          </para>                          </para>
345                          <para>                          <para id="debcheckout-sets-git-options">
346                                    To display your name and more nicely in the Git log, you should instruct
347                                    Git to do so (the <option>--global</option> option is to say Git these
348                                    are the default parameters for every Git repository you commit to,
349                                    without it the settings will be per-repository only):<programlisting>
350    <command>git config</command> <option><optional>--global</optional></option> <option>user.name "$DEBFULLNAME"</option>
351    <command>git config</command> <option><optional>--global</optional></option> <option>user.email "$DEBEMAIL"</option></programlisting>
352                            </para>
353                            <para id="debcheckout-git-track">
354                                    To clone and follow every branch of a git repository containing a
355                                    package that is already in the Debian archive, you can use the
356                                    <command>debcheckout</command> command with its
357                                    <command><option>--git-track='*'</option></command> option. To restrict
358                                    the tracked branch to the standard ones used by
359                                    <command>git-buildpackage</command>, <literal>master upstream
360                                    pristine-tar</literal> can be passed instead of the wildcard.
361                            </para>
362                            <para id="git-track-new-branches">
363                                  Example commands to track new branches: <programlisting>                                  Example commands to track new branches: <programlisting>
364  git branch -t upstream origin/upstream  <command>git branch</command> <option>-t <replaceable>upstream</replaceable> <replaceable>origin/upstream</replaceable></option>
365  git branch -t pristine-tar origin/pristine-tar</programlisting>  <command>git branch</command> <option>-t <replaceable>pristine-tar</replaceable> <replaceable>origin/pristine-tar</replaceable></option></programlisting>
366                  </para>                  </para>
367                            <para id="git-options-devscripts">
368                                    If the <package>devscripts</package> variables
369                                    <varname>DEBEMAIL</varname> and <varname>DEBFULLNAME</varname> are set,
370                                    <command>debcheckout</command> will set <command>git</command>'s options
371                                    <varname>user.email</varname> and <varname>user.name</varname>
372                                    accordingly.
373                            </para>
374                            <para id="git-add-alioth-branch">
375                                    To push changes to Alioth, a remote branch needs to be configured.  This
376                                    is done automatically after cloning a repository, for instance with
377                                    <link linkend="debcheckout-git-track">debcheckout</link>.  The default
378                                    remote branch is called <quote>origin</quote>.  Here are example
379                                    commands to set up Alioth as a remote branch on a freshly created
380                                    repository:<programlisting>
381    <command>git remote add</command> <literal>origin</literal> <filename class="directory">git+ssh://alioth.debian.org/git/debian-med/package.git</filename></programlisting>
382                            </para>
383                            <para id="create-git-repository-on-alioth">
384                                    There is a small script called <command>setup-repository</command> in
385                                    the     <filename class="directory">/git/debian-med</filename> directory on
386                                    Alioth. <code><command>./setup-repository</command>
387                                    <option>packagename</option> <option>"Description of the
388                                    package"</option></code> will create a <filename
389                                    class="directory">packagename.git</filename> repository on with the
390                                    proper hooks set up for our team.
391                            </para>
392                            <para id="push-package-to-alioth">
393                                    To push the package (make sure you've added the alioth remote!), do the
394                                    following:<code><command>git push</command> <option>origin
395                                    master</option></code>.  For the first push, it's necessary to specify
396                                    <option>origin master</option>. The next time you will push, a
397                                    <command>git push</command> will suffice.
398                            </para>
399                            <para id="git-push-all-tags">
400                                    <command>git push</command>this will only push the
401                                    <literal>master</literal> branch unless it is somehow related to other
402                                    branches), so be sure to also do a run with <option>--all</option>, and one with <option>--tags</option> if you created new tags.
403                            </para>
404                            <para id="git-tag-release">
405                                    To tag a release:
406                                    <code><command>git tag</command> <option>debian/x.y-z</option></code>.
407                                    You can also easily retroactively make tags:
408                                    <code><command>git tag</command> <option>debian/x.y-z</option> <option>&lt;commit hash&gt;</option></code>.
409                                    Remember to <code><command>git push --tags</command></code>.
410                            </para>
411                            <para id="git-layout-variants">
412                                    In particular for Git repositories that are not stored in Alioth, the
413                                    layout can differ from <command>git-buildpackage</command> conventions.
414                                    In that case, look for instance for a branch called <literal>debian</literal>.
415                            </para>
416                            <para id="git-debian-version-from-commit">
417                                    If upstream manages his sources with Git, the following makefile
418                                    script can help producing a version number when no Git tag is
419                                    available:<programlisting>
420    SOURCEPKG=$(shell dpkg-parsechangelog | sed  -n 's/^Source: \(.*\)/\1/p')
421    UPSTREAM=$(shell dpkg-parsechangelog |  sed -n 's/^Version: \(.*\)-[^-]*/\1/p')
422    SHA1=$(lastword $(subst ~g, ,$(UPSTREAM)))
423    ORIG=${SOURCEPKG}_${UPSTREAM}.orig.tar.gz
424    
425    describe-current-version:
426            git describe --tags upstream | sed 's,^release-,,;s,-,+,;s,-,~,;'
427    
428    get-orig-source:
429            git archive --format=tar $(SHA1) | gzip -9 > ../$(ORIG)</programlisting>
430                            </para>
431                          <para>                          <para>
432                                  If the <package>devscripts</package> variables <varname>DEBEMAIL</varname> and <varname>DEBFULLNAME</varname> are set, <command>debcheckout</command> will set <command>git</command>'s options <varname>user.email</varname> and <varname>user.name</varname> accordingly.                                  To make <command>git-buildpackage</command> builds the package with a
433                                    chroot, you can add the following to the configuration file <filename>~/.gbp.conf</filename> or <filename>debian/gbp.conf</filename>:<programlisting>
434    [DEFAULT]
435    builder = ~/bin/git-pbuilder
436    cleaner = fakeroot debian/rules clean
437    pristine-tar = True
438    
439    [git-buildpackage]
440    # use this for more svn-buildpackage like behaviour:
441    export-dir = ../build-area/
442    tarball-dir = ../tarballs/</programlisting>
443                                    With this configuration file you're specifying that
444                                    <command>git-buildpackage</command> will use
445                                    <filename>~/bin/git-pbuilder</filename> as the builder script.  This is
446                                    an example script you can use:<programlisting>
447    #!/bin/sh
448    set -e
449    
450    pdebuild --pbuilder cowbuilder --debbuildopts "-i\.git -I.git $*"
451    rm ../*_source.changes</programlisting>
452                                    This will build the package inside the default cowbuilder chroot, while
453                                    passing any more parameters directly do  <command>dpkg-buildpackage</command>.
454                          </para>                          </para>
455                  </sect2>                  </sect2>
456    
# Line 208  git branch -t pristine-tar origin/pristi Line 459  git branch -t pristine-tar origin/pristi
459                    <para>There is no easy way to prepare a Git repository from our Subversion repository that would                    <para>There is no easy way to prepare a Git repository from our Subversion repository that would
460                          look like the package was always managed in Git, because we use svn-buildpackage with the                          look like the package was always managed in Git, because we use svn-buildpackage with the
461                          mergeWithUpstream property set, which excludes the upstream sources. Nevertheless, the                          mergeWithUpstream property set, which excludes the upstream sources. Nevertheless, the
462                          following receipe will genearate a Git repostitory that contains all the history of                          following recipe will generate a Git repository that contains all the history of
463                          the debian directory, plus a collection of selected upstream source releases.                          the debian directory, plus a collection of selected upstream source releases.
464                    </para>                    </para>
465                      <itemizedlist>                      <itemizedlist>
# Line 229  git branch -t pristine-tar origin/pristi Line 480  git branch -t pristine-tar origin/pristi
480                  <sect2 id="updating-git-package">                  <sect2 id="updating-git-package">
481                    <title>Updating a source package managed with Git</title>                    <title>Updating a source package managed with Git</title>
482                    <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>                    <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>
483                    <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>                    <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 stabilizing 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>
484                  </sect2>                  </sect2>
485          </sect1>          </sect1>
486          <sect1 id="packaging">          <sect1 id="packaging">
# Line 289  git branch -t pristine-tar origin/pristi Line 540  git branch -t pristine-tar origin/pristi
540                                  <listitem>                                  <listitem>
541                                  <formalpara>                                  <formalpara>
542                                          <title>Uploaders</title>                                          <title>Uploaders</title>
543                                          <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>.                                          <para>Please add yourself 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>.
544                                          </para>                                          </para>
545                                  </formalpara>                                  </formalpara>
546                                  </listitem>                                  </listitem>
# Line 328  Vcs-Browser: http://git.debian.org/?p=de Line 579  Vcs-Browser: http://git.debian.org/?p=de
579    
580                  <sect2 id="debian-copyright">                  <sect2 id="debian-copyright">
581                          <title><filename>debian/copyright</filename></title>                          <title><filename>debian/copyright</filename></title>
582                          <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>                          <para>We use the <ulink url="http://wiki.debian.org/Proposals/CopyrightFormat">proposed machine-readable format</ulink>
583                                  for the <filename>debian/copyright</filename> file. The <computeroutput>Source</computeroutput> field does not
584                                  need to contain the full URL to the particular version that is being packaged, since this can be determined by
585                                  the <command>uscan</command> program with the <filename>debian/watch</filename> file. Please list yourself in the
586                                  <computeroutput>Files: debian/*</computeroutput> section if you think that your contributions are not trivial and
587                                  therefore subjected to copyright. Please chose a license that is compatible with the program you package. You can
588                                  also use <quote>same as if it were in the public domain</quote> or <quote>same as the packaged program itself</quote>.
589                            </para>
590                            <para>To verify the correct syntax of the <filename>debian/copyright</filename> file you can use</para>
591                            <blockquote><userinput>
592                                  <command>config-edit -application dpkg-copyright -ui none</command>
593                            </userinput></blockquote>
594                  </sect2>                  </sect2>
595    
596                  <sect2 id="debian-changelog">                  <sect2 id="debian-changelog">
# Line 337  Vcs-Browser: http://git.debian.org/?p=de Line 599  Vcs-Browser: http://git.debian.org/?p=de
599                  </sect2>                  </sect2>
600                  <sect2 id="debian-readme-source">                  <sect2 id="debian-readme-source">
601                          <title><filename>debian/README.source</filename></title>                          <title><filename>debian/README.source</filename></title>
602                          <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>                          <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 archive, when we repack the sources,…</para>
603                  </sect2>                  </sect2>
604    
605                  <sect2 id="debhelper">                  <sect2 id="debhelper">
# Line 347  Vcs-Browser: http://git.debian.org/?p=de Line 609  Vcs-Browser: http://git.debian.org/?p=de
609                          touch packages only because it has an older Debhelper version.</para>                          touch packages only because it has an older Debhelper version.</para>
610                          <para>                          <para>
611                          It is strongly recommended to use the short <emphasis>dh</emphasis> notation in <filename>debian/rules</filename> files which makes code factorisation very                          It is strongly recommended to use the short <emphasis>dh</emphasis> notation in <filename>debian/rules</filename> files which makes code factorisation very
612                          simple and easy to understand the packaging for other members of the team.  Even complex packaging becomes quite transparant this way.                          simple and easy to understand the packaging for other members of the team.  Even complex packaging becomes quite transparent this way.
613                          </para>                          </para>
614                  </sect2>                  </sect2>
615    
# Line 367  Vcs-Browser: http://git.debian.org/?p=de Line 629  Vcs-Browser: http://git.debian.org/?p=de
629                          <sect3 id="vcs-svn">                          <sect3 id="vcs-svn">
630                                  <title>Source package stored in a Subversion repository</title>                                  <title>Source package stored in a Subversion repository</title>
631                                  <para>                                  <para>
632                                          <emphasis>This section is in construction, see <link linkend="svn-inject">below</link> for te moment.</emphasis>                                          We use the <literal>MergeWithUpstream</literal> workflow, so please
633                                            keep all the modifications in the <filename
634                                            class="directory">debian</filename> directory, and use the
635                                            <option>-o</option> option of <command>svn-buildpackage</command>, as
636                                            in the following example: <code><command>svn-inject</command>
637                                            <option>-o</option> <filename>package.dsc</filename> <filename
638                                            class="directory">svn+ssh://svn.debian.org/svn/debian-med/trunk/packages/</filename></code>.
639                                  </para>                                  </para>
640                          </sect3>                          </sect3>
641                          <sect3 id="vcs-git">                          <sect3 id="vcs-git">
642                                  <title>Source package stored in a Git repository</title>                                  <title>Source package stored in a Git repository</title>
643                                  <para>                                  <para>
644                                          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>.                                          Git repositories should be stored in the <filename
645                                            class="directory">/git/debian-med</filename> directory on Alioth and
646                                            created with the <link
647                                            linkend="create-git-repository-on-alioth"><command>setup-repository</command></link>
648                                            script available there.  There, they must give write access to the
649                                            <literal>debian-med</literal> Alioth group and all the Debian
650                                            Developers, with appropriate Unix permissions (including SGID bit on
651                                            directories) and ACLs.  See <filename class="directory">/git/debian-med</filename>
652                                            itself as an example.  <command>setup-repository</command> does this
653                                            automatically.
654                                    </para>
655                                    <para>
656                                            Git repositories managed with a helper tool should announce it.  For
657                                            instance, to show that <command>git-buildpackage</command> is used,
658                                            the package can contain a configuration file in
659                                            <filename>debian/gbp.conf</filename>.
660                                    </para>
661                            </sect3>
662                            <sect3 id="vcs-tags">
663                                    <title>Tags</title>
664                                    <para>
665                                            Tags indicate the revision corresponding to uploaded packages. For
666                                            Subversion, the version number is used, and for Git,
667                                            <literal>debian/</literal> is added before the version number.  In the
668                                            Subversion repository, older tags may be deleted to save space.
669                                  </para>                                  </para>
670                          </sect3>                          </sect3>
671                  </sect2>                  </sect2>
   
672                  <sect2 id="new-package">                  <sect2 id="new-package">
673                          <title>Injecting a new package</title>                          <title>New package</title>
             <sect3 id="svn-inject">  
                         <title>Subversion</title>  
                         <para>To inject a new package to the SVN repository, you must have  
                         write access to it; i.e. you must be a member of the <emphasis>debian-med</emphasis> group on Alioth.</para>  
                         <para>You can inject a new package only after successfully building  
                         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>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>svn-inject</command>  
                                         <option>-o</option>  
                                         <filename>package.dsc</filename>  
                                         <filename class="directory">svn+ssh://user@alioth.debian.org/svn/debian-med/trunk/packages/</filename>  
                                 </userinput></para>  
                         </blockquote>  
                         <para>The <command>svn-inject</command> command is found in the  
                         <command>svn-buildpackage</command> package     (just  
                         <command>apt-get</command> it).</para>  
                         <para>Once you injected a new package please make sure that it is  
                         mentioned in the apropriate tasks file in the package source of the  
                         debian-med Blend package in SVN. Normally maintainer watch the changes in  
                         the Debian Med packaging pool but it helps if the maintainer of a  
                         certain package verifies that everything is in the right place.</para>  
                 </sect3>  
                 <sect3 id="new-git-repository">  
                 <title>Git</title>  
                 <sect4 id="git-buildpackage">  
                     <title>Creating a local repository</title>  
                     <para>Just a few instructions to get you started:</para>  
                     <blockquote>  
                         <para><userinput>  
                             <command>mkdir</command>  
                             <filename class="directory">package</filename>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>cd</command>  
                             <filename class="directory">package</filename>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>git</command>  
                             <option>init</option>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>git import-orig --pristine-tar</command>  
                             <filename>/path/to/package_version.orig.tar.gz</filename>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>dh_make</command>  
                             <option>-p package_x.y.z</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>The above steps will create a repository with the appropriate layout for  
                     <command>git-buildpackage</command>, with three branches: <filename>master</filename>  
                     (where the Debian development will happen), <filename>pristine-tar</filename>,  
                     used by the <command>pristine-tar</command> tool during the package build process  
                     to recreate the original tarball, and <filename>upstream</filename>, which will  
                     contain the upstream source.</para>  
                     <para>To display your name and more nicely in the Git log, you should instruct  
                     Git to do so (the <option>--global</option> option is to say Git these are the  
                     default parameters for every Git repository you commit to, without it the settings  
                     will be per-repository only):</para>  
                     <blockquote>  
                         <para><userinput>  
                                 <command>git config</command>  
                                 <option>[--global]</option>  
                                 <option>user.name "$DEBFULLNAME"</option>  
                         </userinput></para>  
                         <para><userinput>  
                                 <command>git config</command>  
                                 <option>[--global]</option>  
                                 <option>user.email "$DEBEMAIL"</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>After you create your <filename class="directory">debian/</filename> (be sure  
                     to commit it!), you should add a <quote>remote</quote> to the repository. A remote is  
                     where the commits will be pushed to, and the default remote is called <quote>origin</quote>.</para>  
                     <para>If you are going to push to our Alioth repository, please do the following inside your  
                     local repository:</para>  
                     <blockquote>  
                         <para><userinput>  
                             <command>git remote add origin</command>  
                             <filename class="directory">git+ssh://alioth.debian.org/git/debian-med/package.git</filename>  
                         </userinput></para>  
                     </blockquote>  
                     <para>The next step is to create the remote repository on Alioth.</para>  
                 </sect4>  
                 <sect4 id="create-alioth-repository">  
                     <title>Creating the remote repository</title>  
                     <blockquote>  
                         <para><userinput>  
                             <command>ssh</command>  
                             <filename class="directory">alioth.debian.org</filename>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>cd</command>  
                             <filename class="directory">/git/debian-med</filename>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>./setup-repository</command>  
                             <option>packagename</option>  
                             <option>"Description of the package"</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>This will create a <filename class="directory">packagename.git</filename> repository on  
                     Alioth, with the proper hooks set up for our team.</para>  
                 </sect4>  
                 <sect4 id="push-package-to-alioth">  
                     <title>Pushing the package</title>  
                     <para>To push the package (make sure you've added the alioth remote!), do the following:</para>  
                     <blockquote>  
                         <para><userinput>  
                             <command>git push origin master</command>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>git push</command>  
                             <option>--all</option>  
                         </userinput></para>  
                         <para><userinput>  
                             <command>git push</command>  
                             <option>--tags</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>For the first push, it's necessary to specify <quote>origin master</quote>. The next time  
                     you will push, a <command>git push</command> will suffice. Remember that this will only push the  
                     <quote>master</quote> branch (and the other two only if master is somehow related to the new  
                     branches), so be sure to also do a run with <option>--all</option>, and one with  
                     <option>--tags</option> (if you obviously changed anything in the other branches/tags).</para>  
                 </sect4>  
             </sect3>  
         </sect2>  
         <sect2 id="building-and-tagging">  
                 <title>Building and tagging the packages</title>  
             <sect3 id="building">  
                         <title>Building the packages</title>  
             <sect4 id="building-subversion">  
             <title>Subversion</title>  
                         <para>To build the package, just use the tools that <command>svn-buildpackage</command>  
                         carries. First of all, we suggest you to define some aliases for the  
                         most common commands:</para>  
                         <blockquote>  
                                 <programlisting>alias svn-b='svn-buildpackage -us -uc -rfakeroot --svn-ignore'  
 alias svn-br='svn-b --svn-dont-purge --svn-reuse'  
 alias svn-bt='svn-buildpackage --svn-tag -rfakeroot'</programlisting>  
                         </blockquote>  
                         <para>Checkout the sources (see the proper section).</para>  
                         <para>Once done, you're ready to do the work. First, cd to the trunk  
                         directory, and download the upstream sources (if there is a  
                         <filename>debian/watch</filename> file):</para>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>echo "origDir=.." &gt;&gt; .svn/deb-layout &amp;&amp; uscan --force-download</command>  
                                 </userinput></para>  
                         </blockquote>  
                         <para>Alternatively, you can try this, it depends on how the package  
                         was built (again, from the <filename class="directory">trunk/</filename> directory):</para>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>debian/rules get-orig-source</command>  
                                 </userinput></para>  
                         </blockquote>  
                         <para>Once done, edit the files you need, and then build the package with  
                         <command>svn-b</command> or <command>svn-br</command>.</para>  
                         <para>If you're a Debian Med member, you can commit your changes:</para>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>svn commit</command>  
                                 </userinput></para>  
                         </blockquote>  
                         <para>(also <command>svn ci</command>).</para>  
                         <para>Otherwise, you can ask to be added to the group (see the Membership  
                         section), or send the result of svn diff to the  
                         <ulink url="mailto:debian-med@lists.debian.org">mailing list</ulink>  
                         (<command>gzip -9</command> it, if it's too large).</para>  
             </sect4>  
             <sect4 id="building-git">  
                 <title>Git</title>  
                 <para>You should use <command>git-buildpackage</command> to build the  
                 packages with git. Be sure to run it from the <quote>master</quote>  
                 branch.</para>  
                 <para>Unfortunately, by default <command>git-buildpackage</command>  
                 builds the package without using any chroot (the same as  
                 <command>svn-buildpackage</command>), but it's configurable to run  
                 it inside a chroot.</para>  
                 <para>You can use this configuration file, <filename>~/.gbp.conf</filename>:</para>  
                 <blockquote>  
                     <programlisting>[DEFAULT]  
 builder = ~/bin/git-pbuilder  
 cleaner = fakeroot debian/rules clean  
 pristine-tar = True  
   
 [git-buildpackage]  
 # use this for more svn-buildpackage like behaviour:  
 export-dir = ../build-area/  
 tarball-dir = ../tarballs/</programlisting>  
                 </blockquote>  
                 <para>With this configuration file you're specifying that  
                 <command>git-buildpackage</command> will use <filename>~/bin/git-pbuilder</filename>  
                 as the builder script. This is an example script you can use:</para>  
                 <blockquote>  
                     <programlisting>#!/bin/sh  
 set -e  
   
 pdebuild --pbuilder cowbuilder --debbuildopts "-i\.git -I.git $*"  
 rm ../*_source.changes</programlisting>  
                 </blockquote>  
                 <para>This will build the package inside the default cowbuilder chroot, while  
                 passing any more parameters directly do <command>dpkg-buildpackage</command>.</para>  
             </sect4>  
             </sect3>  
             <sect3 id="tagging">  
                         <title>Tagging packages</title>  
             <sect4 id="tagging-subversion">  
             <title>Subversion</title>  
                         <para>It may happen that a package version has been uploaded to Debian  
                         repositories, and you forgot to tag the last build with</para>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>svn-buildpackage --svn-tag</command>  
                                 </userinput></para>  
                         </blockquote>  
674                          <para>                          <para>
675                                  You can tag this package also retroactively. A first step, creating                                  Try to inject a new package only after successfully building it with
676                                  the tags directory, can be achieved in two ways:                                  <command>dpkg-buildpackage</command> (or any wrapper around it).  Use a
677                                  <itemizedlist>                                  file like <filename>debian/DRAFT</filename> to mention when the package
678                                          <listitem>                                  is a draft.
679                                                  <para>create it locally (it is a sibling of <filename class="directory">trunk/</filename>), and commit:</para>                          </para>
680                                                  <blockquote>                  </sect2>
681                                                          <para><userinput>                  <sect2 id="new-packages-in-tasks">
682                                                                  <command>svn mkdir</command> <filename class="directory">tags</filename>                          <title>The Debian Med Blend tasks</title>
683                                                          </userinput></para>                          <para>
684                                                          <para><userinput>                                  Once you injected a new package please make sure that it is mentioned
685                                                                  <command>svn commit</command>                                  in the appropriate <link linkend="tasks">tasks</link> file in the SVN
686                                                          </userinput></para>                                  source of the <package>debian-med</package> Blend package.  Some team
687                                                  </blockquote>                                  members watch the changes in the Debian Med packaging pool but it helps
688                                          </listitem>                                  if the maintainer of a new package verifies that everything is in the
689                                          <listitem>                                  right place.
690                                                  <para>create it remotely:</para>                          </para>
691                                                  <blockquote>                  </sect2>
692                                                          <para><userinput>                  <sect2 id="building-and-tagging">
693                                                                  <command>svn mkdir</command> <filename class="directory">svn+ssh://user@svn.debian.org/svn/debian-med/trunk/packages/&lt;package&gt;/tags</filename>                          <title>Building and tagging the packages</title>
694                                                          </userinput></para>                          <para>
695                                                  </blockquote>                                  We prefer that uploaded packages are built in a chroot, to provide
696                                          </listitem>                                  similar build environment to the whole team.  After upload, please <link linkend="vcs-tags">tag</link>
697                                  </itemizedlist>                                  the <link linkend="svn-tag-release">Suvbersion</link> or <link linkend="git-tag-release">Git</link> repository.
698                          </para>                          </para>
                         <para>After the tags directory has been created, you're ready to tag the  
                         package:</para>  
                         <blockquote>  
                                 <para><userinput>  
                                         <command>svn-buildpackage --svn-tag-only --svn-no-autodch</command>  
                                 </userinput></para>  
                         </blockquote>  
                         <para>(--svn-no-autodch avoids <filename>debian/changelog</filename> to be marked as UNRELEASED).</para>  
             </sect4>  
                 <sect4 id="tagging-git">  
                     <title>Git</title>  
                     <para>Tagging a release with git is pretty straightforward:</para>  
                     <blockquote>  
                         <para><userinput>  
                             <command>git tag</command>  
                             <option>tagname</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>The tag names usually follow the scheme <quote>debian/x.y-z</quote>,  
                     this will ensure compatibility with other tools as well (like  
                     <command>git import-dsc</command>).</para>  
                     <para>You can also easily retroactively make tags:</para>  
                     <blockquote>  
                         <para><userinput>  
                             <command>git checkout</command>  
                             <option>&lt;commit hash&gt;</option>  
                         </userinput></para>  
                     </blockquote>  
                     <para>You're now at the point in history when you released the package.  
                     Just tag it as you would normally do.</para>  
                     <para>After tagging, be sure to <command>git push --tags</command>, so that  
                     other people can benefit from it too.</para>  
                 </sect4>  
             </sect3>  
699                  </sect2>                  </sect2>
700                  <sect2 id="patches">                  <sect2 id="patches">
701                          <title>Handling patches</title>                          <title>Handling patches</title>
702                          <para>Often happens that the upstream code doesn't fit well into the                          <para>
703                          Debian distribution: be this wrong paths, missing features, anything                                  Often happens that the upstream code doesn't fit well into the
704                          that implies editing the source files. When you directly edit                                  Debian distribution: be this wrong paths, missing features, anything
705                          upstream's source files, your changes will be put into a .diff.gz file,                                  that implies editing the source files.  When you directly edit
706                          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                                  upstream's source files, your changes will be put into a .diff.gz file
707                          <filename class="directory">debian/patches</filename> directory.</para>                                  if you use the <literal>1.0</literal> source format and in a monolithic
708                          <para>The most known are <command>quilt</command>, <emphasis>simple-patchsys</emphasis> (from the <emphasis>CDBS</emphasis> package) and <command>dpatch</command>.                                  patch if you use the <literal>3.0 (quilt)</literal> format.  To better
709                          Please don't use any other patch system in Debian Med, unless absolutely                                  organise the patches and group the by function, please use a patch
710                          necessary.</para>                                  handling system which keeps patches under the <filename
711                                    class="directory">debian/patches</filename> directory.
712                            </para>
713                            <para>
714                                    The <literal>3.0 (quilt)</literal> Dpkg source format provides its own
715                                    patch system.  Apart from this, the most popular is
716                                    <command>quilt</command>.  <emphasis>simple-patchsys</emphasis>, from
717                                    the <package>CDBS</package> package, is deprecated since version
718                                    <literal>0.4.85</literal>.  <command>dpatch</command> has been popular
719                                    as well, but is not compatible with the <literal>3.0 (quilt)</literal>
720                                    source format.  Please don't use any other patch system in Debian Med,
721                                    unless absolutely necessary.
722                            </para>
723                          <sect3 id="quilt">                          <sect3 id="quilt">
724                                  <title>Using <command>quilt</command></title>                                  <title>Using <command>quilt</command></title>
725                                  <para>Using quilt is rather easy.</para>                                  <para>Using quilt is rather easy.</para>

Legend:
Removed from v.6322  
changed lines
  Added in v.6399

  ViewVC Help
Powered by ViewVC 1.1.5