| 1 |
osamu |
2666 |
<!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [ |
| 2 |
aph |
743 |
|
| 3 |
osamu |
2666 |
<!-- textual data entities --> |
| 4 |
|
|
<!-- first definition wins in SGML --> |
| 5 |
|
|
<!ENTITY % default SYSTEM "default.ent"> %default; |
| 6 |
|
|
|
| 7 |
|
|
]> |
| 8 |
osamu |
2685 |
<!-- CVS revision of this document "$Revision: 1.58 $" --> |
| 9 |
osamu |
2666 |
<!-- CVS revision of original english document "*.**" --> |
| 10 |
|
|
|
| 11 |
aph |
743 |
<debiandoc> |
| 12 |
|
|
|
| 13 |
|
|
<book> |
| 14 |
|
|
|
| 15 |
|
|
<titlepag> |
| 16 |
|
|
|
| 17 |
joy |
773 |
<title>Debian New Maintainers' Guide</title> |
| 18 |
aph |
743 |
|
| 19 |
joy |
2365 |
<author>Josip Rodin <email/joy-mg@debian.org/ |
| 20 |
aph |
743 |
</author> |
| 21 |
joy |
887 |
<!-- |
| 22 |
|
|
<author>Translated by: [put your name here] <email/[put your e-mail here]/ |
| 23 |
|
|
</author> |
| 24 |
|
|
--> |
| 25 |
aph |
743 |
|
| 26 |
joy |
1529 |
<version>version 1.2, 6 April 2002.</version> |
| 27 |
aph |
743 |
|
| 28 |
|
|
<copyright> |
| 29 |
joy |
1529 |
<copyrightsummary>Copyright © 1998-2002 Josip Rodin.</copyrightsummary> |
| 30 |
aph |
743 |
|
| 31 |
joy |
1566 |
<p>This document may be used under the terms the GNU General Public License |
| 32 |
joy |
893 |
version 2 or higher. |
| 33 |
aph |
743 |
|
| 34 |
joy |
893 |
<p>This document was made using with these two documents as examples: |
| 35 |
joy |
773 |
|
| 36 |
joy |
797 |
<p>Making a Debian Package (AKA the Debmake Manual), copyright © |
| 37 |
joy |
1552 |
1997 Jaldhar Vyas. |
| 38 |
joy |
797 |
|
| 39 |
aph |
743 |
<p>The New-Maintainer's Debian Packaging Howto, copyright © 1997 |
| 40 |
joy |
1552 |
Will Lowe. |
| 41 |
aph |
743 |
</copyright> |
| 42 |
|
|
|
| 43 |
|
|
</titlepag> |
| 44 |
|
|
|
| 45 |
|
|
<toc sect> |
| 46 |
|
|
|
| 47 |
joy |
1523 |
<chapt id="start">Getting started The Right Way |
| 48 |
aph |
743 |
|
| 49 |
joy |
1520 |
<p>This document tries to describe building of a Debian package to the |
| 50 |
|
|
common Debian user, and wannabe developer. It uses pretty common language, |
| 51 |
|
|
and it's well covered with working examples. |
| 52 |
|
|
There is an old Roman saying, <em>Longum |
| 53 |
aph |
743 |
iter est per preaecepta, breve et efficax per exempla!</em> (It's a long way |
| 54 |
|
|
by the rules, but short and efficient with examples!). |
| 55 |
|
|
|
| 56 |
|
|
<p>One of the things that makes Debian such a top-notch Linux distribution |
| 57 |
|
|
is its package system. While there is a vast quantity of software already |
| 58 |
|
|
in the Debian format, sometimes you need to install software that isn't. |
| 59 |
|
|
You may be wondering how you can make your own packages and perhaps you |
| 60 |
joy |
896 |
think it is a very difficult task. Well, if you are a real novice on Linux, |
| 61 |
joy |
770 |
it is hard, but if you were rookie, you wouldn't be reading this doc now. :-) |
| 62 |
aph |
743 |
You do need to know a little about Unix programming but you certainly |
| 63 |
|
|
don't need to be a wizard. |
| 64 |
|
|
|
| 65 |
joy |
1520 |
<p>One thing is certain, though: to properly create and maintain Debian |
| 66 |
|
|
packages you need man hours. Make no mistake, for our system to work the |
| 67 |
joy |
2396 |
maintainers need to be both technically competent and diligent. |
| 68 |
joy |
1520 |
|
| 69 |
joy |
1522 |
<p>This document will explain every little (at first maybe irrelevant) |
| 70 |
|
|
step, and help you create that first package, and to gain some experience |
| 71 |
|
|
in building next releases of that and maybe other packages later on. |
| 72 |
|
|
|
| 73 |
joy |
896 |
<p>Newer versions of this document should always be available online at |
| 74 |
joy |
1422 |
<url name="http://www.debian.org/doc/maint-guide/" id="http://www.debian.org/doc/maint-guide/"> |
| 75 |
joy |
1520 |
and in the `<package/maint-guide/' package. |
| 76 |
|
|
<!-- Translation in <this language> is also available in the |
| 77 |
|
|
`<package/maint-guide-xy/' package. --> |
| 78 |
joy |
896 |
|
| 79 |
aph |
743 |
<sect id="needprogs">Programs you need for development |
| 80 |
|
|
|
| 81 |
joy |
896 |
<p>Before you start anything, you should make sure that you have properly |
| 82 |
|
|
installed some additional packages needed for development. Note that the |
| 83 |
|
|
list doesn't contain any packages marked `essential' or `required' - we |
| 84 |
|
|
expect that you have those installed already. |
| 85 |
joy |
770 |
|
| 86 |
joy |
1520 |
<p>This revision of this document has been updated for the packages in |
| 87 |
|
|
Debian 2.2 (`potato') and 3.0 (`woody'). |
| 88 |
joy |
893 |
|
| 89 |
joy |
1520 |
<p>The following packages come with the standard Debian installation, |
| 90 |
|
|
so you probably have them already (along with any additional packages |
| 91 |
|
|
they depend on). |
| 92 |
joy |
896 |
Still, you should check with `dpkg -s <package>`. |
| 93 |
aph |
743 |
|
| 94 |
|
|
<list> |
| 95 |
joy |
1521 |
<item><package/dpkg-dev/ - this package contains the tools needed to unpack, |
| 96 |
joy |
896 |
build and upload Debian source packages. (see |
| 97 |
|
|
<manref name="dpkg-source" section="1">) |
| 98 |
aph |
743 |
|
| 99 |
joy |
1521 |
<item><package/file/ - this handy program can determine what type a file is. |
| 100 |
joy |
770 |
(see <manref name="file" section="1">) |
| 101 |
aph |
743 |
|
| 102 |
joy |
1521 |
<item><package/gcc/ - the GNU C compiler, necessary if your program like |
| 103 |
joy |
1520 |
most others is written in the C programming language. |
| 104 |
|
|
(see <manref name="gcc" section="1">) |
| 105 |
|
|
This package will also "pull in" several other packages such as |
| 106 |
joy |
1521 |
<package/binutils/ which includes programs used to assemble and link |
| 107 |
joy |
1520 |
object files (see `info binutils` in the <package/binutils-doc/ package) |
| 108 |
joy |
1521 |
and <package/cpp/, the C preprocessor. (see <manref name="cpp" section="1">) |
| 109 |
aph |
743 |
|
| 110 |
joy |
1521 |
<item><package/g++/ - the GNU C++ compiler, necessary if your program |
| 111 |
joy |
1520 |
is written in C++. (see <manref name="g++" section="1">) |
| 112 |
|
|
|
| 113 |
joy |
1521 |
<item><package/libc6-dev/ - the C libraries and header files gcc needs to |
| 114 |
joy |
1520 |
link with to create object files. (see `info libc` in the |
| 115 |
|
|
<package/glibc-doc/ package) |
| 116 |
aph |
743 |
|
| 117 |
joy |
1521 |
<item><package/make/ - usually creation of a program takes several steps, |
| 118 |
joy |
1520 |
so rather than having to type out the same commands over and over again, |
| 119 |
|
|
you can use this program to automate the process, creating `Makefile's. |
| 120 |
|
|
(see `info make`) |
| 121 |
aph |
743 |
|
| 122 |
joy |
2146 |
<item><package/patch/ - this very useful utility will take a file containing |
| 123 |
aph |
743 |
a difference listing (produced by the diff program) and apply it to the |
| 124 |
joy |
770 |
original file, producing a patched version. (see <manref name="patch" section="1">) |
| 125 |
aph |
743 |
|
| 126 |
joy |
1521 |
<item><package/perl/ - Perl is one of the most used interpreted scripting |
| 127 |
joy |
1520 |
languages on today's Unix-like systems, often referred to as "Unix's Swiss Army |
| 128 |
joy |
770 |
Chainsaw". (see <manref name="perl" section="1">) |
| 129 |
aph |
743 |
</list> |
| 130 |
|
|
|
| 131 |
joy |
1520 |
<p>You'll probably want to install the following packages, too: |
| 132 |
aph |
743 |
|
| 133 |
|
|
<list> |
| 134 |
joy |
1521 |
<item><package/autoconf/ and <package/automake/ - many newer programs use |
| 135 |
joy |
1520 |
configure scripts and Makefiles preprocessed with help of programs like |
| 136 |
|
|
these. (see `info autoconf`, `info automake`) |
| 137 |
|
|
|
| 138 |
joy |
1521 |
<item><package/dh-make/ and <package/debhelper/ - dh-make is necessary to |
| 139 |
joy |
2146 |
create the skeleton of our example package, and it will use some of the |
| 140 |
aph |
743 |
debhelper tools for creating packages. They are not essential for creation |
| 141 |
joy |
2366 |
of packages, but are <strong>highly</strong> recommended for new |
| 142 |
joy |
797 |
maintainers. It makes the whole process very much easier to start, and |
| 143 |
|
|
control afterwards. (see <manref name="dh_make" section="1">, |
| 144 |
joy |
838 |
<manref name="debhelper" section="1">, /usr/share/doc/debhelper/README) |
| 145 |
aph |
743 |
|
| 146 |
joy |
2146 |
<item><package/devscripts/ - this package contains some nice and useful |
| 147 |
joy |
773 |
scripts that can be helpful to the maintainers, but they are also not |
| 148 |
joy |
838 |
necessary for building packages. (see /usr/share/doc/devscripts/README.gz) |
| 149 |
joy |
773 |
|
| 150 |
joy |
1521 |
<item><package/fakeroot/ - this utility lets you emulate being root which |
| 151 |
joy |
838 |
is necessary for some parts of the build process. (see |
| 152 |
|
|
<manref name="fakeroot" section="1">) |
| 153 |
|
|
|
| 154 |
joy |
1521 |
<item><package/gnupg/ - a tool that enables you to digitally <em>sign</em> |
| 155 |
joy |
1520 |
packages. This is especially important if you want to distribute it to |
| 156 |
|
|
other people, and you will certainly be doing that when your work gets |
| 157 |
|
|
included in the Debian distribution. (see <manref name="gpg" section="1">) |
| 158 |
|
|
|
| 159 |
joy |
1521 |
<item><package/g77/ - the GNU Fortran 77 compiler, necessary if your |
| 160 |
joy |
1520 |
program is written in Fortran. (see <manref name="g77" section="1">) |
| 161 |
|
|
|
| 162 |
joy |
1521 |
<item><package/gpc/ - the GNU Pascal compiler, necessary if your |
| 163 |
|
|
program is written in Pascal. Worthy of note here is <package/fp-compiler/, |
| 164 |
joy |
1520 |
the Free Pascal Compiler, which is also good at this task. |
| 165 |
|
|
(see <manref name="gpc" section="1">, <manref name="ppc386" section="1">) |
| 166 |
|
|
|
| 167 |
osamu |
2665 |
<item><package/xutils/ - some programs, usually those |
| 168 |
joy |
1520 |
made for X11, also use these programs to generate Makefiles from sets of |
| 169 |
|
|
macro functions. (see <manref name="imake" section="1">, |
| 170 |
|
|
<manref name="xmkmf" section="1">) |
| 171 |
|
|
|
| 172 |
joy |
1521 |
<item><package/lintian/ - this is the Debian package checker that can let |
| 173 |
joy |
893 |
you know of any common mistakes after you build the package, and explain |
| 174 |
|
|
the errors found. (see <manref name="lintian" section="1">, |
| 175 |
joy |
838 |
/usr/share/doc/lintian/lintian.html/index.html) |
| 176 |
osamu |
2669 |
|
| 177 |
|
|
<item><package/linda/ - this is the alternative Debian package checker. |
| 178 |
|
|
(see <manref name="linda" section="1">) |
| 179 |
|
|
|
| 180 |
|
|
<item><package/pbuilder/ - this package contains programs which is used |
| 181 |
|
|
for creating and maintaining chroot environment. Building Debian |
| 182 |
|
|
package in this chroot environment verifies the proper build dependency |
| 183 |
|
|
and avoid FTBFS bugs. (see <manref name="pbuilder" section="8"> and |
| 184 |
|
|
<manref name="pdebuild" section="1">) |
| 185 |
aph |
743 |
</list> |
| 186 |
|
|
|
| 187 |
joy |
1520 |
<p>The following is the <em>very important</em> documentation which you |
| 188 |
|
|
should read along with this document: |
| 189 |
aph |
743 |
|
| 190 |
|
|
<list> |
| 191 |
joy |
1521 |
<item><package/debian-policy/ - the Policy includes explanations of the |
| 192 |
joy |
1520 |
structure and contents of the Debian archive, several OS design issues, |
| 193 |
|
|
the Filesystem Hierarchy Standard (which says where each file and |
| 194 |
|
|
directory should be) etc. |
| 195 |
|
|
For you, the most important thing is that it describes requirements that |
| 196 |
joy |
838 |
each package must satisfy to be included in the distribution. |
| 197 |
osamu |
2666 |
(see &debian-policy;) |
| 198 |
aph |
743 |
|
| 199 |
joy |
1521 |
<item><package/developers-reference/ - for all matters not specifically |
| 200 |
aph |
743 |
about the technical details of packaging, like the structure of the |
| 201 |
|
|
archive, how to rename, orphan, pick up packages, how to do NMUs, how to |
| 202 |
|
|
manage bugs, when and where to upload etc. |
| 203 |
osamu |
2669 |
(see &developers-reference;) |
| 204 |
aph |
743 |
</list> |
| 205 |
|
|
|
| 206 |
|
|
<p>The short descriptions that are given above only serve to introduce |
| 207 |
|
|
you to what each package does. Before continuing please thoroughly read |
| 208 |
joy |
1520 |
the documentation of each program, at least the standard usage. |
| 209 |
joy |
770 |
It may seem like heavy going now, but later on you'll be <em>very</em> |
| 210 |
|
|
glad you read it. |
| 211 |
aph |
743 |
|
| 212 |
joy |
1521 |
<p>Note: <package/debmake/ is a package that contains some programs that |
| 213 |
joy |
896 |
function similar to dh-make, but its specific use is <strong>not</strong> |
| 214 |
joy |
1520 |
covered in this document, because it is <em>deprecated</em>. Please refer |
| 215 |
|
|
to <url name="the Debmake manual" id="http://www.debian.org/~jaldhar/"> |
| 216 |
|
|
for more information. |
| 217 |
joy |
838 |
|
| 218 |
joy |
770 |
<sect id="otherinfo">Other information |
| 219 |
aph |
743 |
|
| 220 |
|
|
<p>There are two types of packages you can make, source and binary. |
| 221 |
|
|
A source package contains code which you can compile into a program. |
| 222 |
|
|
A binary package contains just the finished program. Don't mix terms |
| 223 |
|
|
like source of the program and the source package of the program! |
| 224 |
|
|
Please read the other manuals if you need more details on terminology. |
| 225 |
|
|
|
| 226 |
joy |
896 |
<p>In Debian, the term `maintainer' is used for the person who makes |
| 227 |
|
|
packages, `upstream author' for the person that made the program, and |
| 228 |
|
|
`upstream maintainer' for the person who currently maintains that program, |
| 229 |
|
|
outside of Debian. Usually author and the upstream maintainer are the |
| 230 |
|
|
same person - and sometimes even the maintainer is the same person. |
| 231 |
|
|
If you made a program, and want it to get in Debian, feel free to submit |
| 232 |
|
|
your application to become a maintainer. |
| 233 |
aph |
743 |
|
| 234 |
|
|
<p>After you build your package (or while doing that), you will have |
| 235 |
|
|
to become an official Debian maintainer if you wish your program to get |
| 236 |
|
|
into the next distribution (if the program is useful, why not?). |
| 237 |
joy |
770 |
That process is explained in Developer's Reference. Please read it. |
| 238 |
aph |
743 |
|
| 239 |
|
|
<chapt id="first">First steps |
| 240 |
|
|
|
| 241 |
joy |
1522 |
<sect id="choose">Choose your program |
| 242 |
aph |
743 |
|
| 243 |
joy |
1531 |
<p>You have probably chosen the package you want to create. The first |
| 244 |
|
|
thing you need to do is check if the package is in the distribution already. |
| 245 |
|
|
If you use the `stable' distribution, maybe it's best that you go to the |
| 246 |
joy |
1523 |
<url name="package search page" id="http://www.debian.org/distrib/packages">. |
| 247 |
joy |
896 |
If you use <strong>current</strong> `unstable' distribution, check it out |
| 248 |
joy |
838 |
with these commands: |
| 249 |
aph |
743 |
<example> |
| 250 |
|
|
dpkg -s program |
| 251 |
|
|
dpkg -l '*program*' |
| 252 |
|
|
</example> |
| 253 |
|
|
|
| 254 |
joy |
1531 |
<p>If the package already exists, well, install it! :-) If it happens to |
| 255 |
|
|
be orphaned -- if its maintainer is set to "Debian QA Group", you should |
| 256 |
|
|
be able to pick it up. Consult |
| 257 |
|
|
<url name="the list of orphaned packages" id="http://www.debian.org/devel/wnpp/orphaned"> |
| 258 |
|
|
and |
| 259 |
|
|
<url name="the list of packages up for adoption" id="http://www.debian.org/devel/wnpp/rfa_bypackage"> |
| 260 |
|
|
to verify that the package is indeed up for grabs. |
| 261 |
|
|
|
| 262 |
|
|
<p>If you are able to adopt the package, get the sources (with something |
| 263 |
|
|
like <tt/apt-get source packagename/) and examine them. This document |
| 264 |
|
|
unfortunately doesn't include comprehensive information about adopting |
| 265 |
|
|
packages. Thankfully you shouldn't have a hard time figuring out how the |
| 266 |
|
|
package works since someone has already done the initial set up for you. |
| 267 |
|
|
Keep reading, though, a lot of the advice below will still be applicable |
| 268 |
|
|
for your case. |
| 269 |
|
|
|
| 270 |
|
|
<p>If the package is new, and you decide you'd like to see it in Debian, |
| 271 |
|
|
proceed as follows: |
| 272 |
|
|
|
| 273 |
|
|
<list> |
| 274 |
|
|
<item>check if no one else is working on the package already at |
| 275 |
|
|
<url name="the list of packages being worked on" id="http://www.de.debian.org/devel/wnpp/being_packaged">. |
| 276 |
|
|
If someone's already on it, contact them if you feel you need to. |
| 277 |
|
|
If not - find another interesting program that nobody maintains. |
| 278 |
joy |
838 |
</item> |
| 279 |
aph |
743 |
|
| 280 |
joy |
797 |
<item>program <strong>must</strong> have a license, if possible free as |
| 281 |
joy |
1523 |
according to the <url name="Debian Free Software Guidelines" id="http://www.debian.org/social_contract#guidelines">. |
| 282 |
|
|
If it doesn't conform to some of these rules but it can be distributed |
| 283 |
|
|
anyway, it could still can be included in the `contrib' or `non-free' |
| 284 |
joy |
2366 |
sections. If you are unsure about where it should go, post the license |
| 285 |
joy |
1523 |
text on <email/debian-legal@lists.debian.org/ and ask for advice. |
| 286 |
aph |
743 |
</item> |
| 287 |
|
|
|
| 288 |
joy |
797 |
<item>program certainly should <strong>not</strong> run setuid root, or |
| 289 |
|
|
even better - it shouldn't need to be setuid or setgid to anything.</item> |
| 290 |
aph |
743 |
|
| 291 |
joy |
770 |
<item>program should not be a daemon, or something that goes in */sbin |
| 292 |
joy |
1523 |
directories, or open a port as root.</item> |
| 293 |
aph |
743 |
|
| 294 |
joy |
1523 |
<item>program should result in binary executable form, libraries are |
| 295 |
|
|
harder to handle.</item> |
| 296 |
aph |
743 |
|
| 297 |
joy |
1523 |
<item>it should be well documented, or and the code needs to be |
| 298 |
|
|
understandable (i.e. not obfuscated).</item> |
| 299 |
aph |
743 |
|
| 300 |
joy |
770 |
<item>you should contact program's author(s) to check if they agree |
| 301 |
|
|
with packaging it. It is important to be able to consult with author(s) |
| 302 |
|
|
about the program in case of any program specific problems, so don't |
| 303 |
|
|
try to package unmaintained pieces of software.</item> |
| 304 |
|
|
|
| 305 |
aph |
743 |
<item>and last but not the least, you must know that it works, and |
| 306 |
|
|
have it tried for some time.</item> |
| 307 |
|
|
</list> |
| 308 |
|
|
|
| 309 |
|
|
<p>Of course, these things are just safety measures, and intended to save |
| 310 |
joy |
896 |
you from raging users if you do something wrong in some setuid daemon... |
| 311 |
aph |
743 |
When you gain some more experience in packaging, you'll be able to do such |
| 312 |
joy |
1523 |
packages, but even the experienced developers consult the debian-mentors |
| 313 |
aph |
743 |
mailing list when they are in doubt. And people there will gladly help. |
| 314 |
|
|
|
| 315 |
joy |
770 |
<p>For more help about these, check in Developer's Reference. |
| 316 |
|
|
|
| 317 |
joy |
1522 |
<sect id="getit">Get the program, and try it out |
| 318 |
aph |
743 |
|
| 319 |
|
|
<p>So the first thing to do is to find and download the original package. |
| 320 |
|
|
I presume that you already have the source file that you picked up at |
| 321 |
joy |
1523 |
the author's homepage. Sources for free Unix programs usually come in |
| 322 |
joy |
893 |
tar/gzip format, with extension .tar.gz, and usually contain the |
| 323 |
|
|
subdirectory called program-version and all the sources in it. If your |
| 324 |
|
|
program's source comes as some other sort of archive (for instance, the |
| 325 |
joy |
896 |
filename ends in ".Z" or ".zip"), unpack it with appropriate |
| 326 |
joy |
1523 |
tools, or ask on the debian-mentors mailing list if you're not sure how to unpack it |
| 327 |
joy |
893 |
correctly (hint: issue `file archive.extension`). |
| 328 |
aph |
743 |
|
| 329 |
joy |
2366 |
<p>As an example, I'll use a program called `gentoo', an X GTK+ file |
| 330 |
joy |
838 |
manager. Note that the program is already packaged, and has changed |
| 331 |
|
|
substantially from the version while this text was first written. |
| 332 |
aph |
743 |
|
| 333 |
joy |
896 |
<p>Create a subdirectory under your home directory named 'debian' or 'deb' |
| 334 |
|
|
or anything you find appropriate (e.g. just ~/gentoo/ would do fine in |
| 335 |
|
|
this case). Place the downloaded archive in it, and uncompress it (with |
| 336 |
|
|
`tar xzf gentoo-0.9.12.tar.gz`). Make sure there are no errors, even some |
| 337 |
|
|
"irrelevant" ones, because there will most probably be problems unpacking |
| 338 |
|
|
on other people's systems, whose unpacking tools may or may not ignore |
| 339 |
|
|
those anomalies. |
| 340 |
aph |
743 |
|
| 341 |
joy |
893 |
<p>Now you have another subdirectory, called 'gentoo-0.9.12'. Change to |
| 342 |
|
|
that directory and <strong>thoroughly</strong> read the provided |
| 343 |
|
|
documentation. Usually there exist files named README*, INSTALL*, *.lsm |
| 344 |
|
|
or *.html. You must find instructions on how to correctly compile and |
| 345 |
|
|
install the program (most probably they'll assume you want to install to |
| 346 |
joy |
896 |
/usr/local/bin directory; you won't be doing that, but more on that later |
| 347 |
|
|
in <ref id="destdir">). |
| 348 |
aph |
743 |
|
| 349 |
|
|
<p>The process varies from program to program, but a lot of modern |
| 350 |
joy |
770 |
programs come with a `configure' script that configures the source under |
| 351 |
aph |
743 |
your system and makes sure that your system is in condition to compile it. |
| 352 |
joy |
1523 |
After configuring with `./configure`, programs are usually compiled |
| 353 |
joy |
896 |
with `make`. Some of them support `make check`, to run included |
| 354 |
|
|
self-checks. Installation in destination directories is usually done with |
| 355 |
joy |
770 |
`make install`. |
| 356 |
aph |
743 |
|
| 357 |
joy |
1198 |
<p>Now try to compile and run your program, to make sure it works properly |
| 358 |
aph |
743 |
and doesn't break something else while it's installing or running. |
| 359 |
|
|
|
| 360 |
joy |
1523 |
<p>Also, you can usually run `make clean` (or better `make distclean`) to |
| 361 |
|
|
clean up the build directory. Sometimes there's even a `make uninstall` |
| 362 |
|
|
which can be used to remove all the installed files. |
| 363 |
aph |
743 |
|
| 364 |
joy |
1523 |
<sect id="namever">Package name and version |
| 365 |
aph |
743 |
|
| 366 |
joy |
896 |
<p>You should start packaging with a completely clean (pristine) source |
| 367 |
|
|
directory, or simply with freshly unpacked sources. |
| 368 |
|
|
|
| 369 |
|
|
<p>For the package to be built correctly, you must make the program's |
| 370 |
|
|
original name lowercase (if it isn't already), and you should move the |
| 371 |
|
|
source directory to <packagename>-<version>. |
| 372 |
|
|
|
| 373 |
|
|
<p>If the program name consists of more than one word, contract them to one |
| 374 |
|
|
word, or make an abbreviation. For example, program "John's little editor |
| 375 |
|
|
for X" package would be named johnledx, or jle4x, or whatever you decide, |
| 376 |
|
|
as long as it's under some reasonable limit, e.g. 20 characters. |
| 377 |
|
|
|
| 378 |
joy |
887 |
<p>Also check for the exact version of the program (to be included in the |
| 379 |
|
|
package version). If that piece of software is not numbered with versions |
| 380 |
|
|
like X.Y.Z, but with some kind of date, feel free to use that date as the |
| 381 |
|
|
version number, prepended with a "0.0." (just in case upstream people one |
| 382 |
|
|
day decide to release a nice version like 1.0). So, if the release or |
| 383 |
|
|
snapshot date was 19th of December, 1998, you can use the version string |
| 384 |
joy |
1523 |
of 0.0.19981219. |
| 385 |
|
|
|
| 386 |
|
|
<p>Some programs won't be numbered at all, in which case you |
| 387 |
joy |
887 |
should contact the upstream maintainer to see if they've got some other |
| 388 |
|
|
revision-tracking method. |
| 389 |
aph |
743 |
|
| 390 |
joy |
1523 |
<sect id="dh_make">Initial "debianization" |
| 391 |
aph |
743 |
|
| 392 |
joy |
770 |
<p>Make sure you're in the program source directory, and issue this: |
| 393 |
aph |
743 |
|
| 394 |
joy |
770 |
<p><example> |
| 395 |
joy |
952 |
dh_make -e your.maintainer@address -f ../gentoo-0.9.12.tar.gz |
| 396 |
joy |
770 |
</example> |
| 397 |
joy |
838 |
|
| 398 |
|
|
<p>Of course, replace the string "your.maintainer@address" with your |
| 399 |
joy |
893 |
e-mail address for inclusion in the changelog entry and other files, |
| 400 |
|
|
and the filename with the name of your original source archive. See |
| 401 |
|
|
<manref name="dh_make" section="1"> for details. |
| 402 |
joy |
838 |
|
| 403 |
joy |
770 |
<p>Some information will come up. It will ask you what sort of package you |
| 404 |
|
|
want to create. Gentoo is a single binary package - it creates only one |
| 405 |
|
|
binary, and thus one .deb file - so we will select the first option, with |
| 406 |
joy |
896 |
the `s' key, check the information on the screen and confirm with pressing |
| 407 |
joy |
1523 |
<enter>. |
| 408 |
|
|
|
| 409 |
|
|
<p>Once again, as a new maintainer you are discouraged from creating |
| 410 |
|
|
packages with multiple binary packages, or libraries. It's not too hard, |
| 411 |
|
|
but it does require a bit more knowledge, |
| 412 |
joy |
896 |
so we won't describe all of it here. |
| 413 |
joy |
770 |
|
| 414 |
joy |
797 |
<p>Please note that you should run dh_make <strong>only once</strong>, |
| 415 |
|
|
and that it won't behave correctly if you run it again in the same, |
| 416 |
|
|
already "debianized", directory. That also means that you will use a |
| 417 |
|
|
different method to release a new revision or a new version of your |
| 418 |
joy |
896 |
package in the future. Read more about that later in <ref id="update"> |
| 419 |
joy |
797 |
|
| 420 |
aph |
743 |
<chapt id="modify">Modifying the source |
| 421 |
|
|
|
| 422 |
joy |
893 |
<p>Normally, programs install themselves in the /usr/local subdirectories. |
| 423 |
aph |
743 |
But, Debian packages must not use that directory, since it is reserved for |
| 424 |
joy |
893 |
system administrator's (or user's) private use. This means that you have |
| 425 |
|
|
to take a look at your program's build system, usually starting with the |
| 426 |
|
|
Makefile. This is the script <manref name="make" section="1"> will use to |
| 427 |
|
|
automate building this program. For more details on Makefiles, look in |
| 428 |
|
|
<ref id="rules">. |
| 429 |
aph |
743 |
|
| 430 |
joy |
903 |
<p>Note that if your program uses GNU <manref name="automake" section="1"> |
| 431 |
|
|
and/or <manref name="autoconf" section="1">, meaning the source includes |
| 432 |
|
|
Makefile.am and/or Makefile.in files, respectively, you will need to |
| 433 |
joy |
1198 |
modify those files. This is because each automake invocation will rewrite |
| 434 |
joy |
903 |
Makefile.in's with information generated from Makefile.am's, and each |
| 435 |
|
|
./configure invocation will do the same with Makefile's, with data from |
| 436 |
|
|
Makefile.in's. Editing Makefile.am files requires some knowledge of |
| 437 |
joy |
1198 |
automake, which you can read about in the automake info entry, whereas editing |
| 438 |
joy |
903 |
Makefile.in files is pretty much the same as editing Makefile files, just |
| 439 |
|
|
pay attention on the variables, i.e. any strings surrounded with `@'s, for |
| 440 |
|
|
example @CFLAGS@ or @LN_S@, which are replaced with actual stuff on each |
| 441 |
|
|
./configure invocation. |
| 442 |
aph |
743 |
|
| 443 |
joy |
903 |
<p>Also note that there isn't space here to go into <em>all</em> the |
| 444 |
joy |
1198 |
details of fixing upstream sources, but here are a few problems people |
| 445 |
|
|
often run across. |
| 446 |
joy |
903 |
|
| 447 |
joy |
838 |
<sect id="destdir">Installation in a subdirectory |
| 448 |
aph |
743 |
|
| 449 |
joy |
838 |
<p>Most of the programs have some way of installing themselves in the |
| 450 |
|
|
existing directory structure of your system, so that their binaries get |
| 451 |
|
|
included in your $PATH, and that you find their documentation and manual |
| 452 |
joy |
1523 |
pages in common places. However, if you do that, the program will be |
| 453 |
|
|
installed among everything else already on your system. This would make |
| 454 |
|
|
it hard for the packaging tools to figure out which files belong to your |
| 455 |
|
|
package and which don't. |
| 456 |
|
|
|
| 457 |
|
|
<p>Therefore you need to do something else: install the program into a |
| 458 |
|
|
temporary subdirectory from which the maintainer tools will build a working |
| 459 |
joy |
838 |
.deb package. Everything that is contained in this directory will be |
| 460 |
joy |
2366 |
installed on a user's system when they install your package, the only |
| 461 |
joy |
838 |
difference is that dpkg will be installing the files in the root |
| 462 |
|
|
directory. |
| 463 |
|
|
|
| 464 |
joy |
1523 |
<p>This temporary directory is usually created under your debian/ |
| 465 |
|
|
directory in the unpacked source tree. It is usually called |
| 466 |
|
|
<file>debian/tmp</file> or <file>debian/packagename</file>. |
| 467 |
|
|
|
| 468 |
|
|
<p>Bear in mind that even though you need to make the program install in |
| 469 |
joy |
1526 |
debian/packagename, it still needs to behave correctly when placed in the |
| 470 |
|
|
root directory, i.e. when installed from the .deb package. So you mustn't |
| 471 |
joy |
1523 |
allow the build system to hardcode strings like |
| 472 |
|
|
<tt>/home/me/deb/gentoo-0.9.12/usr/share/gentoo</tt> into the package |
| 473 |
|
|
files. |
| 474 |
|
|
|
| 475 |
|
|
<p>With programs that use GNU autoconf, this will be quite easy. Most such |
| 476 |
|
|
programs have makefiles that are by default set up to allow installation |
| 477 |
|
|
into a random subdirectory while keeping in mind that /usr (for example) |
| 478 |
|
|
is the canonical prefix. When it detects your program uses autoconf, |
| 479 |
|
|
dh_make will set up commands for doing all this |
| 480 |
joy |
838 |
automatically, so you might as well skip reading this section. But with |
| 481 |
|
|
other programs, you will most probably have to examine and edit the |
| 482 |
|
|
Makefiles. |
| 483 |
|
|
|
| 484 |
|
|
<p>Here's the relevant part of gentoo's Makefile: |
| 485 |
|
|
|
| 486 |
aph |
743 |
<p><example> |
| 487 |
|
|
# Where to put binary on 'make install'? |
| 488 |
|
|
BIN = /usr/local/bin |
| 489 |
joy |
1523 |
|
| 490 |
|
|
# Where to put icons on 'make install'? |
| 491 |
|
|
ICONS = /usr/local/share/gentoo |
| 492 |
aph |
743 |
</example> |
| 493 |
|
|
|
| 494 |
joy |
1523 |
<p>We see that the files are set to install under <file>/usr/local</file>. |
| 495 |
|
|
Change those paths to: |
| 496 |
aph |
743 |
|
| 497 |
|
|
<p><example> |
| 498 |
joy |
1523 |
# Where to put binary on 'make install'? |
| 499 |
|
|
BIN = $(DESTDIR)/usr/bin |
| 500 |
aph |
743 |
|
| 501 |
joy |
1523 |
# Where to put icons on 'make install'? |
| 502 |
|
|
ICONS = $(DESTDIR)/usr/share/gentoo |
| 503 |
aph |
743 |
</example> |
| 504 |
|
|
|
| 505 |
joy |
1523 |
<p>But why in that directory, and not some other? Because Debian packages |
| 506 |
|
|
never install files beneath <file>/usr/local</file> -- that tree is |
| 507 |
|
|
reserved for the system administrator's use. Such files on Debian |
| 508 |
|
|
systems go under <file>/usr</file> instead. |
| 509 |
aph |
743 |
|
| 510 |
joy |
1523 |
<p>The more exact locations for binaries, icons, documentation etc are |
| 511 |
|
|
specified in the Filesystem Hierarchy Standard |
| 512 |
|
|
(see /usr/share/doc/debian-policy/fhs/). I recommend you browse it and read |
| 513 |
|
|
the sections that might concern your package. |
| 514 |
aph |
743 |
|
| 515 |
joy |
1523 |
<p>So, we should install the binary in /usr/bin instead of /usr/local/bin, |
| 516 |
|
|
the manual page in /usr/share/man/man1 instead of /usr/local/man/man1 etc. |
| 517 |
|
|
Notice how there's no manual page mentioned in gentoo's makefile, but |
| 518 |
|
|
since the Debian Policy requires that every program has one, we'll make |
| 519 |
|
|
one later and install it in /usr/share/man/man1. |
| 520 |
|
|
|
| 521 |
|
|
<p>Some programs don't use makefile variables to define paths such as |
| 522 |
|
|
these. This means you might have to edit some real C sources in order to |
| 523 |
|
|
fix them to use the right locations. |
| 524 |
joy |
2366 |
But where to search, and exactly what for? You can find this out by issuing: |
| 525 |
joy |
1523 |
|
| 526 |
joy |
770 |
<p><example> |
| 527 |
joy |
1523 |
grep -rn usr/local/lib *.[ch] |
| 528 |
joy |
770 |
</example> |
| 529 |
joy |
1523 |
|
| 530 |
|
|
<p>Grep will run recursively through the source tree and tell |
| 531 |
joy |
1199 |
you the name of the file and the line in it, when it finds an occurrence. |
| 532 |
aph |
743 |
|
| 533 |
joy |
1523 |
<p>Edit those files and in those lines replace /usr/local/* with usr/* |
| 534 |
|
|
-- and that's about it. Be careful that you don't mess up the rest of |
| 535 |
|
|
the code! :-) |
| 536 |
|
|
|
| 537 |
joy |
896 |
<p>After that you should find the install target (search for line that |
| 538 |
joy |
1523 |
starts with `install:', that will usually work) and rename all references |
| 539 |
|
|
to directories other than ones defined at the top of the Makefile. |
| 540 |
|
|
Previously, gentoo's install target said: |
| 541 |
aph |
743 |
|
| 542 |
|
|
<p><example> |
| 543 |
joy |
887 |
install: gentoo |
| 544 |
aph |
743 |
install ./gentoo $(BIN) |
| 545 |
joy |
1523 |
install icons/* $(ICONS) |
| 546 |
aph |
743 |
install gentoorc-example $(HOME)/.gentoorc |
| 547 |
|
|
</example> |
| 548 |
|
|
|
| 549 |
joy |
770 |
<p>After our change it says: |
| 550 |
aph |
743 |
<example> |
| 551 |
|
|
install: gentoo-target |
| 552 |
|
|
install -d $(BIN) $(ICONS) $(DESTDIR)/etc |
| 553 |
|
|
install ./gentoo $(BIN) |
| 554 |
|
|
install -m644 icons/* $(ICONS) |
| 555 |
|
|
install -m644 gentoorc-example $(DESTDIR)/etc/gentoorc |
| 556 |
joy |
1523 |
</example> |
| 557 |
|
|
|
| 558 |
|
|
<p>You've surely noticed that there's now a <tt>install -d</tt> command |
| 559 |
|
|
before the other commands in the rule. The original makefile didn't have |
| 560 |
|
|
it because usually the /usr/local/bin and other directories already exist |
| 561 |
|
|
on the system where one runs `make install`. However, since we will |
| 562 |
|
|
install into our own empty (or even nonexistent) directory, we will have |
| 563 |
|
|
to create each and every one of those directories. |
| 564 |
|
|
|
| 565 |
|
|
<p>We can also add in other things at the end of the rule, like the |
| 566 |
|
|
installation of additional documentation that the upstream authors |
| 567 |
|
|
sometimes omit: |
| 568 |
|
|
|
| 569 |
|
|
<p><example> |
| 570 |
joy |
838 |
install -d $(DESTDIR)/usr/share/doc/gentoo/html |
| 571 |
|
|
cp -a docs/* $(DESTDIR)/usr/share/doc/gentoo/html |
| 572 |
aph |
743 |
</example> |
| 573 |
|
|
|
| 574 |
joy |
896 |
<p>A careful reader will notice that I changed `gentoo' to `gentoo-target' |
| 575 |
joy |
1523 |
in the `install:' line. That is called an unrelated bug fix :-) |
| 576 |
aph |
743 |
|
| 577 |
|
|
<p>Whenever you make changes that are not specifically related to Debian |
| 578 |
|
|
package, be sure to send them to the upstream maintainer so they can be |
| 579 |
joy |
1523 |
included in the next program revision and be useful to everyone else. |
| 580 |
|
|
Also remember to make your fixes not specific to Debian or Linux (or even |
| 581 |
|
|
Unix!) prior to sending them -- make them portable. This will make your |
| 582 |
|
|
fixes much easier to apply. |
| 583 |
aph |
743 |
|
| 584 |
joy |
1523 |
<p>Note that you don't have to send the debian/* files upstream. |
| 585 |
|
|
|
| 586 |
joy |
896 |
<sect id="difflibs">Differing libraries |
| 587 |
aph |
743 |
|
| 588 |
|
|
<p>There is one other common problem: libraries are often different from |
| 589 |
joy |
2366 |
platform to platform. For example, a Makefile can contain a reference to a |
| 590 |
joy |
1523 |
library which doesn't exist on Debian systems. In that case, we |
| 591 |
joy |
893 |
need to change it to a library which does exist in Debian, and serves the |
| 592 |
joy |
1523 |
same purpose. |
| 593 |
aph |
743 |
|
| 594 |
joy |
903 |
<p>So, if there is a line in your program's Makefile (or Makefile.in) that |
| 595 |
|
|
says something like this (and your program doesn't compile): |
| 596 |
aph |
743 |
|
| 597 |
|
|
<p><example> |
| 598 |
joy |
770 |
LIBS = -lcurses -lsomething -lsomethingelse |
| 599 |
aph |
743 |
</example> |
| 600 |
|
|
|
| 601 |
|
|
<p>Change it to this, and it will most probably work: |
| 602 |
|
|
<p><example> |
| 603 |
joy |
770 |
LIBS = -lncurses -lsomething -lsomethingelse |
| 604 |
aph |
743 |
</example> |
| 605 |
|
|
|
| 606 |
joy |
1523 |
<p>(The author realizes that this is not the best example considering our |
| 607 |
|
|
libncurses package now ships with a libcurses.so symlink, but he couldn't |
| 608 |
|
|
think of a better one. Suggestions very welcome :-) |
| 609 |
|
|
|
| 610 |
joy |
896 |
<chapt id="dreq">Required stuff under debian/ |
| 611 |
aph |
743 |
|
| 612 |
joy |
1525 |
<p>There is a new subdirectory under the program's source directory, |
| 613 |
|
|
it's called `debian'. There are a number of files in this directory that |
| 614 |
|
|
we should edit in order to customize |
| 615 |
joy |
893 |
the behavior of the package. The most important of them are `control', |
| 616 |
|
|
`changelog', `copyright' and 'rules', which are required for all packages. |
| 617 |
aph |
743 |
|
| 618 |
joy |
893 |
<sect id="control">`control' file |
| 619 |
aph |
743 |
|
| 620 |
joy |
1525 |
<p>This file contains various values which <prgn/dpkg/, <prgn/dselect/ and |
| 621 |
|
|
other package management tools will use to manage the package. |
| 622 |
aph |
743 |
|
| 623 |
joy |
2366 |
<p>Here is the control file dh_make created for us: |
| 624 |
joy |
1525 |
|
| 625 |
joy |
893 |
<p><example> |
| 626 |
|
|
1 Source: gentoo |
| 627 |
joy |
838 |
2 Section: unknown |
| 628 |
|
|
3 Priority: optional |
| 629 |
joy |
2365 |
4 Maintainer: Josip Rodin <joy-mg@debian.org> |
| 630 |
joy |
1525 |
5 Build-Depends: debhelper (>> 3.0.0) |
| 631 |
|
|
6 Standards-Version: 3.5.2 |
| 632 |
|
|
7 |
| 633 |
|
|
8 Package: gentoo |
| 634 |
|
|
9 Architecture: any |
| 635 |
|
|
10 Depends: ${shlibs:Depends} |
| 636 |
|
|
11 Description: <insert up to 60 chars description> |
| 637 |
|
|
12 <insert long description, indented with spaces> |
| 638 |
aph |
743 |
</example> |
| 639 |
|
|
(I've added the line numbers.) |
| 640 |
|
|
|
| 641 |
joy |
1525 |
<p>Lines 1-6 are the control information for the source package. |
| 642 |
aph |
743 |
|
| 643 |
joy |
1525 |
<p>Line 1 is the name of the source package. |
| 644 |
|
|
|
| 645 |
|
|
<p>Line 2 is the section of the distribution the source package goes into. |
| 646 |
|
|
|
| 647 |
|
|
<p>As you may have noticed, Debian is divided in sections: main (the free |
| 648 |
joy |
797 |
software), non-free (the not really free software) and contrib (free |
| 649 |
|
|
software that depends on non-free software). Under those, there are |
| 650 |
|
|
logical subsections that describe in short what packages are in. |
| 651 |
joy |
896 |
So we have `admin' for administrator-only programs, `base' for the |
| 652 |
|
|
basic tools, `devel' for programmer tools, `doc' for documentation, |
| 653 |
|
|
`libs' for libraries, `mail' for e-mail readers and daemons, `net' for |
| 654 |
joy |
1525 |
network apps and daemons, `x11' for X11 programs that don't fit anywhere |
| 655 |
|
|
else, and many more. |
| 656 |
aph |
743 |
|
| 657 |
joy |
1525 |
<p>Let's change it then to x11. (A "main/" prefix is implied so we can |
| 658 |
|
|
omit it.) |
| 659 |
joy |
797 |
|
| 660 |
joy |
1525 |
<p>Line 3 describes how important it is that the user installs this package. |
| 661 |
|
|
See the Policy manual for guidance on what to set this field to. The |
| 662 |
|
|
"optional" priority will usually work for new packages. |
| 663 |
|
|
|
| 664 |
|
|
<p>Section and priority are used by frontends like <prgn/dselect/ when |
| 665 |
|
|
they sort packages and select defaults. Once you upload the package to |
| 666 |
|
|
Debian, the value of these two fields can be overridden by the archive |
| 667 |
|
|
maintainers, in which case you will be notified by email. |
| 668 |
joy |
797 |
|
| 669 |
joy |
1525 |
<p>As this is a normal priority package and doesn't conflict with anything |
| 670 |
|
|
else, we'll leave it as "optional". |
| 671 |
aph |
743 |
|
| 672 |
joy |
1525 |
<p>Line 4 is the name and email address of the maintainer. Make sure that |
| 673 |
|
|
this field includes a valid "To: " header for an email, because after you |
| 674 |
|
|
upload it, the bug tracking system will use it to deliver bug emails to |
| 675 |
|
|
you. Avoid using commas, ampersands and parenthesis. |
| 676 |
aph |
743 |
|
| 677 |
joy |
1555 |
<p>The 5th line includes the list of packages required to build your |
| 678 |
joy |
1525 |
package. Some packages like gcc and make are implied, see the |
| 679 |
|
|
<package/build-essential/ package for details. If some non-standard |
| 680 |
|
|
compiler or other tool is needed to build your package, you should add |
| 681 |
|
|
it to the `Build-Depends' line. Multiple entries are separated with |
| 682 |
|
|
commas; read on for the explanation of binary dependencies to find out |
| 683 |
|
|
more about the syntax of this field. |
| 684 |
joy |
896 |
|
| 685 |
joy |
1525 |
<p>You can also have Build-Depends-Indep, Build-Conflicts and other fields |
| 686 |
|
|
here. This data will be used by the Debian automatic package building |
| 687 |
|
|
software in order to create binary packages for other computer platforms. |
| 688 |
|
|
See the Policy manual for more information about the build-dependencies |
| 689 |
|
|
and the Developers' Reference for more information about these other |
| 690 |
|
|
platforms (architectures) and how to port software to them. |
| 691 |
aph |
743 |
|
| 692 |
joy |
1525 |
<p>Here's a hack you can use to find out which packages your package needs |
| 693 |
|
|
to be built: |
| 694 |
|
|
<example> |
| 695 |
|
|
strace -f -o /tmp/log ./configure |
| 696 |
joy |
2366 |
# or make instead of ./configure, if the package doesn't use autoconf |
| 697 |
joy |
1525 |
for 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 |
| 698 |
|
|
</example> |
| 699 |
|
|
|
| 700 |
osamu |
2677 |
<p>To manually find exact build dependency for |
| 701 |
|
|
<prgn><var>/usr/bin/foo</var></prgn>, you execute |
| 702 |
|
|
<example> |
| 703 |
|
|
objdump -p <var>/usr/bin/foo</var> | grep NEEDED |
| 704 |
|
|
</example> |
| 705 |
|
|
and for each library listed, e.g., <prgn>libfoo.so.6</prgn>, execute |
| 706 |
|
|
<example> |
| 707 |
|
|
dpkg -S libfoo.so.6 |
| 708 |
|
|
</example> |
| 709 |
|
|
Then you just take -dev version of every package as |
| 710 |
|
|
`Build-deps' entry. If you use <prgn>ldd</prgn> for this |
| 711 |
|
|
purpose, it will report indirect lib dependencies as well, resulting |
| 712 |
|
|
in the problem of excessive build deps. |
| 713 |
|
|
|
| 714 |
joy |
1525 |
<p>Gentoo also happens to require <package/xlibs-dev/, |
| 715 |
|
|
<package/libgtk1.2-dev/ and <package/libglib1.2-dev/ to build, so we'll |
| 716 |
|
|
add them here next to <package/debhelper/. |
| 717 |
|
|
|
| 718 |
joy |
1555 |
<p>Line 6 is the version of the Debian Policy standards this package |
| 719 |
|
|
follows, the versions of the Policy manual you read while making your |
| 720 |
|
|
package. |
| 721 |
|
|
|
| 722 |
|
|
<p>Line 8 is the name of the binary package. This is usually the same as |
| 723 |
joy |
1525 |
the name of the source package, but it doesn't necessarily have to be that |
| 724 |
|
|
way. |
| 725 |
|
|
|
| 726 |
joy |
1555 |
<p>Line 9 describes the CPU architecture the binary package can be compiled |
| 727 |
joy |
1525 |
for. We'll leave this as "any" because <manref name="dpkg-gencontrol" |
| 728 |
joy |
838 |
section="1"> will fill in the appropriate value for any machine this |
| 729 |
joy |
1525 |
package gets compiled on. |
| 730 |
|
|
|
| 731 |
|
|
<p>If your package is architecture independent |
| 732 |
joy |
896 |
(for example, a shell or Perl script, or a document), change this to |
| 733 |
joy |
1525 |
"all", and read later in <ref id="rules"> about using the `binary-indep' |
| 734 |
joy |
896 |
rule instead of `binary-arch' for building the package. |
| 735 |
aph |
743 |
|
| 736 |
joy |
1555 |
<p>Line 10 shows one of the most powerful features of the Debian packaging |
| 737 |
aph |
743 |
system. Packages can relate to each other in various ways. Apart from |
| 738 |
joy |
838 |
Depends:, other relationship fields are Recommends:, Suggests:, |
| 739 |
joy |
1525 |
Pre-Depends:, Conflicts:, Provides:, and Replaces:. |
| 740 |
aph |
743 |
|
| 741 |
joy |
1525 |
<p>The package management tools usually behave the same way when dealing |
| 742 |
|
|
with these relations; if not, it will be explained. |
| 743 |
joy |
838 |
(see <manref name="dpkg" section="8">, <manref name="dselect" section="8">, |
| 744 |
joy |
1525 |
<manref name="apt" section="8">, <manref name="aptitude" section="1"> etc.) |
| 745 |
joy |
838 |
|
| 746 |
joy |
1525 |
<p>This is what the dependencies mean: |
| 747 |
joy |
838 |
|
| 748 |
aph |
743 |
<p><list> |
| 749 |
|
|
<item>Depends: |
| 750 |
joy |
838 |
<p>The package will not be installed unless the packages it depends on |
| 751 |
|
|
are installed. Use this if your program absolutely will not run (or will |
| 752 |
|
|
cause severe breakage) unless a particular package is present.</item> |
| 753 |
aph |
743 |
|
| 754 |
|
|
<item>Recommends: |
| 755 |
joy |
1525 |
<p>Frontends such as dselect or aptitude will prompt you to install the |
| 756 |
|
|
recommended packages along with your package; dselect will even insist. |
| 757 |
|
|
dpkg and apt-get will ignore this field, though. Use this for packages |
| 758 |
|
|
that are not strictly necessary but are typically used with your |
| 759 |
joy |
838 |
program.</item> |
| 760 |
aph |
743 |
|
| 761 |
|
|
<item>Suggests: |
| 762 |
joy |
1525 |
<p>When a user installs your program, all frontends will likely prompt |
| 763 |
|
|
them to install the suggested packages. dpkg and apt-get won't care. Use |
| 764 |
|
|
this for packages which will work nicely with your program but are not at |
| 765 |
|
|
all necessary.</item> |
| 766 |
aph |
743 |
|
| 767 |
joy |
770 |
<item>Pre-Depends: |
| 768 |
joy |
838 |
<p>This is stronger than Depends:. The package will not be installed |
| 769 |
|
|
unless the packages it pre-depends on are installed <em>and correctly |
| 770 |
|
|
configured</em>. Use this <strong>very</strong> sparingly and only after |
| 771 |
|
|
discussing it on the debian-devel mailing list. Read: don't use it at |
| 772 |
|
|
all. :-)</item> |
| 773 |
aph |
743 |
|
| 774 |
|
|
<item>Conflicts: |
| 775 |
joy |
838 |
<p>The package will not be installed until all the packages it conflicts |
| 776 |
joy |
893 |
with have been removed. Use this if your program absolutely will not run |
| 777 |
joy |
1525 |
or will cause severe problems if a particular package is present.</item> |
| 778 |
aph |
743 |
|
| 779 |
|
|
<item>Provides: |
| 780 |
joy |
838 |
<p>For some types of packages where there are multiple alternatives |
| 781 |
joy |
1525 |
virtual names have been defined. You can get the full list in the |
| 782 |
|
|
/usr/share/doc/debian-policy/virtual-package-names-list.txt.gz file. |
| 783 |
joy |
838 |
Use this if your program provides a function of an existing virtual |
| 784 |
|
|
package.</item> |
| 785 |
aph |
743 |
|
| 786 |
|
|
<item>Replaces: |
| 787 |
joy |
838 |
<p>Use this when your program replaces files from another package, or |
| 788 |
joy |
896 |
completely replaces another package (used in conjunction with Conflicts:). |
| 789 |
joy |
1525 |
Files from the named packages will be overwritten with the files from your |
| 790 |
|
|
package. |
| 791 |
joy |
838 |
</item> |
| 792 |
aph |
743 |
</list> |
| 793 |
|
|
|
| 794 |
|
|
<p>All these fields have uniform syntax. They are a list of package names |
| 795 |
|
|
separated by commas. These package names may also be lists of alternative |
| 796 |
joy |
1525 |
package names, separated by vertical bar symbols `<tt>|</tt>' (pipe symbols). |
| 797 |
|
|
|
| 798 |
|
|
<p>The fields may restrict their applicability to particular versions of |
| 799 |
|
|
each named package. These versions are listed in parentheses after each |
| 800 |
joy |
838 |
individual package name, and they should contain a relation from the list |
| 801 |
|
|
below followed by the version number. The relations allowed are: |
| 802 |
|
|
<tt><<</tt>, <tt><=</tt>, <tt>=</tt>, <tt>>=</tt> and |
| 803 |
|
|
<tt>>></tt> for strictly earlier, earlier or equal, exactly equal, |
| 804 |
joy |
1525 |
later or equal and strictly later, respectively. For example, |
| 805 |
|
|
|
| 806 |
|
|
<p><example> |
| 807 |
|
|
Depends: foo (>= 1.2), libbar1 (= 1.3.4) |
| 808 |
|
|
Conflicts: baz |
| 809 |
|
|
Recommends: libbaz4 (>> 4.0.7) |
| 810 |
|
|
Suggests: quux |
| 811 |
|
|
Replaces: quux (<< 5), quux-foo (<= 7.6) |
| 812 |
|
|
</example> |
| 813 |
aph |
743 |
|
| 814 |
joy |
1525 |
<p>The last feature you need to know about is ${shlibs:Depends}. |
| 815 |
|
|
After your package has been built and installed into the temporary |
| 816 |
|
|
directory, <manref name="dh_shlibdeps" section="1"> will scan it for |
| 817 |
|
|
binaries and libraries, determine their shared library dependencies and |
| 818 |
|
|
detect which packages they are in, such as libc6 or xlib6g. It'll pass |
| 819 |
|
|
on the list to <manref name="dh_gencontrol" section="1"> which will fill |
| 820 |
|
|
it in the right place, and you won't have to worry about this yourself. |
| 821 |
aph |
743 |
|
| 822 |
joy |
1589 |
<p>Having said all that, we can leave the Depends: line exactly as it is |
| 823 |
|
|
now, and insert another line after it saying <tt>Suggests: file</tt>, |
| 824 |
joy |
896 |
because gentoo can use some features provided by that program/package. |
| 825 |
aph |
743 |
|
| 826 |
|
|
<p>Line 11 is the short description. Most people screens are 80 columns |
| 827 |
joy |
838 |
wide so this shouldn't be longer than about 60 characters. I'll change |
| 828 |
joy |
1525 |
it to "A fully GUI configurable X file manager using GTK+". |
| 829 |
aph |
743 |
|
| 830 |
|
|
<p>Line 12 is where the long description goes. This should be a paragraph |
| 831 |
joy |
1525 |
which gives more details about the package. Column 1 of each line should |
| 832 |
|
|
be empty. There must be no blank lines, but you can put a single . (dot) |
| 833 |
joy |
2366 |
in a column to simulate that. Also, there must be no more than one blank |
| 834 |
joy |
1525 |
line after the long description. |
| 835 |
aph |
743 |
|
| 836 |
joy |
1525 |
<p>Finally, here is the updated control file: |
| 837 |
aph |
743 |
|
| 838 |
|
|
<p><example> |
| 839 |
|
|
1 Source: gentoo |
| 840 |
|
|
2 Section: x11 |
| 841 |
|
|
3 Priority: optional |
| 842 |
joy |
2365 |
4 Maintainer: Josip Rodin <joy-mg@debian.org> |
| 843 |
joy |
1525 |
5 Build-Depends: debhelper (>> 3.0.0), xlibs-dev, libgtk1.2-dev, libglib1.2-dev |
| 844 |
|
|
6 Standards-Version: 3.5.2 |
| 845 |
|
|
7 |
| 846 |
|
|
8 Package: gentoo |
| 847 |
|
|
9 Architecture: any |
| 848 |
|
|
10 Depends: ${shlibs:Depends} |
| 849 |
|
|
11 Suggests: file |
| 850 |
joy |
1589 |
12 Description: A fully GUI configurable X file manager using GTK+ |
| 851 |
joy |
1525 |
13 gentoo is a file manager for Linux written from scratch in pure C. It |
| 852 |
|
|
14 uses the GTK+ toolkit for all of its interface needs. gentoo provides |
| 853 |
|
|
15 100% GUI configurability; no need to edit config files by hand and re- |
| 854 |
|
|
16 start the program. gentoo supports identifying the type of various |
| 855 |
|
|
17 files (using extension, regular expressions, or the 'file' command), |
| 856 |
|
|
18 and can display files of different types with different colors and icons. |
| 857 |
|
|
19 . |
| 858 |
|
|
20 gentoo borrows some of its look and feel from the classic Amiga file |
| 859 |
|
|
21 manager "Directory OPUS" (written by Jonathan Potter). |
| 860 |
aph |
743 |
</example> |
| 861 |
joy |
838 |
(I've added the line numbers.) |
| 862 |
aph |
743 |
|
| 863 |
joy |
893 |
<sect id="copyright">`copyright' file |
| 864 |
aph |
743 |
|
| 865 |
joy |
896 |
<p>This file contains the information about package upstream resources, |
| 866 |
|
|
copyright and license information. Its format is not dictated by the |
| 867 |
joy |
1526 |
Policy, but the contents is (section 13.6 "Copyright information"). |
| 868 |
aph |
743 |
|
| 869 |
joy |
1526 |
<p>dh_make created a default one, this is what it looks like: |
| 870 |
|
|
|
| 871 |
aph |
743 |
<p><example> |
| 872 |
joy |
2365 |
1 This package was debianized by Josip Rodin <joy-mg@debian.org> on |
| 873 |
aph |
743 |
2 Wed, 11 Nov 1998 21:02:14 +0100. |
| 874 |
|
|
3 |
| 875 |
|
|
4 It was downloaded from <fill in ftp site> |
| 876 |
|
|
5 |
| 877 |
|
|
6 Upstream Author(s): <put author(s) name and email here> |
| 878 |
|
|
7 |
| 879 |
|
|
8 Copyright: |
| 880 |
|
|
9 |
| 881 |
|
|
10 <Must follow here> |
| 882 |
|
|
</example> |
| 883 |
joy |
838 |
(I've added the line numbers.) |
| 884 |
aph |
743 |
|
| 885 |
|
|
<p>The important things to add to this file are the place you got the |
| 886 |
joy |
896 |
package from and the actual copyright notice and license. You must |
| 887 |
|
|
include the complete license, unless it's one of the common free software |
| 888 |
|
|
licenses such as GNU GPL or LGPL, BSD or the Artistic license, when you |
| 889 |
|
|
can just refer to the appropriate file in /usr/share/common-licenses/ |
| 890 |
joy |
1526 |
directory that exists on every Debian system. |
| 891 |
aph |
743 |
|
| 892 |
joy |
1526 |
<p>In short, here's how gentoo's copyright file should look like: |
| 893 |
|
|
|
| 894 |
aph |
743 |
<p><example> |
| 895 |
joy |
2365 |
1 This package was debianized by Josip Rodin <joy-mg@debian.org> on |
| 896 |
aph |
743 |
2 Wed, 11 Nov 1998 21:02:14 +0100. |
| 897 |
|
|
3 |
| 898 |
joy |
838 |
4 It was downloaded from: ftp://ftp.obsession.se/gentoo/ |
| 899 |
aph |
743 |
5 |
| 900 |
joy |
838 |
6 Upstream author: Emil Brink <emil@obsession.se> |
| 901 |
aph |
743 |
7 |
| 902 |
joy |
838 |
8 This software is copyright (c) 1998-99 by Emil Brink, Obsession |
| 903 |
|
|
9 Development. |
| 904 |
|
|
10 |
| 905 |
|
|
11 You are free to distribute this software under the terms of |
| 906 |
|
|
12 the GNU General Public License. |
| 907 |
|
|
13 On Debian systems, the complete text of the GNU General Public |
| 908 |
joy |
1526 |
14 License can be found in the file `/usr/share/common-licenses/GPL'. |
| 909 |
aph |
743 |
</example> |
| 910 |
joy |
838 |
(I've added the line numbers.) |
| 911 |
aph |
743 |
|
| 912 |
joy |
893 |
<sect id="changelog">`changelog' file |
| 913 |
aph |
743 |
|
| 914 |
joy |
797 |
<p>This is a required file, which has a special format described in |
| 915 |
osamu |
2664 |
the Policy section 4.4 "debian/changelog". This format is used by dpkg and |
| 916 |
joy |
797 |
other programs to obtain the version number, revision, distribution and |
| 917 |
|
|
urgency of your package. |
| 918 |
aph |
743 |
|
| 919 |
joy |
797 |
<p>For you, it is also important, since it is good to have documented |
| 920 |
|
|
all changes you have done. It will help people downloading your package |
| 921 |
joy |
1526 |
to see whether there are issues with the package that they should know |
| 922 |
|
|
about. It will be saved as |
| 923 |
joy |
896 |
`/usr/share/doc/gentoo/changelog.Debian.gz' in the binary package. |
| 924 |
joy |
797 |
|
| 925 |
joy |
2366 |
<p>dh_make created a default one, and this is how it looks like: |
| 926 |
joy |
797 |
|
| 927 |
aph |
743 |
<p><example> |
| 928 |
|
|
1 gentoo (0.9.12-1) unstable; urgency=low |
| 929 |
|
|
2 |
| 930 |
|
|
3 * Initial Release. |
| 931 |
|
|
4 |
| 932 |
joy |
2365 |
5 -- Josip Rodin <joy-mg@debian.org> Wed, 11 Nov 1998 21:02:14 +0100 |
| 933 |
aph |
743 |
6 |
| 934 |
|
|
</example> |
| 935 |
joy |
838 |
(I've added the line numbers.) |
| 936 |
aph |
743 |
|
| 937 |
|
|
<p>Line 1 is the package name, version, distribution, and urgency. |
| 938 |
joy |
896 |
The name must match the source package name, distribution should be |
| 939 |
joy |
1526 |
either `unstable' (or even `experimental'), and urgency shouldn't |
| 940 |
joy |
896 |
be changed to anything higher than `low'. :-) |
| 941 |
aph |
743 |
|
| 942 |
|
|
<p>Lines 3-5 are a log entry, where you document changes made in this |
| 943 |
|
|
package revision (not the upstream changes - there is special file for |
| 944 |
joy |
1526 |
that purpose, created by the upstream authors, which you will later install as |
| 945 |
joy |
838 |
/usr/share/doc/gentoo/changelog.gz). New lines must be inserted just |
| 946 |
joy |
896 |
before the uppermost line that begins with asterisk (`*'). You can do |
| 947 |
joy |
1526 |
it with <manref name="dch" section="1">, or manually with a text editor. |
| 948 |
aph |
743 |
|
| 949 |
joy |
1526 |
<p>You will end up with something like this: |
| 950 |
|
|
|
| 951 |
aph |
743 |
<p><example> |
| 952 |
|
|
1 gentoo (0.9.12-1) unstable; urgency=low |
| 953 |
|
|
2 |
| 954 |
|
|
3 * Initial Release. |
| 955 |
|
|
4 * This is my first Debian package. |
| 956 |
joy |
838 |
5 * Adjusted the Makefile to fix $DESTDIR problems. |
| 957 |
|
|
6 |
| 958 |
joy |
2365 |
7 -- Josip Rodin <joy-mg@debian.org> Wed, 11 Nov 1998 21:02:14 +0100 |
| 959 |
joy |
838 |
8 |
| 960 |
aph |
743 |
</example> |
| 961 |
joy |
838 |
(I've added the line numbers.) |
| 962 |
aph |
743 |
|
| 963 |
joy |
1526 |
<p>You can read more about updating the changelog file later in |
| 964 |
joy |
896 |
<ref id="update">. |
| 965 |
|
|
|
| 966 |
joy |
893 |
<sect id="rules">`rules' file |
| 967 |
|
|
|
| 968 |
joy |
896 |
<p>Now we need to take a look at the exact rules which |
| 969 |
|
|
<manref name="dpkg-buildpackage" section="1"> will use to actually create |
| 970 |
joy |
1526 |
the package. This file is actually another Makefile, but different than |
| 971 |
|
|
the one(s) in the upstream source. Unlike other files in debian/, this one |
| 972 |
|
|
is marked as executable. |
| 973 |
joy |
893 |
|
| 974 |
joy |
896 |
<p>Every `rules' file, as any other Makefile, consists of several rules |
| 975 |
|
|
specifying how to handle the source. Each rule consists of targets, |
| 976 |
|
|
filenames or names of actions that should be carried out (e.g. `build:' |
| 977 |
|
|
or `install:'). Rules that you want to execute are invoked as command |
| 978 |
|
|
line arguments (for example, `./debian/rules build` or `make -f rules |
| 979 |
|
|
install`). After the target name, you can name the dependency, program |
| 980 |
joy |
2366 |
or file that the rule depends on. After that, there can be any number |
| 981 |
joy |
1526 |
of commands, indented with <tab>. A new rule begins with the target |
| 982 |
|
|
declaration in the first column. Empty lines and lines beginning |
| 983 |
joy |
896 |
with `#' (hash) are treated as comments and ignored. |
| 984 |
joy |
893 |
|
| 985 |
|
|
<p>You are probably confused now, but it will all be clear upon examination |
| 986 |
joy |
896 |
of the `rules' file that dh_make gives us as a default. You should also |
| 987 |
|
|
read the `make' entry in info for more information. |
| 988 |
joy |
893 |
|
| 989 |
|
|
<p>The important part to know about the rules file created by dh_make, is |
| 990 |
|
|
that it is just a suggestion. It will work for simple packages but for |
| 991 |
|
|
more complicated ones, don't be afraid to add and subtract from it to fit |
| 992 |
|
|
your needs. Only thing that you must not change are the names of the |
| 993 |
joy |
1526 |
rules, because all the tools use these names, as mandated by the Policy. |
| 994 |
joy |
893 |
|
| 995 |
joy |
1526 |
<p>Here's (approximately) how the default debian/rules file that dh_make |
| 996 |
|
|
generated for us looks like: |
| 997 |
|
|
|
| 998 |
joy |
893 |
<p><example> |
| 999 |
|
|
1 #!/usr/bin/make -f |
| 1000 |
joy |
1526 |
2 # Sample debian/rules that uses debhelper. |
| 1001 |
|
|
3 # GNU copyright 1997 to 1999 by Joey Hess. |
| 1002 |
|
|
4 |
| 1003 |
|
|
5 # Uncomment this to turn on verbose mode. |
| 1004 |
|
|
6 #export DH_VERBOSE=1 |
| 1005 |
|
|
7 |
| 1006 |
|
|
8 # This is the debhelper compatibility version to use. |
| 1007 |
osamu |
2668 |
9 export DH_COMPAT=4 |
| 1008 |
|
|
10 |
| 1009 |
|
|
11 CFLAGS = -g |
| 1010 |
|
|
12 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 1011 |
|
|
13 CFLAGS += -O0 |
| 1012 |
|
|
14 else |
| 1013 |
|
|
15 CFLAGS += -O2 |
| 1014 |
joy |
1526 |
16 endif |
| 1015 |
|
|
17 |
| 1016 |
|
|
18 build: build-stamp |
| 1017 |
|
|
19 build-stamp: |
| 1018 |
|
|
20 dh_testdir |
| 1019 |
|
|
21 |
| 1020 |
|
|
22 # Add here commands to compile the package. |
| 1021 |
|
|
23 $(MAKE) |
| 1022 |
|
|
24 #/usr/bin/docbook-to-man debian/gentoo.sgml > gentoo.1 |
| 1023 |
joy |
893 |
25 |
| 1024 |
joy |
1526 |
26 touch build-stamp |
| 1025 |
|
|
27 |
| 1026 |
|
|
28 clean: |
| 1027 |
|
|
29 dh_testdir |
| 1028 |
|
|
30 dh_testroot |
| 1029 |
|
|
31 rm -f build-stamp |
| 1030 |
|
|
32 |
| 1031 |
|
|
33 # Add here commands to clean up after the build process. |
| 1032 |
|
|
34 -$(MAKE) clean |
| 1033 |
|
|
35 |
| 1034 |
|
|
36 dh_clean |
| 1035 |
|
|
37 |
| 1036 |
|
|
38 install: build |
| 1037 |
|
|
39 dh_testdir |
| 1038 |
|
|
40 dh_testroot |
| 1039 |
|
|
41 dh_clean -k |
| 1040 |
|
|
42 dh_installdirs |
| 1041 |
joy |
893 |
43 |
| 1042 |
joy |
1526 |
44 # Add here commands to install the package into debian/gentoo. |
| 1043 |
|
|
45 $(MAKE) install DESTDIR=$(CURDIR)/debian/gentoo |
| 1044 |
|
|
46 |
| 1045 |
|
|
47 # Build architecture-independent files here. |
| 1046 |
|
|
48 binary-indep: build install |
| 1047 |
|
|
49 # We have nothing to do by default. |
| 1048 |
|
|
50 |
| 1049 |
|
|
51 # Build architecture-dependent files here. |
| 1050 |
|
|
52 binary-arch: build install |
| 1051 |
|
|
53 dh_testdir |
| 1052 |
|
|
54 dh_testroot |
| 1053 |
|
|
55 # dh_installdebconf |
| 1054 |
|
|
56 dh_installdocs |
| 1055 |
|
|
57 dh_installexamples |
| 1056 |
|
|
58 dh_installmenu |
| 1057 |
|
|
59 # dh_installlogrotate |
| 1058 |
|
|
60 # dh_installemacsen |
| 1059 |
|
|
61 # dh_installpam |
| 1060 |
|
|
62 # dh_installmime |
| 1061 |
|
|
63 # dh_installinit |
| 1062 |
|
|
64 dh_installcron |
| 1063 |
|
|
65 dh_installman |
| 1064 |
|
|
66 dh_installinfo |
| 1065 |
|
|
67 # dh_undocumented |
| 1066 |
|
|
68 dh_installchangelogs ChangeLog |
| 1067 |
|
|
69 dh_link |
| 1068 |
|
|
70 dh_strip |
| 1069 |
|
|
71 dh_compress |
| 1070 |
|
|
72 dh_fixperms |
| 1071 |
|
|
73 # dh_makeshlibs |
| 1072 |
|
|
74 dh_installdeb |
| 1073 |
|
|
75 # dh_perl |
| 1074 |
|
|
76 dh_shlibdeps |
| 1075 |
|
|
77 dh_gencontrol |
| 1076 |
|
|
78 dh_md5sums |
| 1077 |
|
|
79 dh_builddeb |
| 1078 |
|
|
80 |
| 1079 |
|
|
81 binary: binary-indep binary-arch |
| 1080 |
|
|
82 .PHONY: build clean binary-indep binary-arch binary install |
| 1081 |
joy |
893 |
</example> |
| 1082 |
|
|
(I've added the line numbers.) |
| 1083 |
|
|
|
| 1084 |
joy |
896 |
<p>You are probably familiar with lines like line 1 from shell and Perl |
| 1085 |
|
|
scripts. It tells the operating system that this file is to be processed |
| 1086 |
|
|
with /usr/bin/make. |
| 1087 |
joy |
893 |
|
| 1088 |
joy |
1526 |
<p>The meaning of DH_* variables mentioned on lines 6 and 9 should be |
| 1089 |
|
|
evident from the short description. For more information on DH_COMPAT |
| 1090 |
|
|
read the "Debhelper compatibility levels" section of the |
| 1091 |
|
|
<manref name="debhelper" section="1"> manual page. |
| 1092 |
joy |
893 |
|
| 1093 |
joy |
1526 |
<p>The lines 11 through 16 are a skeleton of support for DEB_BUILD_OPTIONS |
| 1094 |
|
|
parameters, described in the Policy section 11.1 "Binaries". Basically, |
| 1095 |
|
|
these things control if the binaries are to be built with the debugging |
| 1096 |
|
|
symbols, and if they should be stripped upon installation. Again, this is |
| 1097 |
|
|
just a skeleton, a hint that you should do it. You should check into how |
| 1098 |
|
|
the upstream build system handles the inclusion of debugging symbols and |
| 1099 |
|
|
stripping on installation and implement this yourself. |
| 1100 |
|
|
|
| 1101 |
|
|
<p>Usually you can tell gcc to compile with "-g" using the CFLAGS variable |
| 1102 |
|
|
-- if that's the case for your package, propagate the variable by |
| 1103 |
|
|
<em>appending</em> <tt>CFLAGS="$(CFLAGS)"</tt> to the $(MAKE) invocation |
| 1104 |
|
|
in the build rule (see below). Alternatively, if your package uses an |
| 1105 |
|
|
autoconf configure script, you can pass it to configure by |
| 1106 |
|
|
<em>prepending</em> the above string to the ./configure invocation in the |
| 1107 |
|
|
build rule. |
| 1108 |
|
|
|
| 1109 |
|
|
<p>As for the stripping, programs are commonly configured to install |
| 1110 |
|
|
themselves unstripped, and often without an option to change this. |
| 1111 |
|
|
Fortunately, you still have <manref name="dh_strip" section="1"> which |
| 1112 |
|
|
will detect when the DEB_BUILD_OPTIONS=nostrip flag is set and silently |
| 1113 |
|
|
exit. |
| 1114 |
|
|
|
| 1115 |
|
|
<p>Lines 18 through 26 describe the `build' (and its child `build-stamp') |
| 1116 |
|
|
rule, which runs make with the application's own Makefile to compile the |
| 1117 |
|
|
program. We'll talk about the commented out docbook-to-man example later |
| 1118 |
|
|
in <ref id="manpage">. |
| 1119 |
|
|
|
| 1120 |
|
|
<p>The `clean' rule, as specified in lines 28-36, cleans up any unneeded |
| 1121 |
joy |
893 |
binary or auto-generated stuff, left over from building the package. |
| 1122 |
|
|
This rule must be working at all times (even when the source tree <em/is/ |
| 1123 |
|
|
cleaned up!), so please use the forcing options (e.g. for rm, that is |
| 1124 |
joy |
1526 |
`-f'), or have make ignore return values (failures) using a `-' in front |
| 1125 |
|
|
of the command name. |
| 1126 |
joy |
893 |
|
| 1127 |
joy |
1526 |
<p>The installation process, the `install' rule, starts with line 38. |
| 1128 |
joy |
896 |
It basically runs the `install' rule from the program's own Makefile, |
| 1129 |
joy |
1526 |
but installs in the <tt>$(CURDIR)/debian/gentoo</tt> directory - this is |
| 1130 |
|
|
why we specified |
| 1131 |
joy |
893 |
$(DESTDIR) as the root installation directory in gentoo's Makefile. |
| 1132 |
|
|
|
| 1133 |
joy |
1526 |
<p>As the comments suggest, the `binary-indep' rule, on the line 48, is |
| 1134 |
|
|
used to build packages independent of architecture. As we don't have any, |
| 1135 |
|
|
nothing will be done there. |
| 1136 |
joy |
893 |
|
| 1137 |
joy |
1618 |
<p>On to the next rule - `binary-arch', on lines 52 through 79, in which |
| 1138 |
joy |
896 |
we run several small utilities from the debhelper package that do various |
| 1139 |
|
|
operations on your package files to make the package Policy conforming. |
| 1140 |
joy |
1526 |
|
| 1141 |
|
|
<p>If your package is an `Architecture: all' one, you need to include all |
| 1142 |
|
|
the commands for building the package under the `binary-indep' rule, and |
| 1143 |
|
|
leave the `binary-arch' rule empty instead. |
| 1144 |
joy |
893 |
|
| 1145 |
joy |
1526 |
<p>The names of debhelper programs start with dh_, and the rest is the |
| 1146 |
|
|
description of what the particular utility does. It is all quite |
| 1147 |
|
|
self-explanatory, but here are some additional explanations: |
| 1148 |
joy |
893 |
|
| 1149 |
|
|
<list> |
| 1150 |
|
|
<item><manref name="dh_testdir" section="1"> checks that you are in the |
| 1151 |
|
|
right directory (i.e. the top-level source directory), |
| 1152 |
|
|
<item><manref name="dh_testroot" section="1"> checks that you have root |
| 1153 |
joy |
1526 |
permissions which is needed for the targets `binary-arch', |
| 1154 |
|
|
`binary-indep' and `clean', |
| 1155 |
|
|
<item><manref name="dh_installman" section="1"> will copy the manpages |
| 1156 |
|
|
into the right place in the destination directory, you just have to |
| 1157 |
|
|
tell it where they are, relative to the top-level source directory, |
| 1158 |
joy |
893 |
<item><manref name="dh_strip" section="1"> strips debugging headers from |
| 1159 |
|
|
executable files and libraries, to make them smaller, |
| 1160 |
joy |
1526 |
<item><manref name="dh_compress" section="1"> compresses man pages and |
| 1161 |
|
|
documentation larger than 4 kB with <manref name="gzip" section="1">, |
| 1162 |
joy |
893 |
<item><manref name="dh_installdeb" section="1"> copies package related |
| 1163 |
joy |
1526 |
files (e.g. the maintainer scripts) to the |
| 1164 |
|
|
<file>debian/gentoo/DEBIAN</file> directory, |
| 1165 |
joy |
893 |
<item><manref name="dh_shlibdeps" section="1"> calculates shared libraries |
| 1166 |
|
|
dependencies of the libraries and executables, |
| 1167 |
joy |
1526 |
<item><manref name="dh_gencontrol" section="1"> installs a fine-tuned |
| 1168 |
|
|
version of the control file into <file>debian/gentoo/DEBIAN</file>, |
| 1169 |
joy |
893 |
<item><manref name="dh_md5sums" section="1"> generates MD5 checksums for |
| 1170 |
|
|
all the files in the package. |
| 1171 |
|
|
</list> |
| 1172 |
|
|
|
| 1173 |
|
|
<p>For more complete information on what do all these dh_* scripts do, and |
| 1174 |
joy |
2366 |
what their other options are, please read their respective manual pages. There |
| 1175 |
|
|
are some other (possibly very useful) dh_* scripts which were not |
| 1176 |
joy |
893 |
mentioned here. If you need them, read the debhelper documentation. |
| 1177 |
|
|
|
| 1178 |
joy |
896 |
<p>The binary-arch section is the one where you really should comment |
| 1179 |
joy |
1526 |
out or remove any lines that call features you don't need. For gentoo, |
| 1180 |
joy |
1527 |
I'll comment out lines about examples, cron, init, man and info, |
| 1181 |
joy |
1526 |
simply because gentoo doesn't need them. Also, on the line 68, I'll |
| 1182 |
|
|
replace `ChangeLog' with `FIXES', because that is the real name of the |
| 1183 |
|
|
upstream changelog file. |
| 1184 |
joy |
893 |
|
| 1185 |
|
|
<p>The last two lines (along with any other not explained ones) are just |
| 1186 |
joy |
1198 |
some more-or-less necessary things, regarding which you can read in the |
| 1187 |
joy |
1526 |
make manual, and the Policy. For now, they're not important to know about. |
| 1188 |
joy |
893 |
|
| 1189 |
|
|
<chapt id="dother">Other files under debian/ |
| 1190 |
|
|
|
| 1191 |
|
|
<p>You will see that there exist several other files in the debian/ |
| 1192 |
joy |
2405 |
subdirectory, most of them with the `ex' suffix or prefix, meaning that |
| 1193 |
|
|
they are examples. Take a look at all of them. If you wish or need to |
| 1194 |
|
|
use any of those features: |
| 1195 |
joy |
1527 |
|
| 1196 |
|
|
<list> |
| 1197 |
|
|
<item>take a look at the related documentation (hint: the Policy Manual), |
| 1198 |
|
|
<item>if necessary modify the files to suit your needs, |
| 1199 |
joy |
1528 |
<item>rename them to remove the `.ex' suffix if they have one, |
| 1200 |
joy |
2405 |
<item>rename them to remove the `ex.' prefix if they have one, |
| 1201 |
joy |
1527 |
<item>modify the `rules' file if necessary. |
| 1202 |
|
|
</list> |
| 1203 |
|
|
|
| 1204 |
joy |
2366 |
<p>Some of those files, the commonly used ones, are explained in the |
| 1205 |
joy |
893 |
following sections. |
| 1206 |
|
|
|
| 1207 |
joy |
896 |
<sect id="readme">README.Debian |
| 1208 |
joy |
893 |
|
| 1209 |
|
|
<p>Any extra details or discrepancies between the original package and |
| 1210 |
joy |
1527 |
your debianized version should be documented here. |
| 1211 |
joy |
893 |
|
| 1212 |
joy |
1527 |
<p>dh_make created a default one, this is what it looks like: |
| 1213 |
|
|
|
| 1214 |
|
|
<p><example> |
| 1215 |
joy |
893 |
gentoo for Debian |
| 1216 |
joy |
1527 |
----------------- |
| 1217 |
joy |
893 |
|
| 1218 |
|
|
<possible notes regarding this package - if none, delete this file> |
| 1219 |
|
|
|
| 1220 |
joy |
2365 |
-- Josip Rodin <joy-mg@debian.org>, Wed, 11 Nov 1998 21:02:14 +0100 |
| 1221 |
joy |
893 |
</example> |
| 1222 |
|
|
|
| 1223 |
joy |
1527 |
<p>Since we don't have anything to put there, we'll delete the file. |
| 1224 |
joy |
893 |
|
| 1225 |
joy |
1527 |
<sect id="conffiles">conffiles.ex |
| 1226 |
aph |
743 |
|
| 1227 |
|
|
<p>One of the most annoying things about software is when you spend a |
| 1228 |
joy |
1527 |
great deal of time and effort customizing a program, only to have an |
| 1229 |
aph |
743 |
upgrade stomp all over your changes. Debian solves this problem by |
| 1230 |
joy |
1527 |
marking configuration files so that when you upgrade a package, you'll |
| 1231 |
|
|
be prompted whether you want to keep your old configuration or not. |
| 1232 |
aph |
743 |
|
| 1233 |
joy |
1527 |
<p>The way to do this in a package is to enter the full path to each |
| 1234 |
|
|
configuration file (usually in /etc), one per line, in a file called |
| 1235 |
|
|
<tt/conffiles/. Gentoo has one conffile, /etc/gentoorc, and we'll enter |
| 1236 |
|
|
that in the <tt/conffiles/ file. |
| 1237 |
joy |
838 |
|
| 1238 |
joy |
1527 |
<p>If your program uses configuration files but also rewrites them on its |
| 1239 |
|
|
own, it's best not to mark them as conffiles because dpkg will then prompt |
| 1240 |
|
|
users to verify the changes all the time. |
| 1241 |
|
|
|
| 1242 |
|
|
<p>If the program you're packaging requires every user to modify the |
| 1243 |
|
|
configuration file in order to work at all, also consider not marking the |
| 1244 |
|
|
file as a conffile. |
| 1245 |
|
|
|
| 1246 |
|
|
<p>You can handle example configuration files from the `maintainer |
| 1247 |
|
|
scripts', for more information see <ref id="maintscripts">. |
| 1248 |
|
|
|
| 1249 |
|
|
<p>If your program has no conffiles, you can safely delete the |
| 1250 |
|
|
<tt/conffiles/ file from the debian/ directory. |
| 1251 |
|
|
|
| 1252 |
|
|
<sect id="crond">cron.d.ex |
| 1253 |
|
|
|
| 1254 |
|
|
<p>If your package requires regularly scheduled tasks to operate properly, |
| 1255 |
|
|
you an use this file to set it up. |
| 1256 |
|
|
|
| 1257 |
|
|
<p>Note that this doesn't include log rotation; for that, see |
| 1258 |
|
|
<manref name="dh_installlogrotate" section="1"> and |
| 1259 |
|
|
<manref name="logrotate" section="8">. |
| 1260 |
|
|
|
| 1261 |
|
|
<p>If not, remove it. |
| 1262 |
|
|
|
| 1263 |
aph |
743 |
<sect id="dirs">dirs |
| 1264 |
|
|
|
| 1265 |
joy |
1198 |
<p>This file specifies the directories which we need but the normal |
| 1266 |
joy |
838 |
installation procedure (make install) somehow doesn't create. |
| 1267 |
joy |
797 |
|
| 1268 |
joy |
1527 |
<p>By default, it looks like this: |
| 1269 |
|
|
|
| 1270 |
aph |
743 |
<p><example> |
| 1271 |
joy |
838 |
usr/bin |
| 1272 |
|
|
usr/sbin |
| 1273 |
aph |
743 |
</example> |
| 1274 |
|
|
|
| 1275 |
|
|
<p>Note that the preceding slash is not included. We would have normally |
| 1276 |
|
|
changed it to look like this: |
| 1277 |
joy |
1527 |
|
| 1278 |
aph |
743 |
<p><example> |
| 1279 |
joy |
1527 |
usr/bin |
| 1280 |
|
|
usr/man/man1 |
| 1281 |
aph |
743 |
</example> |
| 1282 |
|
|
|
| 1283 |
joy |
1527 |
<p>but those directories are already created in the Makefile, so we won't |
| 1284 |
|
|
need this file, and we will instead delete it. |
| 1285 |
aph |
743 |
|
| 1286 |
joy |
1528 |
<sect id="docs">docs |
| 1287 |
|
|
|
| 1288 |
|
|
<p>This file specifies the file names of documentation files we can have |
| 1289 |
|
|
dh_installdocs install into the temporary directory for us. |
| 1290 |
|
|
|
| 1291 |
|
|
<p>By default, it will include all existing files in the top-level source |
| 1292 |
|
|
directory that are called "BUGS", "README*", "TODO" etc. |
| 1293 |
|
|
|
| 1294 |
|
|
<p>For gentoo, I also included some other stuff: |
| 1295 |
|
|
|
| 1296 |
|
|
<p><example> |
| 1297 |
|
|
BUGS |
| 1298 |
|
|
CONFIG-CHANGES |
| 1299 |
|
|
CREDITS |
| 1300 |
|
|
ONEWS |
| 1301 |
|
|
README |
| 1302 |
|
|
README.gtkrc |
| 1303 |
|
|
TODO |
| 1304 |
|
|
</example> |
| 1305 |
|
|
|
| 1306 |
|
|
<p>We can also remove this file and instead list these files on the |
| 1307 |
|
|
<tt/dh_installdocs/ command line in the <tt/rules/ file, like this: |
| 1308 |
|
|
|
| 1309 |
|
|
<p><example> |
| 1310 |
|
|
dh_installdocs BUGS CONFIG-CHANGES CREDITS ONEWS README \ |
| 1311 |
|
|
README.gtkrc TODO |
| 1312 |
|
|
</example> |
| 1313 |
|
|
|
| 1314 |
|
|
<p>How ever unlikely it may seem, you may not have any such files in your |
| 1315 |
joy |
1552 |
package's sources. In that case you can safely remove this file. But don't |
| 1316 |
|
|
remove the <tt/dh_installdocs/ invocation from the <tt/rules/ file because |
| 1317 |
|
|
that's used to install the <tt/copyright/ file and other things. |
| 1318 |
joy |
1528 |
|
| 1319 |
joy |
1527 |
<sect id="emacsen">emacsen-*.ex |
| 1320 |
aph |
743 |
|
| 1321 |
joy |
1527 |
<p>If your package supplies Emacs files that can be bytecompiled at |
| 1322 |
|
|
package installation time, you can use these files to set it up. |
| 1323 |
aph |
743 |
|
| 1324 |
joy |
1527 |
<p>They are installed into the temporary directory by |
| 1325 |
|
|
<manref name="dh_installemacsen" section="1">, so don't forget to |
| 1326 |
|
|
uncomment that line in the <tt/rules/ file if you use this. |
| 1327 |
aph |
743 |
|
| 1328 |
joy |
1527 |
<p>If you don't need these, remove them. |
| 1329 |
|
|
|
| 1330 |
|
|
<sect id="initd">init.d.ex |
| 1331 |
|
|
|
| 1332 |
|
|
<p>If your package is a daemon that needs to be run at system startup, |
| 1333 |
|
|
you've obviously disregarded my initial recommendation, haven't you? :-) |
| 1334 |
|
|
|
| 1335 |
|
|
<p>This is a fairly generic skeleton file for an <file>/etc/init.d/</file> |
| 1336 |
|
|
script, so you'll likely have to edit it, a lot. It gets installed into |
| 1337 |
|
|
the temporary directory by <manref name="dh_installinit" section="1">. |
| 1338 |
|
|
|
| 1339 |
|
|
<p>If you don't need this, remove the file. |
| 1340 |
|
|
|
| 1341 |
|
|
<sect id="manpage">manpage.1.ex, manpage.sgml.ex |
| 1342 |
|
|
|
| 1343 |
|
|
<p>Your program(s) should have a manual page. If they don't, each of these |
| 1344 |
joy |
2366 |
files is a template that you can fill out. |
| 1345 |
joy |
1527 |
|
| 1346 |
|
|
<p>Manual pages are normally written in <manref name="nroff" section="1">. |
| 1347 |
|
|
The <tt/manpage.1.ex/ example is written in nroff, too. |
| 1348 |
|
|
See the <manref name="man" section="7"> manual page |
| 1349 |
|
|
for a brief description of how to edit such a file. |
| 1350 |
|
|
|
| 1351 |
|
|
<p>If on the other hand you prefer writing SGML instead of nroff, you can |
| 1352 |
|
|
use the <tt/manpage.sgml.ex/ template. If you do this, you have to: |
| 1353 |
|
|
<list> |
| 1354 |
|
|
<item>install the <package/docbook-to-man/ package |
| 1355 |
|
|
<item>add <tt/docbook-to-man/ to the <tt/Build-Depends/ line in the |
| 1356 |
|
|
<tt/control/ file |
| 1357 |
|
|
<item>remove the comment from the docbook-to-man invocation in the |
| 1358 |
|
|
`build' rule of your <tt/rules/ file |
| 1359 |
|
|
</list> |
| 1360 |
|
|
|
| 1361 |
|
|
<p>And remember to rename the file to something like <tt/gentoo.sgml/! |
| 1362 |
|
|
|
| 1363 |
|
|
<p>The final manual page file name should include the name of the program |
| 1364 |
|
|
it is documenting, so we will rename it from "manpage" to "gentoo". |
| 1365 |
|
|
The file name also includes ".1" as the first suffix, which means it's a |
| 1366 |
|
|
manual page for a user command. Be sure to verify that this section is |
| 1367 |
|
|
indeed the correct one. Here's a short list of manual page sections: |
| 1368 |
|
|
|
| 1369 |
aph |
743 |
<p><example> |
| 1370 |
|
|
Section | Description | Notes |
| 1371 |
|
|
1 User commands Executable commands or scripts. |
| 1372 |
|
|
2 System calls Functions provided by the kernel. |
| 1373 |
|
|
3 Library calls Functions within system libraries. |
| 1374 |
|
|
4 Special files Usually found in /dev |
| 1375 |
|
|
5 File formats E.g. /etc/passwd's format |
| 1376 |
|
|
6 Games Or other frivolous programs |
| 1377 |
|
|
7 Macro packages Such as man macros. |
| 1378 |
|
|
8 System administration Programs typically only run by root. |
| 1379 |
|
|
9 Kernel routines Non-standard calls and internals. |
| 1380 |
|
|
</example> |
| 1381 |
|
|
|
| 1382 |
joy |
1527 |
<p>So gentoo's man page should be called <tt/gentoo.1/. For X programs you |
| 1383 |
|
|
can tack on another "x" to the section, i.e. <tt/gentoo.1x/. |
| 1384 |
|
|
There was no gentoo.1 man page in the original source so I wrote |
| 1385 |
|
|
it using information from the example and from upstream docs. |
| 1386 |
aph |
743 |
|
| 1387 |
|
|
<sect id="menu">menu.ex |
| 1388 |
|
|
|
| 1389 |
joy |
838 |
<p>X Window System users usually have a window manager with a menu that |
| 1390 |
|
|
can be customized to launch programs. If they have installed the Debian |
| 1391 |
joy |
1527 |
<package/menu/ package, a set of menus for every program on the system will be |
| 1392 |
|
|
created for them. |
| 1393 |
|
|
|
| 1394 |
joy |
2366 |
<p>Here's the default <tt/menu.ex/ file that dh_make created: |
| 1395 |
aph |
743 |
|
| 1396 |
|
|
<p><example> |
| 1397 |
|
|
?package(gentoo):needs=X11|text|vc|wm section=Apps/see-menu-manual\ |
| 1398 |
|
|
title="gentoo" command="/usr/bin/gentoo" |
| 1399 |
|
|
</example> |
| 1400 |
|
|
|
| 1401 |
joy |
1527 |
<p>The first field after the colon character is "needs", and it specifies |
| 1402 |
|
|
what kind of interface the program needs. Change this to one of the listed |
| 1403 |
|
|
alternatives, e.g. "text" or "X11". |
| 1404 |
|
|
|
| 1405 |
|
|
<p>The next is "section", where the menu and submenu the entry should |
| 1406 |
joy |
838 |
appear in. The current list of sections is at: |
| 1407 |
joy |
1527 |
<file>/usr/share/doc/debian-policy/menu-policy.html/ch2.html#s2.1</file> |
| 1408 |
aph |
743 |
|
| 1409 |
joy |
1527 |
<p>The "title" field is the name of the program. You can start this one |
| 1410 |
|
|
in uppercase if you like. Just keep it short. |
| 1411 |
|
|
|
| 1412 |
|
|
<p>Finally, the "command" field is the command that runs the program. |
| 1413 |
|
|
|
| 1414 |
aph |
743 |
<p>Now we'll change the menu entry to this: |
| 1415 |
joy |
1527 |
|
| 1416 |
aph |
743 |
<p><example> |
| 1417 |
joy |
1533 |
?package(gentoo): needs=X11 section=Apps/Tools title="Gentoo" command="gentoo" |
| 1418 |
aph |
743 |
</example> |
| 1419 |
|
|
|
| 1420 |
joy |
1527 |
<p>You can also add other fields like "longtitle", "icon", "hints" etc. |
| 1421 |
|
|
See <manref name="menufile" section="5">, |
| 1422 |
|
|
<manref name="update-menus" section="1"> |
| 1423 |
|
|
and <file>/usr/share/doc/debian-policy/menu-policy.html/</file> for more |
| 1424 |
|
|
information. |
| 1425 |
joy |
838 |
|
| 1426 |
aph |
743 |
<sect id="watch">watch.ex |
| 1427 |
|
|
|
| 1428 |
joy |
1527 |
<p>This file is used to configure the <manref name="uscan" section="1"> |
| 1429 |
|
|
and <manref name="uupdate" section="1"> programs (in the |
| 1430 |
|
|
<package/devscripts/ package). These are used to watch the site you got |
| 1431 |
|
|
the original source from. |
| 1432 |
aph |
743 |
|
| 1433 |
joy |
1527 |
<p>Here's what I put in it: |
| 1434 |
|
|
|
| 1435 |
joy |
838 |
<p><example> |
| 1436 |
|
|
# watch control file for uscan |
| 1437 |
joy |
896 |
# Site Directory Pattern Version Script |
| 1438 |
|
|
ftp.obsession.se /gentoo gentoo-(.*)\.tar\.gz debian uupdate |
| 1439 |
joy |
838 |
</example> |
| 1440 |
aph |
743 |
|
| 1441 |
joy |
838 |
<p>Hint: connect to the Internet, and try running "uscan" in the program |
| 1442 |
joy |
1527 |
directory once you create the file. And read the manuals! :) |
| 1443 |
aph |
743 |
|
| 1444 |
joy |
1527 |
<sect id="doc-base">ex.package.doc-base |
| 1445 |
joy |
896 |
|
| 1446 |
joy |
1527 |
<p>If your package has documentation other than manual pages and info |
| 1447 |
|
|
docs, you should use the `<package/doc-base/' file to register it, |
| 1448 |
|
|
so the user can find it with e.g. <manref name="dhelp" section="1">, |
| 1449 |
|
|
<manref name="dwww" section="1"> or <manref name="doccentral" section="1">. |
| 1450 |
joy |
896 |
|
| 1451 |
joy |
1527 |
<p>This usually includes HTML, PS and PDF files, shipped in |
| 1452 |
|
|
<file>/usr/share/doc/packagename/</file>. |
| 1453 |
|
|
|
| 1454 |
joy |
2405 |
<p>This is how gentoo's doc-base file <tt>gentoo.doc-base</tt> looks like: |
| 1455 |
joy |
896 |
|
| 1456 |
|
|
<p><example> |
| 1457 |
|
|
Document: gentoo |
| 1458 |
|
|
Title: Gentoo Manual |
| 1459 |
|
|
Author: Emil Brink |
| 1460 |
|
|
Abstract: This manual describes what Gentoo is, and how it can be used. |
| 1461 |
|
|
Section: Apps/Tools |
| 1462 |
|
|
|
| 1463 |
|
|
Format: HTML |
| 1464 |
|
|
Index: /usr/share/doc/gentoo/html/index.html |
| 1465 |
|
|
Files: /usr/share/doc/gentoo/html/*.html |
| 1466 |
|
|
</example> |
| 1467 |
|
|
|
| 1468 |
joy |
1527 |
<p>For information on the file format, see |
| 1469 |
|
|
<manref name="install-docs" section="8"> and the <package/doc-base/ manual, |
| 1470 |
|
|
in <file>/usr/share/doc/doc-base/doc-base.html/</file>. |
| 1471 |
joy |
896 |
|
| 1472 |
joy |
838 |
<sect id="maintscripts">postinst.ex, preinst.ex, postrm.ex, prerm.ex |
| 1473 |
|
|
|
| 1474 |
joy |
1527 |
<p>These files are called maintainer scripts. They are scripts which are |
| 1475 |
|
|
put in the control area of the package and run by <prgn/dpkg/ when your |
| 1476 |
|
|
package is installed, upgraded or removed. |
| 1477 |
joy |
896 |
|
| 1478 |
|
|
<p>For now, you should try to avoid any manual editing of maintainer |
| 1479 |
|
|
scripts if you possibly can because they tend to get complex. For more |
| 1480 |
joy |
1619 |
information look in the Policy Manual, chapter 6, and take a look at |
| 1481 |
joy |
838 |
these example files provided by dh_make. |
| 1482 |
|
|
|
| 1483 |
joy |
1527 |
<chapt id="build">Building the package |
| 1484 |
|
|
|
| 1485 |
joy |
838 |
<p>We should now be ready to build the package. |
| 1486 |
|
|
|
| 1487 |
joy |
1530 |
<sect id="completebuild">Complete rebuild |
| 1488 |
joy |
1529 |
|
| 1489 |
joy |
893 |
<p>Enter the program's main directory and then issue this command: |
| 1490 |
joy |
838 |
|
| 1491 |
aph |
743 |
<p><example> |
| 1492 |
joy |
773 |
dpkg-buildpackage -rfakeroot |
| 1493 |
aph |
743 |
</example> |
| 1494 |
|
|
|
| 1495 |
joy |
1529 |
<p>This will do everything for you. It will: |
| 1496 |
|
|
<list> |
| 1497 |
|
|
<item>clean the source tree (debian/rules clean), using <prgn/fakeroot/ |
| 1498 |
|
|
<item>build the source package (dpkg-source -b) |
| 1499 |
|
|
<item>build the program (debian/rules build) |
| 1500 |
|
|
<item>build the binary package (debian/rules binary), using <prgn/fakeroot/ |
| 1501 |
|
|
<item>sign the source <tt/.dsc/ file, using <prgn/gnupg/ |
| 1502 |
|
|
<item>create and sign the upload <tt/.changes/ file, using |
| 1503 |
|
|
<prgn/dpkg-genchanges/ and <prgn/gnupg/ |
| 1504 |
|
|
</list> |
| 1505 |
aph |
743 |
|
| 1506 |
joy |
1529 |
<p>The only input that will be required of you is your GPG key secret pass |
| 1507 |
|
|
phrase, twice. |
| 1508 |
|
|
|
| 1509 |
|
|
<p>After all this is done, you will see the following files in the |
| 1510 |
|
|
directory above (<tt>~/debian/</tt>): |
| 1511 |
|
|
|
| 1512 |
aph |
743 |
<p><list> |
| 1513 |
|
|
<item><em>gentoo_0.9.12.orig.tar.gz</em> |
| 1514 |
|
|
|
| 1515 |
joy |
1529 |
<p>This is the original source code tarball, merely renamed to the above |
| 1516 |
joy |
1531 |
so that it adheres to the Debian standard. Note that this was created |
| 1517 |
|
|
using the `-f' option to <prgn/dh_make/ when we initially ran it. |
| 1518 |
joy |
1529 |
|
| 1519 |
aph |
743 |
<item><em>gentoo_0.9.12-1.dsc</em> |
| 1520 |
joy |
1529 |
|
| 1521 |
aph |
743 |
<p>This is a summary of the contents of the source code. The file is |
| 1522 |
joy |
1529 |
generated from your `control' file, and is used when |
| 1523 |
joy |
770 |
unpacking the source with <manref name="dpkg-source" section="1">. This |
| 1524 |
osamu |
2676 |
file is GPG signed, so that people can be sure that it's really yours. |
| 1525 |
joy |
838 |
|
| 1526 |
|
|
<item><em>gentoo_0.9.12-1.diff.gz</em> |
| 1527 |
joy |
1529 |
|
| 1528 |
joy |
838 |
<p>This compressed file contains each and every addition you made to the |
| 1529 |
joy |
1619 |
original source code, in the form known as "unified diff". It is made and |
| 1530 |
|
|
used by <manref name="dpkg-source" section="1">. Warning: if you don't name |
| 1531 |
joy |
1531 |
the original tarball packagename_version.orig.tar.gz, <prgn/dpkg-source/ |
| 1532 |
|
|
will fail to generate the .diff.gz file properly! |
| 1533 |
joy |
838 |
|
| 1534 |
joy |
1531 |
<p>If someone else wants to re-create your package from scratch, they can |
| 1535 |
joy |
1529 |
easily do so using the above three files. The extraction procedure is |
| 1536 |
|
|
trivial: just copy the three files somewhere else and run |
| 1537 |
|
|
<tt>dpkg-source -x gentoo_0.9.12-1.dsc</tt>. |
| 1538 |
|
|
|
| 1539 |
|
|
<item><em>gentoo_0.9.12-1_i386.deb</em> |
| 1540 |
|
|
|
| 1541 |
|
|
<p>This is your completed binary package. You can use <prgn/dpkg/ to |
| 1542 |
|
|
install and remove this just like any other package. |
| 1543 |
|
|
|
| 1544 |
joy |
838 |
<item><em>gentoo_0.9.12-1_i386.changes</em> |
| 1545 |
joy |
1529 |
|
| 1546 |
joy |
838 |
<p>This file describes all the changes made in the current package |
| 1547 |
|
|
revision, and it is used by the Debian FTP archive maintenance programs |
| 1548 |
|
|
to install the binary and source packages in it. It is partly generated |
| 1549 |
osamu |
2676 |
from the `changelog' file and the .dsc file. This file is GPG signed, so |
| 1550 |
joy |
1529 |
that people can be sure that it's really yours. |
| 1551 |
joy |
838 |
|
| 1552 |
|
|
<p>As you keep working on the package, behavior will change and new |
| 1553 |
|
|
features will be added. People downloading your package can look at this |
| 1554 |
joy |
1529 |
file and quickly see what has changed. Debian archive maintenance programs |
| 1555 |
|
|
will also post the contents of this file to the debian-devel-changes |
| 1556 |
|
|
mailing list. |
| 1557 |
aph |
743 |
</list> |
| 1558 |
|
|
|
| 1559 |
joy |
1529 |
<p>The long strings of numbers in the .dsc and .changes files are MD5 |
| 1560 |
|
|
checksums for the files mentioned. |
| 1561 |
|
|
A person downloading your files can test them with <manref name="md5sum" |
| 1562 |
|
|
section="1"> and if the numbers don't match, they'll know the file is |
| 1563 |
|
|
corrupt or has been tampered with. |
| 1564 |
|
|
|
| 1565 |
|
|
<sect id="quickrebuild">Quick rebuild |
| 1566 |
|
|
|
| 1567 |
joy |
896 |
<p>With a large package, you may not want to rebuild from scratch every |
| 1568 |
joy |
1529 |
time while you tune a detail in <file>debian/rules</file>. For testing |
| 1569 |
|
|
purposes, you |
| 1570 |
joy |
896 |
can make a .deb file without rebuilding the upstream sources like this: |
| 1571 |
aph |
743 |
|
| 1572 |
joy |
896 |
<p><example> |
| 1573 |
|
|
fakeroot debian/rules binary |
| 1574 |
|
|
</example> |
| 1575 |
|
|
|
| 1576 |
joy |
1529 |
<p>Once you are finished with your tuning, remember to rebuild following |
| 1577 |
|
|
the above, proper procedure. You may not be able to upload correctly if |
| 1578 |
|
|
you try to upload .deb files built this way. |
| 1579 |
joy |
896 |
|
| 1580 |
osamu |
2680 |
<sect id="debuild">The <prgn>debuild</prgn> command |
| 1581 |
|
|
|
| 1582 |
|
|
<p>You can automate package build process further with |
| 1583 |
|
|
<prgn>debuild</prgn> command. |
| 1584 |
|
|
See <manref name="debuild" section="1">. |
| 1585 |
|
|
|
| 1586 |
|
|
<p>Customization of the debuild command can be done through |
| 1587 |
|
|
<file>/etc/devscripts.conf</file> or <file>~/.devscripts</file>. |
| 1588 |
|
|
I would suggest at least following items: |
| 1589 |
|
|
|
| 1590 |
|
|
<p><example> |
| 1591 |
|
|
DEBSIGN_KEYID="Your_SSH_keyID" |
| 1592 |
|
|
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -ICVS -I.svn" |
| 1593 |
|
|
</example> |
| 1594 |
|
|
With these, you can build package always with your GPG key and avoid |
| 1595 |
|
|
including undesired components. (This is good for sponsoring too.) |
| 1596 |
|
|
For example, cleaning source and rebuilding package from a user account |
| 1597 |
|
|
is as simple as: |
| 1598 |
|
|
|
| 1599 |
|
|
<p><example> |
| 1600 |
|
|
debuild clean |
| 1601 |
|
|
debuild |
| 1602 |
|
|
</example> |
| 1603 |
|
|
|
| 1604 |
osamu |
2685 |
<sect id="dpatch">The <prgn>dpatch</prgn> system |
| 1605 |
osamu |
2679 |
<p> |
| 1606 |
|
|
The simple use of <prgn>dh_make</prgn> and |
| 1607 |
|
|
<prgn>dpkg-buildpackage</prgn> commands will create a single large |
| 1608 |
|
|
<file>diff.gz</file> file which contains package maintenance files in |
| 1609 |
|
|
<file>debian/</file> and patch files to the source. Such package is a |
| 1610 |
|
|
bit cumbersome to inspect and understand for each source tree |
| 1611 |
|
|
modification later. This is not so nice. |
| 1612 |
|
|
<footnote> |
| 1613 |
|
|
If you are not yet Debian Developer and asking your sponsor to upload |
| 1614 |
|
|
your package after his package review, you should make package as easy |
| 1615 |
|
|
as possible for him to review. |
| 1616 |
|
|
</footnote> |
| 1617 |
|
|
<p> |
| 1618 |
|
|
Several methods for the patch set maintenance have been proposed and in |
| 1619 |
|
|
use with Debian packages. The <prgn>dpatch</prgn> system is one of the |
| 1620 |
|
|
simplest of such patch maintenance system proposed. Other ones are |
| 1621 |
|
|
dbs, cdbs, etc. |
| 1622 |
|
|
<p> |
| 1623 |
|
|
A package which is packaged properly with the <prgn>dpatch</prgn> system |
| 1624 |
|
|
has modifications to the source clearly documented as patch set files in |
| 1625 |
|
|
<file>debian/patches/</file> and the source tree is untouched outside of |
| 1626 |
|
|
<file>debian/</file> directory. If you are asking sponsor to upload |
| 1627 |
|
|
your package, this kind of clear separation and documentation of your |
| 1628 |
|
|
changes are very important to expedite the package review by your |
| 1629 |
|
|
sponsor. The usage method of <prgn>dpatch</prgn> is explained in |
| 1630 |
|
|
<manref section="1" name="dpatch">. |
| 1631 |
|
|
<p> |
| 1632 |
|
|
When someone (including yourself) provides you with a patch to the |
| 1633 |
|
|
source later, then the package modification under dpatch is quite |
| 1634 |
|
|
simple: |
| 1635 |
|
|
<list compact> |
| 1636 |
|
|
<item>Edit patch to make it a -p1 patch to the source tree. |
| 1637 |
|
|
<item>Add header using <prgn>dpatch patch-template</prgn> command. |
| 1638 |
|
|
<item>Drop it into <file>debian/patches</file> |
| 1639 |
|
|
<item>Add this dpatch filenames to <file>debian/patches/00list</file> |
| 1640 |
|
|
</list> |
| 1641 |
|
|
<p> |
| 1642 |
|
|
Also, <prgn>dpatch</prgn> has a capability to make patches architecture |
| 1643 |
|
|
dependent using CPP macro. |
| 1644 |
|
|
|
| 1645 |
|
|
<sect id="option-sa">Including <file>orig.tar.gz</file> for upload |
| 1646 |
|
|
<p> |
| 1647 |
|
|
When you first upload the package to the archive, you need to include |
| 1648 |
|
|
the original <file>orig.tar.gz</file> source. If package version is not |
| 1649 |
|
|
at <tt>-1</tt> debian revision, you must provide |
| 1650 |
|
|
<prgn>dpkg-buildpackage</prgn> command with the "<tt>-sa</tt>" option. |
| 1651 |
|
|
|
| 1652 |
|
|
|
| 1653 |
joy |
1527 |
<chapt id="checkit">Checking the package for errors |
| 1654 |
osamu |
2680 |
<p> |
| 1655 |
|
|
|
| 1656 |
osamu |
2681 |
<sect id="lintians">The <package>lintian</package> and <package>linda</package> packages |
| 1657 |
joy |
896 |
|
| 1658 |
osamu |
2669 |
<p>Run <manref name="lintian" section="1"> and |
| 1659 |
|
|
<manref name="linda" section="1"> on your .changes file; these |
| 1660 |
|
|
programs will check for many common packaging errors. The commands are: |
| 1661 |
aph |
743 |
|
| 1662 |
|
|
<p><example> |
| 1663 |
|
|
lintian -i gentoo_0.9.12-1_i386.changes |
| 1664 |
osamu |
2669 |
linda -i gentoo_0.9.12-1_i386.changes |
| 1665 |
aph |
743 |
</example> |
| 1666 |
|
|
|
| 1667 |
joy |
1530 |
<p>Of course, replace the filename with the name of the .changes file |
| 1668 |
joy |
896 |
generated for your package. If it appears that there are some errors |
| 1669 |
|
|
(lines beginning with E:), read the explanation (the N: lines), correct |
| 1670 |
joy |
1530 |
mistakes, and rebuild as described in <ref id="completebuild">. If there are |
| 1671 |
|
|
lines that begin with W:, those are warnings, so tune the package or |
| 1672 |
|
|
verify that the warnings are spurious (and make Lintian overrides; see |
| 1673 |
|
|
the documentation for details). |
| 1674 |
aph |
743 |
|
| 1675 |
osamu |
2669 |
<p>Note that you can build the package with <prgn/dpkg-buildpackage/ , run |
| 1676 |
|
|
<prgn/lintian/ , and <prgn/linda/ all in one command with |
| 1677 |
|
|
<manref name="debuild" section="1">. |
| 1678 |
|
|
|
| 1679 |
osamu |
2682 |
<sect id="dpkg-dev">The <prgn>dpkg-deb</prgn> andf <prgn>mc</prgn> commands |
| 1680 |
|
|
|
| 1681 |
|
|
<p>You can unpack contents of <file>*.deb</file> package with <manref |
| 1682 |
|
|
name="dpkg-deb" section="1"> command. This can be automated using |
| 1683 |
|
|
using a file manager like <manref name="mc" section="1"> which will |
| 1684 |
|
|
let you browse not only the contents of <file>*.deb</file> package |
| 1685 |
|
|
files but also <file>*.diff.gz</file> and <file>*.tar.gz</file> files. |
| 1686 |
|
|
<p> |
| 1687 |
joy |
1530 |
Be on the lookout for extra unneeded files, both in the binary and source |
| 1688 |
|
|
package. Often cruft doesn't get cleaned up properly; adjust your rules |
| 1689 |
|
|
file to compensate for that. Tips: `zgrep ^+++ ../gentoo_0.9.12-1.diff.gz` will give you a list of |
| 1690 |
joy |
896 |
your changes/additions to the source files, and `dpkg-deb -c gentoo_0.9.12-1_i386.deb` |
| 1691 |
joy |
1530 |
will list the files in the binary package. |
| 1692 |
joy |
838 |
|
| 1693 |
osamu |
2682 |
<sect id="debi">The <prgn>debi</prgn> command |
| 1694 |
|
|
|
| 1695 |
joy |
896 |
<p>Install the package to test it yourself, e.g. using the |
| 1696 |
|
|
<manref name="debi" section="1"> command as root. Try to install and run |
| 1697 |
|
|
it on machines other than your own and watch closely for any warnings |
| 1698 |
joy |
1530 |
or errors both during the installation and while the program is being run. |
| 1699 |
aph |
743 |
|
| 1700 |
osamu |
2676 |
<sect id="pbuilder">The <package>pbuilder</package> package |
| 1701 |
|
|
<p> |
| 1702 |
osamu |
2669 |
For clean room (chroot) build environment to verify the build |
| 1703 |
|
|
dependencies, <package>pbuilder</package> package is very useful. This |
| 1704 |
|
|
ensures clean build from source under autobuilder for different |
| 1705 |
|
|
architectures and avoid FTBFS bug which is release critical one. |
| 1706 |
|
|
<p> |
| 1707 |
|
|
The most basic use of <package>pbuilder</package> package is the direct |
| 1708 |
|
|
invocation of <prgn>pbuilder</prgn> command from root. For example, |
| 1709 |
|
|
issue following commands in the directory where <file>.orig.tar.gz</file>, |
| 1710 |
|
|
<file>.diff.gz</file>, and <file>.dsc</file> exist |
| 1711 |
|
|
to build a package. |
| 1712 |
|
|
<example> |
| 1713 |
|
|
root # pbuilder create # if second time, pbuilder update |
| 1714 |
|
|
root # pbuilder build foo.dsc |
| 1715 |
|
|
</example> |
| 1716 |
|
|
The newly build packages will be located in |
| 1717 |
|
|
<file>/var/cache/pbuilder/result/</file> with root ownership. |
| 1718 |
|
|
<p> |
| 1719 |
osamu |
2675 |
The <prgn>pdebuild</prgn> command helps you to use |
| 1720 |
|
|
<package>pbuilder</package> package functions from the normal user |
| 1721 |
|
|
account with <tt><var>numeric_UID</var></tt> and |
| 1722 |
|
|
<tt><var>numeric_GID</var></tt> . I would suggest first customize your |
| 1723 |
|
|
system by setting: |
| 1724 |
osamu |
2669 |
<example> |
| 1725 |
|
|
BUILDRESULTUID=<var>numeric_UID</var> |
| 1726 |
|
|
BUILDRESULTGID=<var>numeric_GID</var> |
| 1727 |
|
|
AUTO_DEBSIGN=yes |
| 1728 |
|
|
</example> |
| 1729 |
osamu |
2675 |
in <file>~/.pbuilderrc</file> or <file>/etc/pbuilderrc</file> . You |
| 1730 |
|
|
need to change the ownership of <file>/var/cache/pbuilder/result/</file> |
| 1731 |
|
|
to something like <tt><var>numeric_UID</var>:<var>numeric_GID</var></tt> |
| 1732 |
|
|
with the permission <tt>2775</tt> to enable signing from your user |
| 1733 |
|
|
account with <var>numeric_UID</var> where you keep your secret GPG key |
| 1734 |
|
|
under <file>~/.gnupg/</file>. You also need to set up this user account |
| 1735 |
|
|
with <prgn>sudo</prgn> command. |
| 1736 |
osamu |
2669 |
<p> |
| 1737 |
|
|
Then, from the root of source tree while having |
| 1738 |
osamu |
2675 |
<file>orig.tar.gz</file> file in its parent directory, you issue |
| 1739 |
osamu |
2669 |
following commands: |
| 1740 |
|
|
<example> |
| 1741 |
|
|
$ sudo pbuilder create # if second time, sudo pbuilder update |
| 1742 |
|
|
$ pdebuild |
| 1743 |
|
|
</example> |
| 1744 |
|
|
The newly build packages will be located in |
| 1745 |
|
|
<file>/var/cache/pbuilder/result/</file> with non-root ownership. |
| 1746 |
|
|
<p> |
| 1747 |
osamu |
2675 |
See <url id="&pbuilder-home;">, |
| 1748 |
osamu |
2669 |
<manref section="1" name="pdebuild">, |
| 1749 |
|
|
<manref section="5" name="pbuilderrc">, and |
| 1750 |
|
|
<manref section="8" name="pbuilder"> . |
| 1751 |
joy |
770 |
|
| 1752 |
osamu |
2669 |
|
| 1753 |
osamu |
2676 |
<chapt id="upload">Uploading the package |
| 1754 |
osamu |
2669 |
|
| 1755 |
joy |
1530 |
<p>Now that you have tested your new package thoroughly, you will be ready |
| 1756 |
|
|
to start the Debian new maintainer application process, as described at |
| 1757 |
|
|
<url id="http://www.debian.org/devel/join/newmaint"> |
| 1758 |
joy |
770 |
|
| 1759 |
joy |
1530 |
<p>Once you become an official developer, you'll need to upload the |
| 1760 |
|
|
package to the Debian archive. You can do this manually, but it's easier |
| 1761 |
|
|
to use the provided automated tools, like |
| 1762 |
|
|
<manref name="dupload" section="1"> or <manref name="dput" section="1">. |
| 1763 |
|
|
We'll describe how it's done with <prgn/dupload/. |
| 1764 |
aph |
743 |
|
| 1765 |
joy |
1531 |
<p>First you have to set up dupload's config file. You can either edit the |
| 1766 |
|
|
system-wide <file>/etc/dupload.conf</file> file, or have your own |
| 1767 |
|
|
<file>~/.dupload.conf</file> file override the few things you want to |
| 1768 |
|
|
change. Put something like this in the file: |
| 1769 |
aph |
743 |
|
| 1770 |
joy |
896 |
<p><example> |
| 1771 |
joy |
838 |
package config; |
| 1772 |
joy |
1553 |
|
| 1773 |
joy |
1530 |
$default_host = "ftp-master"; |
| 1774 |
joy |
1553 |
|
| 1775 |
|
|
$cfg{"ftp-master"}{"login"} = "yourdebianusername"; |
| 1776 |
|
|
|
| 1777 |
|
|
$cfg{"non-us"}{"login"} = "yourdebianusername"; |
| 1778 |
|
|
|
| 1779 |
joy |
838 |
1; |
| 1780 |
aph |
743 |
</example> |
| 1781 |
|
|
|
| 1782 |
joy |
838 |
<p>Of course, change my personal settings to yours, and read the |
| 1783 |
|
|
<manref name="dupload.conf" section="5"> manual page to understand |
| 1784 |
joy |
896 |
what each of these options means. |
| 1785 |
joy |
773 |
|
| 1786 |
joy |
1530 |
<p>The $default_host option is the trickiest one -- it determines which of |
| 1787 |
|
|
the upload queues will be used by default. "ftp-master" is the primary |
| 1788 |
|
|
one, but it's possible that you will want to use another, faster one. |
| 1789 |
|
|
For more information about the upload queues, read the Developers' |
| 1790 |
|
|
Reference, section "Uploading a package", at |
| 1791 |
osamu |
2666 |
<file>&uploading;</file> |
| 1792 |
joy |
1530 |
|
| 1793 |
joy |
893 |
<p>Then connect to your Internet provider, and issue this command: |
| 1794 |
aph |
743 |
|
| 1795 |
|
|
<p><example> |
| 1796 |
joy |
1530 |
dupload gentoo_0.9.12-1_i386.changes |
| 1797 |
aph |
743 |
</example> |
| 1798 |
|
|
|
| 1799 |
joy |
1530 |
<p><prgn/dupload/ checks that the MD5 checksums of the files match those from the |
| 1800 |
joy |
896 |
.changes file, so it will warn you to rebuild it as described in |
| 1801 |
joy |
1530 |
<ref id="completebuild"> so it can properly upload. |
| 1802 |
joy |
896 |
|
| 1803 |
joy |
1530 |
<p>If you upload to "ftp-master", <prgn/dupload/ will ask for your |
| 1804 |
|
|
password on Debian machines, and then upload the packages. |
| 1805 |
joy |
838 |
|
| 1806 |
osamu |
2676 |
<p>If you want to create a personal package archive at |
| 1807 |
osamu |
2684 |
<tt>URL="http://people.debian.org/~<var>account_name</var>"</tt> as a |
| 1808 |
osamu |
2683 |
developer with simple invocation of |
| 1809 |
|
|
<tt>dupload -t <var>target_name</var></tt>, you should add following |
| 1810 |
|
|
to <file>/etc/dupload.conf</file> file: |
| 1811 |
osamu |
2676 |
<example> |
| 1812 |
|
|
# Developer account |
| 1813 |
|
|
$cfg{'<var>target_name</var>'} = { |
| 1814 |
|
|
fqdn => "people.debian.org", |
| 1815 |
|
|
method => "scpb", |
| 1816 |
|
|
incoming => "/home/<var>account_name</var>/public_html/package/", |
| 1817 |
|
|
# I do not need to announce |
| 1818 |
|
|
dinstall_runs => 1, |
| 1819 |
|
|
}; |
| 1820 |
|
|
$cfg{'<var>target_name</var>'}{postupload}{'changes'} = " |
| 1821 |
|
|
echo 'mkdir -p public_html/package ; |
| 1822 |
|
|
cd public_html/package ; |
| 1823 |
|
|
dpkg-scanpackages . /dev/null >Packages || true ; |
| 1824 |
|
|
dpkg-scansources . /dev/null >Sources || true ; |
| 1825 |
|
|
gzip -c Packages >Packages.gz ; |
| 1826 |
|
|
gzip -c Sources >Sources.gz ' | ssh people.debian.org 2>/dev/null ; |
| 1827 |
|
|
echo 'Package archive created!'"; |
| 1828 |
|
|
</example> |
| 1829 |
|
|
Here, APT archive is built with a quick and dirty remote shell execution |
| 1830 |
|
|
with SSH. The override files required by <prgn>dpkg-scanpackages</prgn> |
| 1831 |
|
|
and <prgn>dpkg-scansources</prgn> are given as <file>/dev/null</file>. |
| 1832 |
|
|
This technique can be used by non Debian Developer to host his packages |
| 1833 |
|
|
in his personal web host site. |
| 1834 |
|
|
|
| 1835 |
|
|
|
| 1836 |
joy |
1524 |
<chapt id="update">Updating the package |
| 1837 |
aph |
743 |
|
| 1838 |
joy |
1524 |
<sect id="newrevision">New Debian revision |
| 1839 |
|
|
|
| 1840 |
joy |
896 |
<p>Let's say that a bug report was filed against your package, #54321, |
| 1841 |
|
|
and it describes a problem that you can solve. To create a new Debian |
| 1842 |
|
|
revision of the package, you need to: |
| 1843 |
|
|
|
| 1844 |
|
|
<list> |
| 1845 |
|
|
<item>Correct the problem in the package source, of course. |
| 1846 |
|
|
|
| 1847 |
joy |
1526 |
<item>Add a new revision at the top of the Debian changelog file, for |
| 1848 |
|
|
example with `dch -i`, or explicitly with |
| 1849 |
|
|
`dch -v <version>-<revision>` |
| 1850 |
|
|
and then insert the comments using your preferred editor. |
| 1851 |
|
|
|
| 1852 |
|
|
<p>Tip: how to easily get the date in required format? |
| 1853 |
|
|
Use `822-date`, or `date -R`. |
| 1854 |
|
|
|
| 1855 |
|
|
<item>Include a short description of the bug and the solution in the |
| 1856 |
|
|
changelog entry, |
| 1857 |
joy |
896 |
followed by this: "Closes: #54321". That way, the bug report will be |
| 1858 |
|
|
automagically closed by the archive maintenance software the moment your |
| 1859 |
|
|
package gets accepted in the Debian archive. |
| 1860 |
|
|
|
| 1861 |
joy |
1530 |
<item>Repeat what you did in <ref id="completebuild">, <ref id="checkit">, |
| 1862 |
joy |
896 |
and <ref id="upload">. The difference is that this time, original source |
| 1863 |
|
|
archive won't be included, as it hasn't been changed and it already |
| 1864 |
|
|
exists in the Debian archive. |
| 1865 |
|
|
</list> |
| 1866 |
|
|
|
| 1867 |
joy |
1524 |
<sect id="newupstream">New upstream release |
| 1868 |
|
|
|
| 1869 |
joy |
896 |
<p>Now let's consider a different, a wee bit more complicated situation |
| 1870 |
|
|
- a new upstream version was released, and of course you want it packaged. |
| 1871 |
|
|
You need to do the following: |
| 1872 |
|
|
|
| 1873 |
|
|
<list> |
| 1874 |
|
|
<item>Download the new sources and put the tarball (e.g. named |
| 1875 |
|
|
`gentoo-0.9.13.tar.gz') in the directory above the old source tree |
| 1876 |
|
|
(e.g. ~/debian/). |
| 1877 |
|
|
|
| 1878 |
|
|
<item>Enter the old source directory, and run: |
| 1879 |
|
|
|
| 1880 |
|
|
<example> |
| 1881 |
|
|
uupdate -u gentoo-0.9.13.tar.gz |
| 1882 |
|
|
</example> |
| 1883 |
|
|
|
| 1884 |
joy |
1530 |
<p>Of course, replace this file name with the name of your program's new source |
| 1885 |
joy |
896 |
archive. <manref name="uupdate" section="1"> will properly rename that |
| 1886 |
|
|
tarball, try to apply all the changes from your previous .diff.gz file, |
| 1887 |
|
|
and update the new debian/changelog file. |
| 1888 |
|
|
|
| 1889 |
|
|
<item>Change directory to `../gentoo-0.9.13', the new package source tree, |
| 1890 |
joy |
1530 |
and repeat what you did in <ref id="completebuild">, <ref id="checkit">, and |
| 1891 |
joy |
896 |
<ref id="upload">. |
| 1892 |
|
|
</list> |
| 1893 |
|
|
|
| 1894 |
|
|
<p>Note that if you set up `debian/watch' file as described in |
| 1895 |
|
|
<ref id="watch">, you can run <manref name="uscan" section="1"> to |
| 1896 |
joy |
1530 |
automagically look for revised sources, download them, and run |
| 1897 |
|
|
<prgn/uupdate/. |
| 1898 |
joy |
896 |
|
| 1899 |
osamu |
2676 |
<sect id="cvs-buildpackage">The <prgn>cvs-buildpackage</prgn> command and similes |
| 1900 |
|
|
<p> |
| 1901 |
|
|
You should consider to use some source code management system to manage. |
| 1902 |
|
|
There are several wrapper scripts which are customized to use most |
| 1903 |
|
|
popular one. |
| 1904 |
|
|
<list compact> |
| 1905 |
|
|
<item>CVS |
| 1906 |
|
|
<list compact> |
| 1907 |
|
|
<item><package>cvs-buildpackage</package> |
| 1908 |
|
|
</list> |
| 1909 |
|
|
<item>Subversion |
| 1910 |
|
|
<list compact> |
| 1911 |
|
|
<item><package>svn-buildpackage</package> |
| 1912 |
|
|
</list> |
| 1913 |
|
|
<item>Arch (tla) |
| 1914 |
|
|
<list compact> |
| 1915 |
|
|
<item><package>tla-buildpackage</package> |
| 1916 |
|
|
<item><package>arch-buildpackage</package> |
| 1917 |
|
|
</list> |
| 1918 |
|
|
</list> |
| 1919 |
|
|
<p> |
| 1920 |
|
|
These commands also automate the packaging of new upstream release. |
| 1921 |
|
|
|
| 1922 |
joy |
1530 |
<sect id="upgrading">Verifying package upgrades |
| 1923 |
|
|
|
| 1924 |
|
|
<p>When you build a new version of the package, you should do the |
| 1925 |
|
|
following to verify that the package can be safely upgraded: |
| 1926 |
|
|
|
| 1927 |
|
|
<list> |
| 1928 |
|
|
<item>upgrade from the previous version |
| 1929 |
|
|
<item>downgrade back again and then remove it, |
| 1930 |
|
|
<item>install the new package |
| 1931 |
|
|
<item>remove it and then reinstall it again, |
| 1932 |
|
|
<item>purge it. |
| 1933 |
|
|
</list> |
| 1934 |
|
|
|
| 1935 |
|
|
<p>Bear in mind that if your package has previously been released in |
| 1936 |
|
|
Debian, people will often be upgrading to your package from the version |
| 1937 |
joy |
1587 |
that was in the last Debian release. Remember to test upgrades from that |
| 1938 |
joy |
1530 |
version, too. |
| 1939 |
|
|
|
| 1940 |
joy |
1524 |
<chapt id="helpme">Where to ask for help |
| 1941 |
joy |
896 |
|
| 1942 |
joy |
838 |
<p>Before you decide to ask your question in some public place, please |
| 1943 |
joy |
1530 |
just RTFM. That includes documentation in <file>/usr/share/doc/dpkg</file>, |
| 1944 |
|
|
<file>/usr/share/doc/debian</file>, <file>/usr/share/doc/package/*</file> |
| 1945 |
|
|
files and the man/info pages for all the programs mentioned in this document. |
| 1946 |
osamu |
2674 |
See also |
| 1947 |
|
|
<url id="&mentors-faq;">. |
| 1948 |
joy |
1530 |
|
| 1949 |
|
|
<p>If you have questions about packaging that you couldn't find answers to |
| 1950 |
|
|
in the documentation, you can ask them on the Debian Mentors' mailing list |
| 1951 |
|
|
at <email/debian-mentors@lists.debian.org/. The more experienced Debian |
| 1952 |
|
|
developers will gladly help you, but do read at least some of the |
| 1953 |
|
|
documentation before asking a question! |
| 1954 |
|
|
|
| 1955 |
|
|
<p>See <url id="http://lists.debian.org/debian-mentors/"> for more |
| 1956 |
|
|
information about this mailing list. |
| 1957 |
|
|
|
| 1958 |
|
|
<p>When you receive |
| 1959 |
joy |
838 |
a bug report (yes, actual bug reports!), you will know that it is time |
| 1960 |
|
|
that you dig in the <url name="Debian Bug Tracking System" id="http://www.debian.org/Bugs/"> |
| 1961 |
|
|
and read the documentation there, to be able to deal with the reports |
| 1962 |
joy |
1531 |
efficiently. I highly recommend reading the Developers' Reference, |
| 1963 |
|
|
chapter "Handling Bugs", at |
| 1964 |
osamu |
2666 |
<file>&bughandling;</file> |
| 1965 |
aph |
743 |
|
| 1966 |
joy |
770 |
<p>If you still have questions, ask on the Debian Developers' mailing list |
| 1967 |
joy |
1530 |
at <email/debian-devel@lists.debian.org/. See |
| 1968 |
|
|
<url id="http://lists.debian.org/debian-devel/"> for more information |
| 1969 |
|
|
about this mailing list. |
| 1970 |
aph |
743 |
|
| 1971 |
|
|
<p>Even if it all worked well, it's time to start praying. Why? Because |
| 1972 |
|
|
in just a few hours (or days) users from all around the world will start |
| 1973 |
|
|
to use your package, and if you made some critical error you'll get |
| 1974 |
|
|
mailbombed by numerous angry Debian users... Just kidding. :-) |
| 1975 |
|
|
|
| 1976 |
|
|
<p>Relax and be ready for bug reports, because there is a lot more work |
| 1977 |
joy |
1530 |
to be done before your package will be fully in line with Debian policies |
| 1978 |
|
|
(once again, read the <em>real documentation</em> for details). Good luck! |
| 1979 |
aph |
743 |
|
| 1980 |
|
|
</book> |
| 1981 |
|
|
|
| 1982 |
|
|
</debiandoc> |