+ All Categories
Home > Documents > Debian Maintainers Guide

Debian Maintainers Guide

Date post: 30-May-2018
Category:
Upload: rogerscrogersc
View: 217 times
Download: 0 times
Share this document with a friend

of 61

Transcript
  • 8/14/2019 Debian Maintainers Guide

    1/61

    Debian New Maintainers Guide Josip Rodin

    version 1.2.13, 5 June 2008.

  • 8/14/2019 Debian Maintainers Guide

    2/61

    Copyright NoticeCopyright 1998-2002 Josip Rodin.Copyright 2005-2007 Osamu Aoki.

    This document may be used under the terms the GNU General Public License version 2 orhigher.

    This document was made using with these two documents as examples:

    Making a Debian Package (AKA the Debmake Manual), copyright 1997 Jaldhar Vyas.

    The New-Maintainers Debian Packaging Howto, copyright 1997 Will Lowe.

  • 8/14/2019 Debian Maintainers Guide

    3/61

    i

    Contents

    1 Getting started The Right Way 1

    1.1 Programs you need for development . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.2 Ofcial Debian Developer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    1.3 Other information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    2 First steps 5

    2.1 Choose your program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.2 Get the program, and try it out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.3 Package name and version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    2.4 Initial debianization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3 Modifying the source 9

    3.1 Installation in a subdirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

    3.2 Differing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    4 Required stuff under debian/ 13

    4.1 control le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.2 copyright le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    4.3 changelog le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    4.4 rules le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    5 Other les under debian/ 25

    5.1 README.Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    5.2 confles.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    5.3 cron.d.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

  • 8/14/2019 Debian Maintainers Guide

    4/61

    CONTENTS ii

    5.4 dirs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    5.5 docs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275.6 emacsen-*.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

    5.7 init.d.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    5.8 manpage.1.ex, manpage.sgml.ex, manpage.xml.ex . . . . . . . . . . . . . . . . . . 28

    5.9 menu.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    5.10 watch.ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    5.11 ex.package.doc-base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    5.12 postinst.ex, preinst.ex, postrm.ex, prerm.ex . . . . . . . . . . . . . . . . . . . . . . 31

    6 Building the package 33

    6.1 Complete rebuild . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

    6.2 Quick rebuild . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    6.3 The debuild command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    6.4 The dpatch and quilt systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    6.5 Including orig.tar.gz for upload . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    7 Checking the package for errors 37

    7.1 The lintian package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    7.2 The mc command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    7.3 The debdiff command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    7.4 The interdiff command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    7.5 The debi command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    7.6 The pbuilder package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    8 Uploading the package 41

    8.1 Uploading to the Debian archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    8.2 Uploading to a private archive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

    9 Updating the package 45

    9.1 New Debian revision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    9.2 New upstream release (basic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

    9.3 New upstream release (realistic) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

  • 8/14/2019 Debian Maintainers Guide

    5/61

    CONTENTS iii

    9.4 The orig.tar.gz le . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    9.5 The cvs-buildpackage command and similes . . . . . . . . . . . . . . . . . . . 489.6 Verifying package upgrades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    10 Where to ask for help 51

    A Examples 53

    A.1 Simple packaging example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    A.2 Packaging example with the dpatch and the pbuilder . . . . . . . . . . . . . . 53

  • 8/14/2019 Debian Maintainers Guide

    6/61

    CONTENTS iv

  • 8/14/2019 Debian Maintainers Guide

    7/61

    1

    Chapter 1

    Getting started The Right Way

    This document tries to describe building of a Debian package to the common Debian user, andprospectus developer. It uses pretty common language, and its well covered with working ex-amples. There is an old Roman saying, Longum iter est per preaecepta, breve et efcax per exempla!(Its a long way by the rules, but short and efcient with examples!).

    One of the things that makes Debian such a top-notch Linux distribution is its package system.While there is a vast quantity of software already in the Debian format, sometimes you need toinstall software that isnt. You may be wondering how you can make your own packages andperhaps you think it is a very difcult task. Well, if you are a real novice on Linux, it is hard,

    but if you were rookie, you wouldnt be reading this doc now. :-) You do need to know a littleabout Unix programming but you certainly dont need to be a wizard.

    One thing is certain, though: to properly create and maintain Debian packages you need manhours. Make no mistake, for our system to work the maintainers need to be both technicallycompetent and diligent.

    This document will explain every little (at rst maybe irrelevant) step, and help you create thatrst package, and to gain some experience in building next releases of that and maybe otherpackages later on.

    Newer versions of this document should always be available online at http://www.debian.

    org/doc/maint-guide/ and in the maint-guide package.

    1.1 Programs you need for development

    Before you start anything, you should make sure that you have properly installed some ad-ditional packages needed for development. Note that the list doesnt contain any packagesmarked essential or required - we expect that you have those installed already.

    This revision of this document has been updated for the packages in Debian 2.2 (potato) and3.0 (woody).

    http://www.debian.org/doc/maint-guide/http://www.debian.org/doc/maint-guide/http://www.debian.org/doc/maint-guide/http://www.debian.org/doc/maint-guide/
  • 8/14/2019 Debian Maintainers Guide

    8/61

    Chapter 1. Getting started The Right Way 2

    The following packages come with the standard Debian installation, so you probably havethem already (along with any additional packages they depend on). Still, you should checkwith dpkg -s .

    dpkg-dev - this package contains the tools needed to unpack, build and upload Debiansource packages. (see dpkg-source(1) )

    file - this handy program can determine what type a le is. (see file(1) )

    gcc - the GNU C compiler, necessary if your program like most others is written in theC programming language. (see gcc(1) ) This package will also pull in several otherpackages such as binutils which includes programs used to assemble and link objectles (see info binutils in the binutils-doc package) and cpp , the C preprocessor. (seecpp(1) )

    g++ - the GNU C++ compiler, necessary if your program is written in C++. (see g++(1) )

    libc6-dev - the C libraries and header les gcc needs to link with to create object les.(see info libc in the glibc-doc package)

    make - usually creation of a program takes several steps, so rather than having to typeout the same commands over and over again, you can use this program to automate theprocess, creating Makeles. (see info make)

    patch - this very useful utility will take a le containing a difference listing (produced

    by the diff program) and apply it to the original le, producing a patched version. (seepatch(1) )

    perl - Perl is one of the most used interpreted scripting languages on todays Unix-likesystems, often referred to as Unixs Swiss Army Chainsaw. (see perl(1) )

    Youll probably want to install the following packages, too:

    autoconf and automake - many newer programs use congure scripts and Makelespreprocessed with help of programs like these. (see info autoconf, info automake)

    dh-make and debhelper - dh-make is necessary to create the skeleton of our examplepackage, and it will use some of the debhelper tools for creating packages. They arenot essential for creation of packages, but are highly recommended for new maintain-ers. It makes the whole process very much easier to start, and control afterwards. (seedh_make(1) , debhelper(1) , /usr/share/doc/debhelper/README)

    devscripts - this package contains some nice and useful scripts that can be help-ful to the maintainers, but they are also not necessary for building packages. (see/usr/share/doc/devscripts/README.gz)

    fakeroot - this utility lets you emulate being root which is necessary for some parts of the build process. (see fakeroot(1) )

  • 8/14/2019 Debian Maintainers Guide

    9/61

    Chapter 1. Getting started The Right Way 3

    gnupg - a tool that enables you to digitally sign packages. This is especially important if you want to distribute it to other people, and you will certainly be doing that when yourwork gets included in the Debian distribution. (see gpg(1) )

    g77 - the GNU Fortran 77 compiler, necessary if your program is written in Fortran. (seeg77(1) )

    gpc - the GNU Pascal compiler, necessary if your program is written in Pascal. Worthyof note here is fp-compiler , the Free Pascal Compiler, which is also good at this task.(see gpc(1) , ppc386(1) )

    xutils - some programs, usually those made for X11, also use these programs to gener-ate Makeles from sets of macro functions. (see imake(1) , xmkmf(1) )

    lintian - this is the Debian package checker that can let you know of any commonmistakes after you build the package, and explain the errors found. (see lintian(1) ,/usr/share/doc/lintian/lintian.html/index.html)

    pbuilder - this package contains programs which is used for creating and maintain-ing chroot environment. Building Debian package in this chroot environment veri-es the proper build dependency and avoid FTBFS bugs. (see pbuilder(8) andpdebuild(1) )

    The following is the very important documentation which you should read along with this doc-ument:

    debian-policy - the Policy includes explanations of the structure and contents of theDebian archive, several OS design issues, the Filesystem Hierarchy Standard (which sayswhere each le and directory should be) etc. For you, the most important thing is that itdescribes requirements that each package must satisfy to be included in the distribution.(see /usr/share/doc/debian-policy/policy.html/index.html)

    developers-reference - for all matters not specically about the technical details of

    packaging, like the structure of the archive, how to rename, orphan, pick up packages,how to do NMUs, how to manage bugs, best packaging practices, when and where toupload etc. (see /usr/share/doc/developers-reference/index.en.html)

    The short descriptions that are given above only serve to introduce you to what each packagedoes. Before continuing please thoroughly read the documentation of each program, at leastthe standard usage. It may seem like heavy going now, but later on youll be very glad youread it.

    Note: debmake is a package that contains some programs that function similar to dh-make, but its specic use is not covered in this document, because it is deprecated.

  • 8/14/2019 Debian Maintainers Guide

    10/61

    Chapter 1. Getting started The Right Way 4

    1.2 Ofcial Debian Developer

    After you build your package (or while doing that), you may want to become an ofcial DebianDeveloper to get your new package into the next distribution (if the program is useful, whynot?).

    You can not become an ofcial Debian Developer over night because it takes more than tech-nical skill. Please do not be discouraged by this. You can still upload your package, if use-ful to others, now as a maintainer through a sponsor while applying yourself to the DebianNew Maintainer process ( http://nm.debian.org/ ). Here, the sponsor is an ofcial DebianDeveloper who helps maintainer to upload packages to the Debian archive. More details of this procedure are explained in the debian-mentors FAQ ( http://people.debian.org/~mpalmer/debian-mentors_FAQ.html ).

    Please note that you do not need to create any new package to become an ofcial DebianDeveloper. Contributing to the existing packages can provide a path to become an ofcialDebian Developer too.

    1.3 Other information

    There are two types of packages you can make, source and binary. A source package containscode which you can compile into a program. A binary package contains just the nishedprogram. Dont mix terms like source of the program and the source package of the program!Please read the other manuals if you need more details on terminology.

    In Debian, the term maintainer is used for the person who makes packages, upstream au-thor for the person that made the program, and upstream maintainer for the person whocurrently maintains that program, outside of Debian. Usually author and the upstream main-tainer are the same person - and sometimes even the maintainer is the same person. If youmade a program, and want it to get in Debian, feel free to submit your application to becomea maintainer.

    http://nm.debian.org/http://people.debian.org/~mpalmer/debian-mentors_FAQ.htmlhttp://people.debian.org/~mpalmer/debian-mentors_FAQ.htmlhttp://people.debian.org/~mpalmer/debian-mentors_FAQ.htmlhttp://people.debian.org/~mpalmer/debian-mentors_FAQ.htmlhttp://nm.debian.org/
  • 8/14/2019 Debian Maintainers Guide

    11/61

    5

    Chapter 2

    First steps

    2.1 Choose your program

    You have probably chosen the package you want to create. The rst thing you need to do ischeck if the package is in the distribution archive already by using aptitude . If you use thestable distribution, maybe its best that you go to the package search page (http://www.debian.org/distrib/packages ).

    If the package already exists, well, install it! :-) If it happens to be orphaned if its maintaineris set to Debian QA Group, you may be able to pick it up.

    Then you should consult the Debian web site at Work-Needing and Prospective Packages(http://www.debian.org/devel/wnpp/ ) and its linked pages to check the latest adop-tion/orphan status of the package.

    If you are able to adopt the package, get the sources (with something like apt-get sourcepackagename ) and examine them. This document unfortunately doesnt include comprehen-sive information about adopting packages. Thankfully you shouldnt have a hard time guringout how the package works since someone has already done the initial set up for you. Keepreading, though, a lot of the advice below will still be applicable for your case.

    If the package is new, and you decide youd like to see it in Debian, proceed as follows:

    check if no one else is working on the package already at the list of packages be-ing worked on (http://www.de.debian.org/devel/wnpp/being_packaged ). If someones already on it, contact them if you feel you need to. If not - nd another inter-esting program that nobody maintains.

    program must have a license.

    For the main section, it must be compliant to all the Debian Free Software Guide-lines (http://www.debian.org/social_contract#guidelines ) (DFSG)and must not require a package outside of main for compilation or execution asrequired by the Debian Policy. This is desired case.

    http://www.debian.org/distrib/packageshttp://www.debian.org/distrib/packageshttp://www.debian.org/distrib/packageshttp://www.debian.org/devel/wnpp/http://www.de.debian.org/devel/wnpp/being_packagedhttp://www.de.debian.org/devel/wnpp/being_packagedhttp://www.debian.org/social_contract#guidelineshttp://www.debian.org/social_contract#guidelineshttp://www.debian.org/social_contract#guidelineshttp://www.debian.org/social_contract#guidelineshttp://www.de.debian.org/devel/wnpp/being_packagedhttp://www.debian.org/devel/wnpp/http://www.debian.org/distrib/packageshttp://www.debian.org/distrib/packages
  • 8/14/2019 Debian Maintainers Guide

    12/61

    Chapter 2. First steps 6

    For the contrib section, it must be compliant to all the DSFG but it may require apackage outside of main for compilation or execution.

    For the non-free section, it may not be compliant to some of the DSFG but it must be distributable.

    If you are unsure about where it should go, post the license text on and ask for advice.

    program certainly should not run setuid root, or even better - it shouldnt need to besetuid or setgid to anything.

    program should not be a daemon, or something that goes in */sbin directories, or open aport as root.

    program should result in binary executable form, libraries are harder to handle.

    it should be well documented, or and the code needs to be understandable (i.e. notobfuscated).

    you should contact programs author(s) to check if they agree with packaging it. It isimportant to be able to consult with author(s) about the program in case of any programspecic problems, so dont try to package unmaintained pieces of software.

    and last but not least, you must know that it works, and have tried it for some time.

    Of course, these things are just safety measures, and intended to save you from raging usersif you do something wrong in some setuid daemon. . . When you gain some more experiencein packaging, youll be able to do such packages, but even the experienced developers consultthe debian-mentors mailing list when they are in doubt. And people there will gladly help.

    For more help about these, check in Developers Reference.

    2.2 Get the program, and try it out

    So the rst thing to do is to nd and download the original package. I presume that youalready have the source le that you picked up at the authors homepage. Sources for freeUnix programs usually come in tar/gzip format, with extension .tar.gz, and usually containthe subdirectory called program-version and all the sources in it. If your programs sourcecomes as some other sort of archive (for instance, the lename ends in .Z or .zip), unpackit with appropriate tools, or ask on the debian-mentors mailing list if youre not sure how tounpack it correctly (hint: issue le archive.extension).

    As an example, Ill use a program called gentoo, an X GTK+ le manager. Note that theprogram is already packaged, and has changed substantially from the version while this textwas rst written.

    Create a subdirectory under your home directory named debian or deb or anything you ndappropriate (e.g. just ~/gentoo/ would do ne in this case). Place the downloaded archive in

  • 8/14/2019 Debian Maintainers Guide

    13/61

    Chapter 2. First steps 7

    it, and uncompress it (with tar xzf gentoo-0.9.12.tar.gz). Make sure there are no errors, evensome irrelevant ones, because there will most probably be problems unpacking on otherpeoples systems, whose unpacking tools may or may not ignore those anomalies.

    Now you have another subdirectory, called gentoo-0.9.12. Change to that directory andthoroughly read the provided documentation. Usually there are les named README*, IN-STALL*, *.lsm or *.html. You must nd instructions on how to correctly compile and install theprogram (most probably theyll assume you want to install to /usr/local/bin directory; youwont be doing that, but more on that later in Installation in a subdirectory on page 9).

    The process varies from program to program, but a lot of modern programs come with a con-gure script that congures the source under your system and makes sure that your system isin condition to compile it. After conguring with ./congure, programs are usually compiledwith make. Some of them support make check, to run included self-checks. Installation indestination directories is usually done with make install.Now try to compile and run your program, to make sure it works properly and doesnt breaksomething else while its installing or running.

    Also, you can usually run make clean (or better make distclean) to clean up the build direc-tory. Sometimes theres even a make uninstall which can be used to remove all the installedles.

    2.3 Package name and version

    You should start packaging with a completely clean (pristine) source directory, or simply withfreshly unpacked sources.

    For the package to be built correctly, you must make the programs original name lowercase (if it isnt already), and you should move the source directory to -.

    If the program name consists of more than one word, contract them to one word, or makean abbreviation. For example, program Johns little editor for X package would be named johnledx, or jle4x, or whatever you decide, as long as its under some reasonable limit, e.g. 20characters.

    Also check for the exact version of the program (to be included in the package version). If that

    piece of software is not numbered with versions like X.Y.Z, but with some kind of date, feelfree to use that date as the version number, prepended with a 0.0. (just in case upstreampeople one day decide to release a nice version like 1.0). So, if the release or snapshot date was19th of December, 1998, you can use the version string of 0.0.19981219.

    Some programs wont be numbered at all, in which case you should contact the upstreammaintainer to see if theyve got some other revision-tracking method.

    2.4 Initial debianization

    Make sure youre in the program source directory, and issue this:

  • 8/14/2019 Debian Maintainers Guide

    14/61

    Chapter 2. First steps 8

    dh_make -e your.maintainer@address -f ../gentoo-0.9.12.tar.gz

    Of course, replace the string your.maintainer@address with your e-mail address for inclu-sion in the changelog entry and other les, and the lename with the name of your originalsource archive. See dh_make(1) for details.

    Some information will come up. It will ask you what sort of package you want to create.Gentoo is a single binary package - it creates only one binary, and thus one .deb le - so wewill select the rst option, with the s key, check the information on the screen and conrm bypressing .

    After this execution of dh_make , a copy of the upstream tarball is created asgentoo_0.9.12.orig.tar.gz in the parent directory to accommodate the creation of the

    non-native Debian source package with the diff.gz . Please note 2 key features in this lename: Package name and version are separated by the _ . There is the orig. before the tar.gz .

    Once again, as a new maintainer you are discouraged from creating complicated packages,e.g.,

    multiple binary packages, library packages, the source le format being neither in tar.gz. nor tar.bz2 , or the source tarball containing undistributable contents.

    Its not too hard, but it does require a bit more knowledge, so we wont describe all of it here.

    Please note that you should run dh_make only once , and that it wont behave correctly if yourun it again in the same, already debianized, directory. That also means that you will usea different method to release a new revision or a new version of your package in the future.Read more about that later in Updating the package on page 45

  • 8/14/2019 Debian Maintainers Guide

    15/61

    9

    Chapter 3

    Modifying the source

    Normally, programs install themselves in the /usr/local subdirectories. But, Debian packagesmust not use that directory, since it is reserved for system administrators (or users) privateuse. This means that you have to take a look at your programs build system, usually startingwith the Makele. This is the script make(1) will use to automate building this program. Formore details on Makeles, look in rules le on page 20.

    Note that if your program uses GNU automake(1) and/or autoconf(1) , meaning thesource includes Makele.am and/or Makele.in les, respectively, you will need to modifythose les. This is because each automake invocation will rewrite Makele.ins with infor-mation generated from Makele.ams, and each ./congure invocation will do the same withMakeles, with data from Makele.ins. Editing Makele.am les requires some knowledgeof automake, which you can read about in the automake info entry, whereas editing Make-le.in les is pretty much the same as editing Makele les, just pay attention to the variables,i.e. any strings surrounded with @s, for example @CFLAGS@ or @LN_S@, which are replacedwith actual stuff on each ./congure invocation. Please make sure to read /usr/share/doc/autotools-dev/README.Debian.gz before proceeding.

    Also note that there isnt space here to go into all the details of xing upstream sources, buthere are a few problems people often run across.

    3.1 Installation in a subdirectoryMost of the programs have some way of installing themselves in the existing directory struc-ture of your system, so that their binaries get included in your $PATH, and that you nd theirdocumentation and manual pages in common places. However, if you do that, the programwill be installed among everything else already on your system. This would make it hard forthe packaging tools to gure out which les belong to your package and which dont.

    Therefore you need to do something else: install the program into a temporary subdirectoryfrom which the maintainer tools will build a working .deb package. Everything that is con-tained in this directory will be installed on a users system when they install your package, theonly difference is that dpkg will be installing the les in the root directory.

  • 8/14/2019 Debian Maintainers Guide

    16/61

    Chapter 3. Modifying the source 10

    This temporary directory is usually created under your debian/ directory in the unpackedsource tree. It is usually called debian/packagename .

    Bear in mind that even though you need to make the program install in debian/packagename,it still needs to behave correctly when placed in the root directory, i.e. when installedfrom the .deb package. So you mustnt allow the build system to hardcode strings like/home/me/deb/gentoo-0.9.12/usr/share/gentoo into the package les.

    With programs that use GNU autoconf, this will be quite easy. Most such programs havemakeles that are by default set up to allow installation into a random subdirectory whilekeeping in mind that /usr (for example) is the canonical prex. When it detects your programuses autoconf, dh_make will set up commands for doing all this automatically, so you mightas well skip reading this section. But with other programs, you will most probably have toexamine and edit the Makeles.

    Heres the relevant part of gentoos Makele:

    # Where to put binary on make install?BIN = /usr/local/bin

    # Where to put icons on make install?ICONS = /usr/local/share/gentoo

    We see that the les are set to install under /usr/local . Change those paths to:

    # Where to put binary on make install?BIN = $(DESTDIR)/usr/bin

    # Where to put icons on make install?ICONS = $(DESTDIR)/usr/share/gentoo

    But why in that directory, and not some other? Because Debian packages never install les beneath /usr/local that tree is reserved for the system administrators use. Such les onDebian systems go under /usr instead.

    The more exact locations for binaries, icons, documentation etc are specied in the FilesystemHierarchy Standard (see /usr/share/doc/debian-policy/fhs/). I recommend you browse itand read the sections that might concern your package.

    So, we should install the binary in /usr/bin instead of /usr/local/bin, the manual page in/usr/share/man/man1 instead of /usr/local/man/man1 etc. Notice how theres no manualpage mentioned in gentoos makele, but since the Debian Policy requires that every programhas one, well make one later and install it in /usr/share/man/man1.

    Some programs dont use makele variables to dene paths such as these. This means youmight have to edit some real C sources in order to x them to use the right locations. Butwhere to search, and exactly what for? You can nd this out by issuing:

  • 8/14/2019 Debian Maintainers Guide

    17/61

    Chapter 3. Modifying the source 11

    grep -nr -e usr/local/lib --include= * .[c|h] .

    Grep will run recursively through the source tree and tell you the name of the le and the linein it, when it nds an occurrence.

    Edit those les and in those lines replace /usr/local/* with usr/* and thats about it. Becareful that you dont mess up the rest of the code! :-)

    After that you should nd the install target (search for line that starts with install:, that willusually work) and rename all references to directories other than ones dened at the top of theMakele. Previously, gentoos install target said:

    install: gentoo

    install ./gentoo $(BIN)install icons/ * $(ICONS)install gentoorc-example $(HOME)/.gentoorc

    After our change it says:

    install: gentoo-targetinstall -d $(BIN) $(ICONS) $(DESTDIR)/etcinstall ./gentoo $(BIN)install -m644 icons/ * $(ICONS)install -m644 gentoorc-example $(DESTDIR)/etc/gentoorc

    Youve surely noticed that theres now a install -d command before the other commandsin the rule. The original makele didnt have it because usually the /usr/local/bin and otherdirectories already exist on the system where one runs make install. However, since we willinstall into our own empty (or even nonexistent) directory, we will have to create each andevery one of those directories.

    We can also add in other things at the end of the rule, like the installation of additional docu-mentation that the upstream authors sometimes omit:

    install -d $(DESTDIR)/usr/share/doc/gentoo/htmlcp -a docs/ * $(DESTDIR)/usr/share/doc/gentoo/html

    A careful reader will notice that I changed gentoo to gentoo-target in the install: line. Thatis called an unrelated bug x :-)

    Whenever you make changes that are not specically related to Debian package, be sure tosend them to the upstream maintainer so they can be included in the next program revisionand be useful to everyone else. Also remember to make your xes not specic to Debian orLinux (or even Unix!) prior to sending them make them portable. This will make your xesmuch easier to apply.

    Note that you dont have to send the debian/* les upstream.

  • 8/14/2019 Debian Maintainers Guide

    18/61

    Chapter 3. Modifying the source 12

    3.2 Differing libraries

    There is one other common problem: libraries are often different from platform to platform.For example, a Makele can contain a reference to a library which doesnt exist on Debiansystems. In that case, we need to change it to a library which does exist in Debian, and servesthe same purpose.

    So, if there is a line in your programs Makele (or Makele.in) that says something like this(and your program doesnt compile):

    LIBS = -lcurses -lsomething -lsomethingelse

    Change it to this, and it will most probably work:

    LIBS = -lncurses -lsomething -lsomethingelse

    (The author realizes that this is not the best example considering our libncurses package nowships with a libcurses.so symlink, but he couldnt think of a better one. Suggestions verywelcome :-)

  • 8/14/2019 Debian Maintainers Guide

    19/61

    13

    Chapter 4

    Required stuff under debian/

    There is a new subdirectory under the programs source directory, its called debian. Thereare a number of les in this directory that we should edit in order to customize the behaviorof the package. The most important of them are control, changelog, copyright and rules,which are required for all packages.

    4.1 control le

    This le contains various values which dpkg , dselect and other package management toolswill use to manage the package.

    Here is the control le dh_make created for us:

    1 Source: gentoo2 Section: unknown3 Priority: optional4 Maintainer: Josip Rodin 5 Build-Depends: debhelper (>> 3.0.0)6 Standards-Version: 3.6.2

    78 Package: gentoo9 Architecture: any10 Depends: ${shlibs:Depends}11 Description: 12

    (Ive added the line numbers.)

    Lines 1-6 are the control information for the source package.

    Line 1 is the name of the source package.

  • 8/14/2019 Debian Maintainers Guide

    20/61

    Chapter 4. Required stuff under debian/ 14

    Line 2 is the section of the distribution the source package goes into.

    As you may have noticed, Debian is divided in sections: main (the free software), non-free (thenot really free software) and contrib (free software that depends on non-free software). Underthose, there are logical subsections that describe in short what packages are in. So we haveadmin for administrator-only programs, base for the basic tools, devel for programmertools, doc for documentation, libs for libraries, mail for e-mail readers and daemons, netfor network apps and daemons, x11 for X11 programs that dont t anywhere else, and manymore.

    Lets change it then to x11. (A main/ prex is implied so we can omit it.)

    Line 3 describes how important it is that the user installs this package. See the Policy manualfor guidance on what to set this eld to. The optional priority will usually work for new

    packages.Section and priority are used by frontends like dselect when they sort packages and selectdefaults. Once you upload the package to Debian, the value of these two elds can be overrid-den by the archive maintainers, in which case you will be notied by email.

    As this is a normal priority package and doesnt conict with anything else, well leave it asoptional.

    Line 4 is the name and email address of the maintainer. Make sure that this eld includes avalid To: header for an email, because after you upload it, the bug tracking system will useit to deliver bug emails to you. Avoid using commas, ampersands and parenthesis.

    The 5th line includes the list of packages required to build your package. Some packageslike gcc and make are implied, see the build-essential package for details. If some non-standard compiler or other tool is needed to build your package, you should add it to theBuild-Depends line. Multiple entries are separated with commas; read on for the explanationof binary dependencies to nd out more about the syntax of this eld.

    You can also have Build-Depends-Indep, Build-Conicts and other elds here. This data will be used by the Debian automatic package building software in order to create binary packagesfor other computer platforms. See the Policy manual for more information about the build-dependencies and the Developers Reference for more information about these other platforms(architectures) and how to port software to them.

    Heres a hack you can use to nd out which packages your package needs to be built:

    strace -f -o /tmp/log ./configure# or make instead of ./configure, if the package doesnt use autoconffor x in dpkg -S $(grep open /tmp/log|\

    perl -pe s!. * open\(\"([^\"] * ). * !$1! |\grep " /"| sort | uniq|\grep -v "^\(/tmp\|/dev\|/proc\)" ) 2>/dev/null|\cut -f1 -d":"| sort | uniq; \

    do \echo -n "$x (>=" dpkg -s $x|grep ^Version|cut -f2 -d":" "), "; \

    done

  • 8/14/2019 Debian Maintainers Guide

    21/61

    Chapter 4. Required stuff under debian/ 15

    This script returns version numbers for all the Build-depends. Please note that versioned de-pendencies which are fullable in stable shouldnt be specied as versioned one in the Build-depends stanza.

    To manually nd exact build dependency for /usr/bin/foo , you execute

    objdump -p /usr/bin/foo | grep NEEDED

    and for each library listed, e.g., libfoo.so.6 , execute

    dpkg -S libfoo.so.6

    Then you just take -dev version of every package as Build-deps entry. If you use ldd for thispurpose, it will report indirect lib dependencies as well, resulting in the problem of excessive build deps.

    Gentoo also happens to require xlibs-dev , libgtk1.2-dev and libglib1.2-dev to build, so well add them here next to debhelper .

    Line 6 is the version of the Debian Policy standards this package follows, the versions of thePolicy manual you read while making your package.

    Line 8 is the name of the binary package. This is usually the same as the name of the sourcepackage, but it doesnt necessarily have to be that way.

    Line 9 describes the CPU architecture the binary package can be compiled for. Well leave thisas any because dpkg-gencontrol(1) will ll in the appropriate value for any machinethis package gets compiled on.

    If your package is architecture independent (for example, a shell or Perl script, or a document),change this to all, and read later in rules le on page 20 about using the binary-indeprule instead of binary-arch for building the package.

    Line 10 shows one of the most powerful features of the Debian packaging system. Packagescan relate to each other in various ways. Apart from Depends:, other relationship elds areRecommends:, Suggests:, Pre-Depends:, Conicts:, Provides:, and Replaces:.

    The package management tools usually behave the same way when dealing with these rela-tions; if not, it will be explained. (see dpkg(8) , dselect(8) , apt(8) , aptitude(1) etc.)

    This is what the dependencies mean:

    Depends:

    The package will not be installed unless the packages it depends on are installed. Use thisif your program absolutely will not run (or will cause severe breakage) unless a particularpackage is present.

  • 8/14/2019 Debian Maintainers Guide

    22/61

    Chapter 4. Required stuff under debian/ 16

    Recommends:

    Frontends such as dselect or aptitude will prompt you to install the recommended pack-ages along with your package; dselect will even insist. dpkg and apt-get will ignore thiseld, though. Use this for packages that are not strictly necessary but are typically usedwith your program.

    Suggests:When a user installs your program, all frontends will likely prompt them to install thesuggested packages. dpkg and apt-get wont care. Use this for packages which will worknicely with your program but are not at all necessary.

    Pre-Depends:This is stronger than Depends:. The package will not be installed unless the packagesit pre-depends on are installed and correctly congured. Use this very sparingly and onlyafter discussing it on the debian-devel mailing list. Read: dont use it at all. :-)

    Conicts:The package will not be installed until all the packages it conicts with have been re-moved. Use this if your program absolutely will not run or will cause severe problems if a particular package is present.

    Provides:For some types of packages where there are multiple alternatives virtual names have been dened. You can get the full list in the /usr/share/doc/debian-policy/virtual-

    package-names-list.txt.gz le. Use this if your program provides a function of an existingvirtual package.

    Replaces:Use this when your program replaces les from another package, or completely replacesanother package (used in conjunction with Conicts:). Files from the named packageswill be overwritten with the les from your package.

    All these elds have uniform syntax. They are a list of package names separated by commas.These package names may also be lists of alternative package names, separated by vertical barsymbols | (pipe symbols).

    The elds may restrict their applicability to particular versions of each named package. Theseversions are listed in parentheses after each individual package name, and they should containa relation from the list below followed by the version number. The relations allowed are: > for strictly earlier, earlier or equal, exactly equal, later or equal and strictlylater, respectively. For example,

    Depends: foo (>= 1.2), libbar1 (= 1.3.4)Conflicts: bazRecommends: libbaz4 (>> 4.0.7)Suggests: quuxReplaces: quux (

  • 8/14/2019 Debian Maintainers Guide

    23/61

    Chapter 4. Required stuff under debian/ 17

    The last feature you need to know about is ${shlibs:Depends}. After your package has been built and installed into the temporary directory, dh_shlibdeps(1) will scan it for binariesand libraries, determine their shared library dependencies and detect which packages they arein, such as libc6 or xlib6g. Itll pass on the list to dh_gencontrol(1) which will ll it in theright place, and you wont have to worry about this yourself.

    Having said all that, we can leave the Depends: line exactly as it is now, and insert another lineafter it saying Suggests: file , because gentoo can use some features provided by thatprogram/package.

    Line 11 is the short description. Most people screens are 80 columns wide so this shouldnt belonger than about 60 characters. Ill change it to fully GUI congurable X le manager usingGTK+.

    Line 12 is where the long description goes. This should be a paragraph which gives moredetails about the package. Column 1 of each line should be empty. There must be no blanklines, but you can put a single . (dot) in a column to simulate that. Also, there must be no morethan one blank line after the long description.

    Finally, here is the updated control le:

    1 Source: gentoo2 Section: x11

    3 Priority: optional4 Maintainer: Josip Rodin 5 Build-Depends: debhelper (>> 3.0.0), xlibs-dev, libgtk1.2-dev, libglib1.6 Standards-Version: 3.5.278 Package: gentoo9 Architecture: any10 Depends: ${shlibs:Depends}11 Suggests: file12 Description: fully GUI configurable X file manager using GTK+13 gentoo is a file manager for Linux written from scratch in pure C. It

    14 uses the GTK+ toolkit for all of its interface needs. gentoo provides15 100% GUI configurability; no need to edit config files by hand and re-16 start the program. gentoo supports identifying the type of various17 files (using extension, regular expressions, or the file command),18 and can display files of different types with different colors and icon19 .20 gentoo borrows some of its look and feel from the classic Amiga file21 manager "Directory OPUS" (written by Jonathan Potter).

    (Ive added the line numbers.)

  • 8/14/2019 Debian Maintainers Guide

    24/61

    Chapter 4. Required stuff under debian/ 18

    4.2 copyright le

    This le contains the information about package upstream resources, copyright and licenseinformation. Its format is not dictated by the Policy, but the content is (section 12.6 Copyrightinformation).

    dh_make created a default one, this is what it looks like:

    1 This package was debianized by Josip Rodin on2 Wed, 11 Nov 1998 21:02:14 +0100.34 It was downloaded from 56 Upstream Author(s): 78 Copyright:910

    (Ive added the line numbers.)

    The important things to add to this le are the place you got the package from and the actualcopyright notice and license. You must include the complete license, unless its one of thecommon free software licenses such as GNU GPL or LGPL, BSD or the Artistic license, whenyou can just refer to the appropriate le in /usr/share/common-licenses/ directory that existson every Debian system.

    In short, heres how gentoos copyright le should look like:

    1 This package was debianized by Josip Rodin on2 Wed, 11 Nov 1998 21:02:14 +0100.34 It was downloaded from: ftp://ftp.obsession.se/gentoo/56 Upstream author: Emil Brink

    78 This software is copyright (c) 1998-99 by Emil Brink, Obsession9 Development.1011 You are free to distribute this software under the terms of12 the GNU General Public License either version 2 of the License,13 or (at your option) any later version.14 On Debian systems, the complete text of the GNU General Public15 License can be found in the file /usr/share/common-licenses/GPL-2.

    (Ive added the line numbers.)

  • 8/14/2019 Debian Maintainers Guide

    25/61

    Chapter 4. Required stuff under debian/ 19

    Please follow the HOWTO from the debian-devel-announce: http://lists.debian.org/debian-devel-announce/2006/03/msg00023.html .

    4.3 changelog le

    This is a required le, which has a special format described in the Policy section 4.4 de- bian/changelog. This format is used by dpkg and other programs to obtain the version num- ber, revision, distribution and urgency of your package.

    For you, it is also important, since it is good to have documented all changes youhave done. It will help people downloading your package to see whether there

    are issues with the package that they should know about. It will be saved as/usr/share/doc/gentoo/changelog.Debian.gz in the binary package.

    dh_make created a default one, and this is how it looks like:

    1 gentoo (0.9.12-1) unstable; urgency=low23 * Initial Release.45 -- Josip Rodin Wed, 11 Nov 1998 21:02:14 +01006

    (Ive added the line numbers.)

    Line 1 is the package name, version, distribution, and urgency. The name must match thesource package name, distribution should be either unstable (or even experimental), andurgency shouldnt be changed to anything higher than low. :-)

    Lines 3-5 are a log entry, where you document changes made in this package revision (notthe upstream changes - there is special le for that purpose, created by the upstream authors,which you will later install as /usr/share/doc/gentoo/changelog.gz). New lines must be in-serted just before the uppermost line that begins with asterisk (*). You can do it with dch(1) ,or manually with a text editor.

    You will end up with something like this:

    1 gentoo (0.9.12-1) unstable; urgency=low23 * Initial Release.4 * This is my first Debian package.5 * Adjusted the Makefile to fix $DESTDIR problems.67 -- Josip Rodin Wed, 11 Nov 1998 21:02:14 +01008

    http://lists.debian.org/debian-devel-announce/2006/03/msg00023.htmlhttp://lists.debian.org/debian-devel-announce/2006/03/msg00023.htmlhttp://lists.debian.org/debian-devel-announce/2006/03/msg00023.htmlhttp://lists.debian.org/debian-devel-announce/2006/03/msg00023.html
  • 8/14/2019 Debian Maintainers Guide

    26/61

    Chapter 4. Required stuff under debian/ 20

    (Ive added the line numbers.)

    You can read more about updating the changelog le later in Updating the package onpage 45.

    4.4 rules le

    Now we need to take a look at the exact rules which dpkg-buildpackage(1) will use toactually create the package. This le is actually another Makele, but different than the one(s)in the upstream source. Unlike other les in debian/, this one is marked as executable.

    Every rules le, as any other Makele, consists of several rules specifying how to handle the

    source. Each rule consists of targets, lenames or names of actions that should be carried out(e.g. build: or install:). Rules that you want to execute are invoked as command line ar-guments (for example, ./debian/rules build or make -f rules install). After the target name,you can name the dependency, program or le that the rule depends on. After that, there can beany number of commands, indented with . A new rule begins with the target declarationin the rst column. Empty lines and lines beginning with # (hash) are treated as commentsand ignored.

    You are probably confused now, but it will all be clear upon examination of the rules lethat dh_make gives us as a default. You should also read the make entry in info for moreinformation.

    The important part to know about the rules le created by dh_make, is that it is just a sugges-tion. It will work for simple packages but for more complicated ones, dont be afraid to addand subtract from it to t your needs. Only thing that you must not change are the names of the rules, because all the tools use these names, as mandated by the Policy.

    Heres (approximately) how the default debian/rules le that dh_make generated for us lookslike:

    1 #!/usr/bin/make -f2 # - * - makefile - * -3 # Sample debian/rules that uses debhelper.4 # This file was originally written by Joey Hess and Craig Small.5 # As a special exception, when this file is copied by dh-make into a6 # dh-make output file, you may use that output file without restricti7 # This special exception was added by Craig Small in version 0.37 of8 # Uncomment this to turn on verbose mode.9 #export DH_VERBOSE=1

    10 configure: configure-stamp11 configure-stamp:12 dh_testdir13 # Add here commands to configure the package.14 touch configure-stamp15 build: build-stamp

  • 8/14/2019 Debian Maintainers Guide

    27/61

    Chapter 4. Required stuff under debian/ 21

    16 build-stamp: configure-stamp17 dh_testdir18 # Add here commands to compile the package.19 $(MAKE)20 #docbook-to-man debian/testpack.sgml > testpack.121 touch $@22 clean:23 dh_testdir24 dh_testroot25 rm -f build-stamp configure-stamp26 # Add here commands to clean up after the build process.27 $(MAKE) clean28 dh_clean29 install: build30 dh_testdir31 dh_testroot32 dh_clean -k33 dh_installdirs34 # Add here commands to install the package into debian/testpa35 $(MAKE) DESTDIR=$(CURDIR)/debian/testpack install36 # Build architecture-independent files here.37 binary-indep: build install38 # We have nothing to do by default.39 # Build architecture-dependent files here.40 binary-arch: build install41 dh_testdir42 dh_testroot43 dh_installchangelogs44 dh_installdocs45 dh_installexamples46 # dh_install47 # dh_installmenu48 # dh_installdebconf49 # dh_installlogrotate50 # dh_installemacsen51 # dh_installpam52 # dh_installmime53 # dh_python54 # dh_installinit55 # dh_installcron56 # dh_installinfo57 dh_installman58 dh_link59 dh_strip60 dh_compress61 dh_fixperms

  • 8/14/2019 Debian Maintainers Guide

    28/61

    Chapter 4. Required stuff under debian/ 22

    62 # dh_perl63 # dh_makeshlibs64 dh_installdeb65 dh_shlibdeps66 dh_gencontrol67 dh_md5sums68 dh_builddeb69 binary: binary-indep binary-arch70 .PHONY: build clean binary-indep binary-arch binary install configure

    (Ive added the line numbers. In the actual debian/rules le, the leading white spaces areTAB codes.)

    You are probably familiar with lines like line 1 from shell and Perl scripts. It tells the operatingsystem that this le is to be processed with /usr/bin/make.

    The meaning of DH_* variables mentioned on lines 8 and 9 should be evident from the shortdescription. For information on DH_COMPAT read the Debhelper compatibility levels sec-tion of the debhelper(1) manual page.

    The lines 11 through 16 are a skeleton of support for DEB_BUILD_OPTIONS parameters, de-scribed in the Policy section 10.1 Binaries. Basically, these things control if the binaries are to be built with the debugging symbols, and if they should be stripped upon installation. Again,this is just a skeleton, a hint that you should do it. You should check into how the upstream build system handles the inclusion of debugging symbols and stripping on installation andimplement this yourself.

    Usually you can tell gcc to compile with -g using the CFLAGS variable if thats the case foryour package, propagate the variable by appending CFLAGS=$(CFLAGS) to the $(MAKE)invocation in the build rule (see below). Alternatively, if your package uses an autoconf con-gure script, you can pass it to congure by prepending the above string to the ./congureinvocation in the build rule.

    As for the stripping, programs are commonly congured to install themselves unstripped, andoften without an option to change this. Fortunately, you still have dh_strip(1) which willdetect when the DEB_BUILD_OPTIONS=nostrip ag is set and silently exit.

    Lines 18 through 26 describe the build (and its child build-stamp) rule, which runs make

    with the applications own Makele to compile the program. If your package uses GNUcongure utilities to build binaries, please make absolutely sure to read /usr/share/doc/autotools-dev/README.Debian.gz . Well talk about the commented out docbook-to-man example later in manpage.1.ex, manpage.sgml.ex, manpage.xml.ex on page 28.

    The clean rule, as specied in lines 28-36, cleans up any unneeded binary or auto-generatedstuff, left over from building the package. This rule must be working at all times (even whenthe source tree is cleaned up!), so please use the forcing options (e.g. for rm, that is -f), or havemake ignore return values (failures) using a - in front of the command name.

    The installation process, the install rule, starts with line 38. It basically runs the install rulefrom the programs own Makele, but installs in the $(CURDIR)/debian/gentoo directory- this is why we specied $(DESTDIR) as the root installation directory in gentoos Makele.

  • 8/14/2019 Debian Maintainers Guide

    29/61

    Chapter 4. Required stuff under debian/ 23

    As the comments suggest, the binary-indep rule, on the line 48, is used to build packagesindependent of architecture. As we dont have any, nothing will be done there.

    On to the next rule - binary-arch, on lines 52 through 79, in which we run several smallutilities from the debhelper package that do various operations on your package les to makethe package Policy conforming.

    If your package is an Architecture: all one, you need to include all the commands for buildingthe package under the binary-indep rule, and leave the binary-arch rule empty instead.

    The names of debhelper programs start with dh_, and the rest is the description of what theparticular utility does. It is all quite self-explanatory, but here are some additional explana-tions:

    dh_testdir(1) checks that you are in the right directory (i.e. the top-level source di-rectory),

    dh_testroot(1) checks that you have root permissions which is needed for the targetsbinary-arch, binary-indep and clean,

    dh_installman(1) will copy the manpages into the right place in the destination di-rectory, you just have to tell it where they are, relative to the top-level source directory,

    dh_strip(1) strips debugging headers from executable les and libraries, to makethem smaller,

    dh_compress(1) compresses man pages and documentation larger than 4 kB withgzip(1) ,

    dh_installdeb(1) copies package related les (e.g. the maintainer scripts) to thedebian/gentoo/DEBIAN directory,

    dh_shlibdeps(1) calculates shared libraries dependencies of the libraries and exe-cutables,

    dh_gencontrol(1) installs a ne-tuned version of the control le into debian/gentoo/DEBIAN ,

    dh_md5sums(1) generates MD5 checksums for all the les in the package.

    For more complete information on what do all these dh_* scripts do, and what their otheroptions are, please read their respective manual pages. There are some other (possibly veryuseful) dh_* scripts which were not mentioned here. If you need them, read the debhelperdocumentation.

    The binary-arch section is the one where you really should comment out or remove any linesthat call features you dont need. For gentoo, Ill comment out lines about examples, cron,init, man and info, simply because gentoo doesnt need them. Also, on the line 68, Ill replaceChangeLog with FIXES, because that is the real name of the upstream changelog le.

    The last two lines (along with any other unexplained ones) are just some more-or-less necessarythings, regarding which you can read in the make manual, and the Policy. For now, theyre notimportant to know about.

  • 8/14/2019 Debian Maintainers Guide

    30/61

    Chapter 4. Required stuff under debian/ 24

  • 8/14/2019 Debian Maintainers Guide

    31/61

    25

    Chapter 5

    Other les under debian/

    You will see that there are several other les in the debian/ subdirectory, most of them withthe ex sufx or prex, meaning that they are examples. Take a look at all of them. If you wishor need to use any of those features:

    take a look at the related documentation (hint: the Policy Manual),

    if necessary modify the les to suit your needs,

    rename them to remove the .ex sufx if they have one,

    rename them to remove the ex. prex if they have one,

    modify the rules le if necessary.

    Some of those les, the commonly used ones, are explained in the following sections.

    5.1 README.Debian

    Any extra details or discrepancies between the original package and your debianized versionshould be documented here.

    dh_make created a default one, this is what it looks like:

    gentoo for Debian-----------------

    -- Josip Rodin , Wed, 11 Nov 1998 21:02:14 +0100

    Since we dont have anything to put there, well delete the le.

  • 8/14/2019 Debian Maintainers Guide

    32/61

    Chapter 5. Other les under debian/ 26

    5.2 confles.ex

    One of the most annoying things about software is when you spend a great deal of time andeffort customizing a program, only to have an upgrade stomp all over your changes. Debiansolves this problem by marking conguration les so that when you upgrade a package, youll be prompted whether you want to keep your old conguration or not.

    The way to do this in a package is to enter the full path to each conguration le (usually in/etc), one per line, in a le called conffiles . Gentoo has one confle, /etc/gentoorc, andwell enter that in the conffiles le.

    If your program uses conguration les but also rewrites them on its own, its best not to markthem as confles because dpkg will then prompt users to verify the changes all the time.

    If the program youre packaging requires every user to modify the conguration le in orderto work at all, also consider not marking the le as a confle.

    You can handle example conguration les from the maintainer scripts, for more informationsee postinst.ex, preinst.ex, postrm.ex, prerm.ex on page 31.

    If your program has no confles, you can safely delete the conffiles le from the debian/directory.

    5.3 cron.d.ex

    If your package requires regularly scheduled tasks to operate properly, you can use this le toset it up.

    Note that this doesnt include log rotation; for that, see dh_installlogrotate(1) andlogrotate(8) .

    If not, remove it.

    5.4 dirs

    This le species the directories which we need but the normal installation procedure (makeinstall) somehow doesnt create.

    By default, it looks like this:

    usr/binusr/sbin

    Note that the preceding slash is not included. We would have normally changed it to look likethis:

  • 8/14/2019 Debian Maintainers Guide

    33/61

    Chapter 5. Other les under debian/ 27

    usr/binusr/man/man1

    but those directories are already created in the Makele, so we wont need this le, and we willinstead delete it.

    5.5 docs

    This le species the le names of documentation les we can have dh_installdocs install intothe temporary directory for us.

    By default, it will include all existing les in the top-level source directory that are calledBUGS, README*, TODO etc.

    For gentoo, I also included some other stuff:

    BUGSCONFIG-CHANGESCREDITSONEWSREADMEREADME.gtkrc

    TODO

    We can also remove this le and instead list these les on the dh_installdocs commandline in the rules le, like this:

    dh_installdocs BUGS CONFIG-CHANGES CREDITS ONEWS README \README.gtkrc TODO

    How ever unlikely it may seem, you may not have any such les in your packages sources. Inthat case you can safely remove this le. But dont remove the dh_installdocs invocation

    from the rules le because thats used to install the copyright le and other things.

    5.6 emacsen-*.ex

    If your package supplies Emacs les that can be bytecompiled at package installation time, youcan use these les to set it up.

    They are installed into the temporary directory by dh_installemacsen(1) , so dont forgetto uncomment that line in the rules le if you use this.

    If you dont need these, remove them.

  • 8/14/2019 Debian Maintainers Guide

    34/61

    Chapter 5. Other les under debian/ 28

    5.7 init.d.ex

    If your package is a daemon that needs to be run at system startup, youve obviously disre-garded my initial recommendation, havent you? :-)

    This is a fairly generic skeleton le for an /etc/init.d/ script, so youll likely have to editit, a lot. It gets installed into the temporary directory by dh_installinit(1) .

    If you dont need this, remove the le.

    5.8 manpage.1.ex, manpage.sgml.ex, manpage.xml.ex

    Your program(s) should have a manual page. If they dont, each of these les is a template thatyou can ll out.

    manpage.1.ex Manual pages are normally written in nroff(1) . The manpage.1.ex ex-ample is written in nroff, too. See the man(7) manual page for a brief description of howto edit such a le.

    The nal manual page le name should include the name of the program it is document-ing, so we will rename it from manpage to gentoo. The le name also includes .1as the rst sufx, which means its a manual page for a user command. Be sure to verifythat this section is indeed the correct one. Heres a short list of manual page sections:

    Section | Description | Notes1 User commands Executable commands or scripts.2 System calls Functions provided by the kernel.3 Library calls Functions within system libraries.4 Special files Usually found in /dev5 File formats E.g. /etc/passwds format6 Games Or other frivolous programs7 Macro packages Such as man macros.8 System administration Programs typically only run by root.

    9 Kernel routines Non-standard calls and internals.

    So gentoos man page should be called gentoo.1 . There was no gentoo.1 man page inthe original source so I wrote it using information from the example and from upstreamdocs.

    manpage.sgml.ex If on the other hand you prefer writing SGML instead of nroff, you canuse the manpage.sgml.ex template. If you do this, you have to:

    install the docbook-to-man package

    add docbook-to-man to the Build-Depends line in the control le

  • 8/14/2019 Debian Maintainers Guide

    35/61

    Chapter 5. Other les under debian/ 29

    remove the comment from the docbook-to-man invocation in the build target of your rules le

    And remember to rename the le to something like gentoo.sgml !

    manpage.xml.ex If you prefer XML over SGML, you can use the manpage.xml.ex tem-plate. If you do this, you have two choices:

    install the docbook-xsl package and an XSLT processor like xsltproc (recom-mended)

    add the docbook-xsl , docbook-xml and xsltproc packages to theBuild-Depends line in the control le

    add a rule to the build target of your rules le:

    xsltproc --nonet \--param make.year.ranges 1 \--param make.single.year.ranges 1 \--param man.charmap.use.subset 0 \-o debian/ \/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docboodebian/manpage.xml

    Alternatively:

    install the docbook2x package

    add the docbook2x package to the Build-Depends line in the control le

    add a rule to the build target of your rules le:

    docbook2man debian/manpage.xml

    Rename the source le(s) to something like gentoo.1.xml or so and check the packagedocumentations for stylesheet parameters and output options.

    5.9 menu.ex

    X Window System users usually have a window manager with a menu that can be customizedto launch programs. If they have installed the Debian menu package, a set of menus for everyprogram on the system will be created for them.

    Heres the default menu.ex le that dh_make created:

    ?package(gentoo):needs="X11|text|vc|wm" section="Apps/see-menu-manual"\title="gentoo" command="/usr/bin/gentoo"

  • 8/14/2019 Debian Maintainers Guide

    36/61

    Chapter 5. Other les under debian/ 30

    The rst eld after the colon character is needs, and it species what kind of interface theprogram needs. Change this to one of the listed alternatives, e.g. text or X11.

    The next is section, where the menu and submenu the entry should appear in. Thecurrent list of sections is at: /usr/share/doc/debian-policy/menu-policy.html/ch2.html#s2.1

    The title eld is the name of the program. You can start this one in uppercase if you like. Justkeep it short.

    Finally, the command eld is the command that runs the program.

    Now well change the menu entry to this:

    ?package(gentoo): needs="X11" section="Apps/Tools" title="Gentoo" command="

    You can also add other elds like longtitle, icon, hints etc. See menufile(5) ,update-menus(1) and /usr/share/doc/debian-policy/menu-policy.html/ formore information.

    5.10 watch.ex

    This le is used to congure the uscan(1) and uupdate(1) programs (in the devscriptspackage). These are used to watch the site you got the original source from.Heres what I put in it:

    # watch control file for uscan# Site Directory Pattern Version Scriptftp.obsession.se /gentoo gentoo-(. * )\.tar\.gz debian uupdate

    Hint: connect to the Internet, and try running uscan in the program directory once you createthe le. And read the manuals! :)

    5.11 ex.package.doc-base

    If your package has documentation other than manual pages and info docs, you should usethe doc-base le to register it, so the user can nd it with e.g. dhelp(1) , dwww(1) ordoccentral(1) .

    This usually includes HTML, PS and PDF les, shipped in /usr/share/doc/packagename/ .

    This is how gentoos doc-base le gentoo.doc-base looks like:

  • 8/14/2019 Debian Maintainers Guide

    37/61

    Chapter 5. Other les under debian/ 31

    Document: gentooTitle: Gentoo ManualAuthor: Emil BrinkAbstract: This manual describes what Gentoo is, and how it can be used.Section: Apps/Tools

    Format: HTMLIndex: /usr/share/doc/gentoo/html/index.htmlFiles: /usr/share/doc/gentoo/html/ * .html

    For information on the le format, see install-docs(8) and the doc-base manual, in/usr/share/doc/doc-base/doc-base.html/ .

    For more details on installing additional documentation, look in Installation in a subdirectoryon page 9.

    5.12 postinst.ex, preinst.ex, postrm.ex, prerm.ex

    These les are called maintainer scripts. They are scripts which are put in the control area of the package and run by dpkg when your package is installed, upgraded or removed.

    For now, you should try to avoid any manual editing of maintainer scripts if you possibly can because they tend to get complex. For more information look in the Policy Manual, chapter 6,and take a look at these example les provided by dh_make.

  • 8/14/2019 Debian Maintainers Guide

    38/61

    Chapter 5. Other les under debian/ 32

  • 8/14/2019 Debian Maintainers Guide

    39/61

    33

    Chapter 6

    Building the package

    We should now be ready to build the package.

    6.1 Complete rebuild

    Enter the programs main directory and then issue this command:

    dpkg-buildpackage -rfakeroot

    This will do everything for you. It will:

    clean the source tree (debian/rules clean), using fakeroot

    build the source package (dpkg-source -b)

    build the program (debian/rules build)

    build the binary package (debian/rules binary), using fakeroot

    sign the source .dsc le, using gnupg

    create and sign the upload .changes le, using dpkg-genchanges and gnupg

    The only input that will be required of you is your GPG key secret pass phrase, twice.

    After all this is done, you will see the following les in the directory above ( ~/gentoo/ ):

    gentoo_0.9.12.orig.tar.gz

    This is the original source code tarball, merely renamed to the above so that it adheres tothe Debian standard. Note that this was created using the -f option to dh_make whenwe initially ran it.

  • 8/14/2019 Debian Maintainers Guide

    40/61

    Chapter 6. Building the package 34

    gentoo_0.9.12-1.dsc

    This is a summary of the contents of the source code. The le is generated from yourcontrol le, and is used when unpacking the source with dpkg-source(1) . This leis GPG signed, so that people can be sure that its really yours.

    gentoo_0.9.12-1.diff.gz

    This compressed le contains each and every addition you made to the original sourcecode, in the form known as unied diff. It is made and used by dpkg-source(1) .Warning: if you dont name the original tarball packagename_version.orig.tar.gz,dpkg-source will fail to generate the .diff.gz le properly!

    If someone else wants to re-create your package from scratch, they can easily do so us-ing the above three les. The extraction procedure is trivial: just copy the three les

    somewhere else and run dpkg-source -x gentoo_0.9.12-1.dsc . gentoo_0.9.12-1_i386.deb

    This is your completed binary package. You can use dpkg to install and remove this justlike any other package.

    gentoo_0.9.12-1_i386.changes

    This le describes all the changes made in the current package revision, and it is used bythe Debian FTP archive maintenance programs to install the binary and source packagesin it. It is partly generated from the changelog le and the .dsc le. This le is GPGsigned, so that people can be sure that its really yours.

    As you keep working on the package, behavior will change and new features will beadded. People downloading your package can look at this le and quickly see what haschanged. Debian archive maintenance programs will also post the contents of this le tothe debian-devel-changes mailing list.

    The long strings of numbers in the .dsc and .changes les are MD5 checksums for the les men-tioned. A person downloading your les can test them with md5sum(1) and if the numbersdont match, theyll know the le is corrupt or has been tampered with.

    6.2 Quick rebuildWith a large package, you may not want to rebuild from scratch every time while you tune adetail in debian/rules . For testing purposes, you can make a .deb le without rebuildingthe upstream sources like this:

    fakeroot debian/rules binary

    Once you are nished with your tuning, remember to rebuild following the above, properprocedure. You may not be able to upload correctly if you try to upload .deb les built thisway.

  • 8/14/2019 Debian Maintainers Guide

    41/61

    Chapter 6. Building the package 35

    6.3 The debuild command

    You can automate package build process further with debuild command. See debuild(1) .

    Customization of the debuild command can be done through /etc/devscripts.conf or ~/.devscripts . I would suggest at least following items:

    DEBSIGN_KEYID="Your_GPG_keyID"DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -ICVS -I.svn"

    With these, you can build package always with your GPG key and avoid including undesiredcomponents. (This is good for sponsoring too.) For example, cleaning source and rebuildingpackage from a user account is as simple as:

    debuild cleandebuild

    6.4 The dpatch and quilt systems

    The simple use of dh_make and dpkg-buildpackage commands will create a single largediff.gz le which contains package maintenance les in debian/ and patch les to thesource. Such a package is a bit cumbersome to inspect and understand for each source treemodication later. This is not so nice. 1

    Several methods for the patch set maintenance have been proposed and are in use with Debianpackages. The dpatch and quilt systems are two of the simplest of such patch maintenancesystems proposed. Other ones are dbs, cdbs, etc.

    A package which is packaged properly with the dpatch or quilt systems has modicationsto the source clearly documented as a set of -p1 patch les with header in debian/patches/ and the source tree is untouched outside of debian/ directory. If you are asking a sponsorto upload your package, this kind of clear separation and documentation of your changes arevery important to expedite the package review by your sponsor. The usage method of dpatchand quilt is explained in dpatch(1) , dpatch-edit-patch(1) and quilt(1) . Bothprograms provide convenience les to include in debian/rules : /usr/share/dpatch/dpatch.make and /usr/share/quilt/quilt.make .

    When someone (including yourself) provides you with a patch to the source later, then thepackage modication is quite simple:

    Edit patch to make it a -p1 patch to the source tree. In the case of dpatch , add header using dpatch patch-template command. Drop it into debian/patches

    1If you are not yet Debian Developer and asking your sponsor to upload your package after his package review,you should make package as easy as possible for him to review.

  • 8/14/2019 Debian Maintainers Guide

    42/61

    Chapter 6. Building the package 36

    Add the patch lenames to debian/patches/00list (for dpatch ) or debian/patches/series (for quilt ).

    Also, dpatch has a capability to make patches architecture dependent using CPP macro.

    6.5 Including orig.tar.gz for upload

    When you rst upload the package to the archive, you need to include the originalorig.tar.gz source. If package version is not at -0 or -1 Debian revision, you must providedpkg-buildpackage command with the -sa option. On the other hand, the -sd optionwill force to exclude the original orig.tar.gz source.

  • 8/14/2019 Debian Maintainers Guide

    43/61

    37

    Chapter 7

    Checking the package for errors

    7.1 The lintian package

    Run lintian(1) on your .changes le; these programs will check for many common pack-aging errors. The commands are:

    lintian -i gentoo_0.9.12-1_i386.changes

    Of course, replace the lename with the name of the .changes le generated for your package.If it appears that there are some errors (lines beginning with E:), read the explanation (the N:lines), correct mistakes, and rebuild as described in Complete rebuild on page 33. If there arelines that begin with W:, those are warnings, so tune the package or verify that the warningsare spurious (and make Lintian overrides; see the documentation for details).

    Note that you can build the package with dpkg-buildpackage and run lintian all in onecommand with debuild(1) .

    7.2 The mc command

    You can unpack the contents of * .deb package with dpkg-deb(1) command. You can listthe contents of a generated Debian package with debc(1) .This can be made into an intuitive process by using a le manager like mc(1) which will letyou browse not only the contents of * .deb package les but also * .diff.gz and * .tar.gzles.

    Be on the lookout for extra unneeded les or zero length les, both in the binary and sourcepackage. Often cruft doesnt get cleaned up properly; adjust your rules le to compensate forthat.

    Tips: zgrep ^+++ ../gentoo_0.9.12-1.diff.gz will give you a list of yourchanges/additions to the source les, and dpkg-deb -c gentoo_0.9.12-1_i386.deb or debc gentoo_0.9.12-1_i386.changes will list the les in the binary package.

  • 8/14/2019 Debian Maintainers Guide

    44/61

    Chapter 7. Checking the package for errors 38

    7.3 The debdiff command

    You can compare le lists in two binary Debian packages with debdiff(1) command. This isuseful for verifying that no les have been unintentionally misplaced or removed, and no otherinadvertent changes were made when updating packages. You can check group of * .deb lessimply by debdiff old-package.change new-package.change .

    7.4 The interdiff command

    You can compare two diff.gz les with interdiff(1) command. This is useful for veri-

    fying that no inadvertent changes were made to the source by the maintainer when updatingpackages. Run interdiff -z old-package.diff.gz new-package.diff.gz .

    7.5 The debi command

    Install the package to test it yourself, e.g. using the debi(1) command as root. Try to installand run it on machines other than your own and watch closely for any warnings or errors bothduring the installation and while the program is being run.

    7.6 The pbuilder package

    For a clean room (chroot) build environment to verify the build dependencies, the pbuilderpackage is very useful. This ensures a clean build from source under the auto-builder fordifferent architectures and avoids the severity serious FTBFS (Fails To Build From Source) bugwhich is always in the RC (release critical) category. See http://buildd.debian.org/ formore on the Debian package auto-builder.

    The most basic use of the pbuilder package is the direct invocation of pbuilder commandfrom root. For example, issue the following commands in the directory where .orig.tar.gz ,

    .diff.gz , and .dsc exist to build a package.

    root # pbuilder create # if second time, pbuilder updateroot # pbuilder build foo.dsc

    The newly built packages will be located in /var/cache/pbuilder/result/ with rootownership.

    The pdebuild command helps you to use pbuilder package functions from the normaluser account. From the root of the source tree while having orig.tar.gz le in its parentdirectory, you issue the following commands:

    http://buildd.debian.org/http://buildd.debian.org/
  • 8/14/2019 Debian Maintainers Guide

    45/61

  • 8/14/2019 Debian Maintainers Guide

    46/61

    Chapter 7. Checking the package for errors 40

  • 8/14/2019 Debian Maintainers Guide

    47/61

    41

    Chapter 8

    Uploading the package

    Now that you have tested your new package thoroughly, you will be ready to start the Debiannew maintainer application process, as described at http://www.debian.org/devel/join/newmaint

    8.1 Uploading to the Debian archive

    Once you become an ofcial developer, youll need to upload the package to the Debianarchive. You can do this manually, but its easier to use the provided automated tools, likedupload(1) or dput(1) . Well describe how its done with dupload .

    First you have to set up duploads cong le. You can either edit the system-wide /etc/dupload.conf le, or have your own ~/.dupload.conf le override the few things youwant to change. Put something like this in the le:

    package config;

    $default_host = "anonymous-ftp-master";

    $cfg{anonymous-ftp-master} = {

    fqdn => "ftp-master.debian.org",method => "ftp",incoming => "/pub/UploadQueue/",# files pass on to dinstall on ftp-master which sends emails itselfdinstall_runs => 1,

    };

    1;

    You can read the dupload.conf(5) manual page to understand what each of these optionsmeans.

    http://www.debian.org/devel/join/newmainthttp://www.debian.org/devel/join/newmainthttp://www.debian.org/devel/join/newmainthttp://www.debian.org/devel/join/newmaint
  • 8/14/2019 Debian Maintainers Guide

    48/61

    Chapter 8. Uploading the package 42

    The $default_host option is the trickiest one it determines which of the upload queueswill be used by default. anonymous-ftp-master is the primary one, but its possiblethat you will want to use another, faster one. For more information about the uploadqueues, read the Developers Reference, section Uploading a package, at /usr/share/doc/developers-reference/ch-pkgs.en.html#s-upload

    Then connect to your Internet provider, and issue this command:

    dupload gentoo_0.9.12-1_i386.changes

    dupload checks that the MD5 checksums of the les match those from the .changes le, so itwill warn you to rebuild it as described in Complete rebuild on page 33 so it can properly

    upload.If you encounter an upload problem at ftp://ftp-master.debian.org/pub/UploadQueue/ , you can x this by manually uploading gnupg signed * .commandsle to ftp://ftp-master.debian.org/pub/UploadQueue/ with ftp . 1 For example,use hello.commands :

    -----BEGIN PGP SIGNED MESSAGE-----

    Uploader: Roman Hodek Commands:

    rm hello_1.0-1_i386.debmv hello_1.0-1.dsx hello_1.0-1.dsc

    -----BEGIN PGP SIGNATURE-----Version: 2.6.3ia

    iQCVAwUBNFiQSXVhJ0HiWnvJAQG58AP+IDJVeSWmDvzMUphScg1EK0mvChgnuD7hBRiVQubXkB2DphLJW5UUSRnjw1iuFcYwH/lFpNpl7XP95LkLX3iFza9qItw4k2/qtvylZkmIA9jxCyv/YB6zZCbHmbvUnL473eLRoxlnYZd3JFaCZMJ86B0Ph4GFNPAfZ4jxNrgh7Bc==pH94

    -----END PGP SIGNATURE-----

    8.2 Uploading to a private archive

    If you want to create a personal packagearchive at URL=http://people.debian.org/~ account_nameas a developer with simple invocation of dupload -t target_name , you should add thefollowing to /etc/dupload.conf le:

    1See ftp://ftp-master.debian.org/pub/UploadQueue/README . Alternatively, you may use dcutcommand from the dput package.

    ftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/READMEftp://ftp-master.debian.org/pub/UploadQueue/READMEftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/ftp://ftp-master.debian.org/pub/UploadQueue/
  • 8/14/2019 Debian Maintainers Guide

    49/61

    Chapter 8. Uploading the package 43

    # Developer account$cfg{ target_name } = {

    fqdn => "people.debian.org",method => "scpb",incoming => "/home/ account_name /public_html/package/",# I do not need to announcedinstall_runs => 1,

    };$cfg{ target_name }{preupload}{changes} = "

    echo mkdir -p public_html/package | ssh people.debian.org 2>/dev/necho Package directory created!";

    $cfg{ target_name }{postupload}{changes} = "echo cd public_html/package ;dpkg-scanpackages . /dev/null >Packages || true ;dpkg-scansources . /dev/null >Sources || true ;gzip -c Packages >Packages.gz ;gzip -c Sources >Sources.gz | ssh people.debian.org 2>/dev/null ;echo Package archive created!";

    Here, the APT archive is built with a quick and dirty remote shell execution with SSH. Theoverride les required by dpkg-scanpackages and dpkg-scansources are given as /dev/null . This technique can be used by a non Debian Developer to host his packages on his

    personal web site. Alternatively you can use apt-ftparchive or other scripts to create anAPT archive.

  • 8/14/2019 Debian Maintainers Guide

    50/61

    Chapter 8. Uploading the package 44

  • 8/14/2019 Debian Maintainers Guide

    51/61

    45

    Chapter 9

    Updating the package

    9.1 New Debian revision

    Lets say that a bug report was led against your package, #54321, and it describes a problemthat you can solve. To create a new Debian revision of the package, you need to:

    Correct the problem in the package source, of course.

    Add a new revision at the top of the Debian changelog le, for example with dch -i ,

    or explicitly with dch -v - and then insert the commentsusing your preferred editor.

    Tip: how to easily get the date in required format? Use 822-date , or date -R .

    Include a short description of the bug and the solution in the changelog entry, followed by this: Closes: #54321. That way, the bug report will be automagically closed bythe archive maintenance software the moment your package gets accepted in the Debianarchive.

    Repeat what you did in Complete rebuild on page 33, Checking the package for errorson page 37, and Uploading the package on page 41. The difference is that this time, theoriginal source archive wont be included, as it hasnt been changed and it already existsin the Debian archive.

    9.2 New upstream release (basic)

    Now lets consider a different, slightly more complicated situation - a new upstream versionwas released, and of course you want it packaged. You need to do the following:

    Download the new sources and put the tarball (e.g. named gentoo-0.9.13.tar.gz )in the directory above the old source tree (e.g. ~/gentoo/ ).

  • 8/14/2019 Debian Maintainers Guide

    52/61

    Chapter 9. Updating the package 46

    Enter the old source directory, and run:

    uupdate -u gentoo-0.9.13.tar.gz

    Of course, replace this le name with the name of your programs new source archive.uupdate(1) will properly rename that tarball, try to apply all the changes from yourprevious .diff.gz le, and update the new debian/changelog le.

    Change directory to .. /gentoo-0.9.13 , the new package source tree, and repeatwhat you did in Complete rebuild on page 33, Checking the package for errors onpage 37, and Uploading the package on page 41.

    Note that if you set up a debian/watch le as described in watch.ex on page 30, you canrun uscan(1) to automagically look for revised sources, download them, and run uupdate .

    9.3 New upstream release (realistic)

    When preparing packages for the the Debian archive, you must check the resulting packagesin detail. Here is a more realistic example of this procedure.

    1 Verify changes in upstream source Read the upstream changelog , NEWS, and whatever other documentation they

    may have released with the new version. Do a diff -urN between the old and new upstream sources to try to get a feel for

    the scope of the changes, where work is actively being done (and thus where new bugs may appear), and also keep an eye out for anything suspicious.

    2 Port the old Debian packaging to the new version. Unpack the source tarball and rename the root of the source tree as

    -/ and cd into this directory. Copy the source tarball in the parent directory and renam


Recommended