logo资料库

Debian New Maintainers’ Guide.pdf

第1页 / 共65页
第2页 / 共65页
第3页 / 共65页
第4页 / 共65页
第5页 / 共65页
第6页 / 共65页
第7页 / 共65页
第8页 / 共65页
资料共65页,剩余部分请下载后查看
Getting started The Right Way
Social dynamics of Debian
Programs needed for development
Documentation needed for development
Where to ask for help
First steps
Debian package building workflow
Choose your program
Get the program, and try it out
Simple build systems
Popular portable build systems
Package name and version
Setting up dh_make
Initial non-native Debian package
Initial native Debian package
Modifying the source
Setting up quilt
Fixing upstream bugs
Installation of files to their destination
Differing libraries
Required files under the debian directory
control
copyright
changelog
rules
Targets of the rules file
Default rules file
Customization of rules file
Other files under the debian directory
README.Debian
compat
conffiles
package.cron.*
dirs
package.doc-base
docs
emacsen-*
package.examples
package.init and package.default
install
package.info
package.links
{package.,source/}lintian-overrides
manpage.*
manpage.1.ex
manpage.sgml.ex
manpage.xml.ex
package.manpages
menu
NEWS
{pre,post}{inst,rm}
package.symbols
TODO
watch
source/format
source/local-options
source/options
patches/*
Building the package
Complete (re)build
Autobuilder
debuild command
pbuilder package
git-buildpackage command and similars
Quick rebuild
Checking the package for errors
Suspicious changes
Verifying a package's installation
Verifying a package's maintainer scripts
Using lintian
The debc command
The debdiff command
The interdiff command
The mc command
Updating the package
New Debian revision
Inspection of the new upstream release
New upstream release
Updating the packaging style
UTF-8 conversion
Reminders for updating packages
Uploading the package
Uploading to the Debian archive
Including orig.tar.gz for upload
Skipped uploads
Advanced packaging
Shared libraries
Managing debian/package.symbols
Multiarch
Building a shared library package
Debian New Maintainers’ Guide i Debian New Maintainers’ Guide
Debian New Maintainers’ Guide ii Copyright © 1998-2002 Josip Rodin Copyright © 2005-2013 Osamu Aoki Copyright © 2010 Craig Small Copyright © 2010 Raphaël Hertzog This document may be used under the terms the GNU General Public License version 2 or higher. This document was made using these two documents as examples: • Making a Debian Package (AKA the Debmake Manual), copyright © 1997 Jaldhar Vyas. • The New-Maintainer’s Debian Packaging Howto, copyright © 1997 Will Lowe.
Debian New Maintainers’ Guide iii COLLABORATORS TITLE : Debian New Maintainers’ Guide ACTION NAME DATE SIGNATURE WRITTEN BY Josip Rodin and Osamu Aoki January 6, 2014 NUMBER DATE DESCRIPTION NAME REVISION HISTORY
Debian New Maintainers’ Guide Contents 1 Getting started The Right Way . 1.1 Social dynamics of Debian . . . . . . 1.2 Programs needed for development . . . 1.3 Documentation needed for development 1.4 Where to ask for help . . . . . . . . . . 2 First steps . . 2.1 Debian package building workflow . . . . . 2.2 Choose your program . . . . . . 2.3 Get the program, and try it out . . 2.4 Simple build systems . . . . . 2.5 Popular portable build systems . . . . . . 2.6 Package name and version . 2.7 Setting up dh_make . . . . . Initial non-native Debian package . . 2.8 2.9 Initial native Debian package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Modifying the source . . . . Installation of files to their destination . 3.1 Setting up quilt . . . 3.2 Fixing upstream bugs . . 3.3 3.4 Differing libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 control . . 4.2 copyright . . 4.3 changelog . . . 4.4 rules . 4 Required files under the debian directory . . . . . . . . . . . . . . . . . . . 4.4.1 Targets of the rules file 4.4.2 Default rules file . . . . . 4.4.3 Customization of rules file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv 1 1 3 4 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 6 . . . . . . . . . 7 . . . . . . . . . . . . . . . 9 . . . . . . . . . 10 . . . . . . . . . 10 . . . 11 . . . . . . . . . . . . . . . 11 . . . . . . . . . . . 12 . . . . . . . . 13 . . 14 . . . . . . 14 . . . . . . 14 . . . . . . 15 . . . . . . 17 . . . . . . . . . . . . 18 . . . . . . . 18 . . . . . . . 22 . . . . . . . 23 . . . . . . . 24 . . . . . . . 24 . . . . . . . 25 . . . . . . . 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Debian New Maintainers’ Guide v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Other files under the debian directory . . . . . . . . . . . . 5.1 README.Debian . . . . . 5.2 compat . . . . . 5.3 conffiles . . . . . . 5.4 package.cron.* . . . . 5.5 dirs . . . . 5.6 package.doc-base . . . . 5.7 docs . . . . . 5.8 emacsen-* . . . . 5.9 package.examples . . . . 5.10 package.init and package.default . . . 5.11 install . . . . . 5.12 package.info . . 5.13 package.links . . 5.14 {package.,source/}lintian-overrides . . 5.15 manpage.* . . . . . . . . . . . . . . . . . . . 5.15.1 manpage.1.ex . . 5.15.2 manpage.sgml.ex . . 5.15.3 manpage.xml.ex . . . 5.16 package.manpages . . . . . 5.17 menu . . 5.18 NEWS . . . 5.19 {pre,post}{inst,rm} . . . . 5.20 package.symbols . . . . . 5.21 TODO . . . 5.22 watch . . . . . 5.23 source/format . . . . 5.24 source/local-options . . 5.25 source/options . . 5.26 patches/* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Building the package . . . . . 6.1 Complete (re)build . . . 6.2 Autobuilder . . . 6.3 debuild command . . . 6.4 pbuilder package . . 6.5 6.6 Quick rebuild . . . . . . . . . . git-buildpackage command and similars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 . . . . . . . 30 . . . . . . . . . . . . . 31 . . . . . . . . . . . . 31 . . . . . . . . . . . . . 31 . . . . . . . . . . . . . . 32 . . . . . . . . . . . . 32 . . . . . . . . . . . . . 32 . . . . . . . . . . . . . . 32 . . . . . . . . . . . . 33 . . . . . . . . . . . . . 33 . . . . . . . . . . . . . . 33 . . . . . . . . . . . . 33 . . . . . . . . . . . . . . 34 . . . . . . . . . . . . 34 . . . . . . . . . . . . . 34 . . . . . . . . . . . . . . . . . . . . 34 . . . . . . 35 . . . . . . . . . . . . . . 35 . . . . . . . . . . . . . . . . . . . 35 . . . . . . 35 . . . . . . . . . . . . . . . . . . . . 36 . . . . . . . . . . . . . 36 . . . . . . 37 . . . . . . . . . . . . . . . . . . . . 37 . . . . . . . . . . . . . 37 . . . . . . 37 . . . . . . . . . . . . . . . . . . . . 38 . . . . . . 38 . . . . . . . . . . . . . . . . . . . . 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 . . . . . . . 40 . . . . . . . . 41 . . . . . . 42 . . . . . . . . 43 . . . . . . . . . . 44 . . . . . . 45 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Debian New Maintainers’ Guide 7 Checking the package for errors . . . . . . . . . . . . 7.1 Suspicious changes . . . 7.2 Verifying a package’s installation . . 7.3 Verifying a package’s maintainer scripts . . . . 7.4 Using lintian . . 7.5 The debc command . . . . 7.6 The debdiff command . . . . 7.7 The interdiff command . . . . 7.8 The mc command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Updating the package . . . . . . . 8.1 New Debian revision . . 8.2 . 8.3 New upstream release . . . . 8.4 Updating the packaging style . 8.5 UTF-8 conversion . . . 8.6 Reminders for updating packages . . . . . Inspection of the new upstream release . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Uploading the package 9.1 Uploading to the Debian archive . . 9.2 9.3 Skipped uploads . . . Including orig.tar.gz for upload . . . . . . . . . . . . . . . . A Advanced packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1 Shared libraries . . . A.2 Managing debian/package.symbols . . . A.3 Multiarch . . . A.4 Building a shared library package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi 46 . . . . . . 46 . . . . . . 46 . . . . . . 46 . . . . . . 47 . . . . . . 48 . . . . . . 48 . . . . . . 48 . . . . . . 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 . . . . . . 49 . . . . . . . 50 . . . . . . . 50 . . . . . . . . 51 . . . . . . . . 52 . . . . . . . . . . . . 52 53 . . . . . . 53 . . . . . . 54 . . . . . . 54 55 . . . . . . 55 . . . . . . 56 . . . . . . 57 . . . . . . 58 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Debian New Maintainers’ Guide 1 / 59 Chapter 1 Getting started The Right Way This document tries to describe the building of a Debian package to ordinary Debian users and prospective developers. It uses fairly non-technical language, and it’s well covered with working examples. There is an old Latin saying: Longum iter est per praecepta, breve et efficax per exempla (It’s a long way by the rules, but short and efficient with examples). This document has been updated for the Debian squeeze release. 1 One of the things that makes Debian such a top-notch distribution is its package system. While there is a vast quantity of software already in the Debian format, sometimes you need to install software that isn’t. You may be wondering how you can make your own packages; and perhaps you think it is a very difficult task. Well, if you are a real novice on Linux, it is hard, but if you were a rookie, you wouldn’t be reading this document now :-) You do need to know a little about Unix programming but you certainly don’t need to be a wizard. 2 One thing is certain, though: to properly create and maintain Debian packages takes many hours. Make no mistake, for our system to work the maintainers need to be both technically competent and diligent. If you need some help on packaging, please read Section 1.4. Newer versions of this document should always be available online at http://www.debian.org/doc/maint-guide/ and in the maint- guide package. The translations may be available in packages such as maint-guide-es. Please note that this documentation may be slightly outdated. Since this is a tutorial, I choose to explain each detailed step for some important topics. Some of them may look irrelevant to you. Please be patient. I have also intentionally skipped some corner cases and provided only pointers to keep this document simple. 1.1 Social dynamics of Debian Here are some observations of Debian’s social dynamics, presented in the hope that it will prepare you for interactions with Debian. • We all are volunteers. – You cannot impose on others what to do. – You should be motivated to do things by yourself. • Friendly cooperation is the driving force. – Your contribution should not overstrain others. 1 The document assumes you are using a squeeze or newer system. If you need to follow this text in an older system (including an older Ubuntu system etc.), you must install backported dpkg and debhelper packages, at least. 2 You can learn about the basic handling of a Debian system from the Debian Reference (http://www.debian.org/doc/manuals/debian-reference/) . It contains some pointers to learn about Unix programming, too.
Debian New Maintainers’ Guide 2 / 59 – Your contribution is valuable only when others appreciate it. • Debian is not your school where you get automatic attention of teachers. – You should be able to learn many things by yourself. – Attention from other volunteers is a very scarce resource. • Debian is constantly improving. – You are expected to make high quality packages. – You should adapt yourself to change. There are several types of people interacting around Debian with different roles. • upstream author: the person who made the original program. • upstream maintainer: the person who currently maintains the program. • maintainer: the person making the Debian package of the program. • sponsor: a person who helps maintainers to upload packages to the official Debian package archive (after checking their contents). • mentor: a person who helps novice maintainers with packaging etc. • Debian Developer (DD): a member of the Debian project with full upload rights to the official Debian package archive. • Debian Maintainer (DM): a person with limited upload rights to the official Debian package archive. Please note that you cannot become an official Debian Developer (DD) overnight, because it takes more than technical skill. Please do not be discouraged by this. If it is useful to others, you can still upload your package either as a maintainer through a sponsor or as a Debian Maintainer. Please note that you do not need to create any new package to become an official Debian Developer. Contributing to the existing packages can provide a path to becoming an official Debian Developer too. There are many packages waiting for good maintainers (see Section 2.2). Since we focus only on technical aspects of packaging in this document, please refer to the following to learn how Debian functions and how you can get involved. • Debian: 17 years of Free Software, ”do-ocracy”, and democracy (http://upsilon.cc/~zack/talks/2011/20110321-taipei.pdf) (In- troductory slides) • How can you help Debian? (http://www.debian.org/intro/help) (official) • The Debian GNU/Linux FAQ, Chapter 13 - ”Contributing to the Debian Project” (http://www.debian.org/doc/FAQ/ch-contributing) (semi-official) • Debian Wiki, HelpDebian (http://wiki.debian.org/HelpDebian) (supplemental) • Debian New Member site (https://nm.debian.org/) (official) • Debian Mentors FAQ (http://wiki.debian.org/DebianMentorsFaq) (supplemental)
分享到:
收藏