Full Circle THE INDEPENDENT MAGAZINE FOR THE UBUNTU LINUX COMMUNITY
UBUNTU DEVELOPMENT SERIES SPECIAL EDITION
SINGLE TOPIC SERIES FROM MAGAZINE ISSUES #49 - #52 Full Circle Magazine is neither affiliated, with nor endorsed by, Canonical Ltd. Full Circle Magazine Specials About Full Circle Full Circle is a free, Find Us independent, magazine Website: dedicated to the Ubuntu http://www.fullcirclemagazine.org/ family of Linux operating systems. Each month, it Forums: contains helpful how-to http://ubuntuforums.org/ articles and reader- forumdisplay.php?f=270 submitted stories. Welcome to another 'single-topic special' IRC: #fullcirclemagazine on Full Circle also features a In response to reader requests, we are assembling the chat.freenode.net companion podcast, the Full content of some of our serialised articles into dedicated Editorial Team Circle Podcast which covers editions. the magazine, along with Editor: Ronnie Tucker other news of interest. For now, this is a straight reprint of the series 'Ubuntu (aka: RonnieTucker) Development', Parts 1-4, by Daniel Holbach from issues [email protected] Please note: this Special #49 through #52; nothing fancy, just the facts. Webmaster: Rob Kerfia Edition is provided with (aka: admin / linuxgeekery- Please bear in mind the original publication date; current [email protected] absolutely no warranty versions of hardware and software may differ from those whatsoever; neither the Podcaster: Robin Catling contributors nor Full Circle illustrated, so check your hardware and software versions before attempting to emulate the tutorials in these special (aka RobinCatling) Magazine accept any [email protected] responsibility or liability for editions. You may have later versions of software installed loss or damage resulting from or available in your distributions' repositories. Communications Manager: readers choosing to apply this Robert Clipsham content to theirs or others Enjoy! (aka: mrmonday) - computers and equipment. [email protected]
The articles contained in this magazine are released under the Creative Commons Attribution-Share Alike 3.0 Unported license. This means you can adapt, copy, distribute and transmit the articles but only under the following conditions: You must attribute the work to the original author in some way (at least a name, email or URL) and to this magazine by name ('full circle magazine') and the URL www.fullcirclemagazine.org (but not attribute the article(s) in any way that suggests that they endorse you or your use of the work). If you alter, transform, or build upon this work, you must distribute the resulting work under the same, similar or a compatible license. Full Circle Magazine is entirely independent of Canonical, the sponsor of Ubuntu projects and the views and opinions in the magazine should in no way be assumed to have Canonical endorsement.
Full Circle Magazine HHOOWW--TTOO Written by Daniel Holbach IInnttrroo TToo UUbbuunnttuu DDeevveellooppmmeenntt
buntu is made up of to an archive or mirror. Every day strict freeze dates. With every fixed, and a release candidate thousands of different CD images are built for a selection freeze date that is reached, release is made, and if it does not components, written in of different Ubuntu flavours. developers are expected to make contain any serious problems, it U many different Ubuntu Desktop, Ubuntu Server, fewer, less-intrusive changes. becomes the final release. programming languages. Every Kubuntu, and others, specify a list Feature Freeze is the first big component - be it a software of required packages that get on freeze date after the first half of Thousands of source packages, library, a tool, or a graphical the CD. These CD images are then the cycle has passed. At this stage, billions of lines of code, and application - is available as a used for installation tests, and features must be largely hundreds of contributors, require source package. Source packages provide the feedback for further implemented. The rest of the cycle a lot of communication and in most cases consist of two parts: release planning. is supposed to be focused on planning to maintain high the actual source code, and fixing bugs. After that, the user standards of quality. At the metadata. Metadata includes the Ubuntu’s development is very interface, then the beginning of each release cycle, dependencies of the package, much dependent on the current documentation, the kernel, etc, we have the Ubuntu Developer copyright and licensing stage of the release cycle. We are frozen, then the beta release is Summit where developers and information, and instructions on release a new version of Ubuntu put out which receives a lot of contributors come together to how to build the package. Once every six months, which is possible testing. From the beta release plan the features of the next this source package is compiled, only because we have established onwards, only critical bugs get releases. Every feature is the build process provides binary packages, which are the .deb files users can install.
Every time a new version of an application is released, or when someone makes a change to the source code that goes into Ubuntu, the source package must be uploaded to the build machines to be compiled. The resulting binary packages then are distributed to the archive and its mirrors in different countries. The URLs in /etc/apt/sources.list point
full circle magazine #49 17 contents ^ HOWTO - INTRO TO UBUNTU DEVELOPMENT discussed by its stakeholders, and a specification is written that contains detailed information about its assumptions, implementation, the necessary changes in other places, how to test it, and so on. This is all done in an open and transparent fashion, so even if you cannot attend the event in person, you can participate remotely and listen to a streamcast, chat with attendants, and subscribe to changes of specifications - so you are always up to date. collected in that report and its Upstreams get users, bug reports, willingness. Not every single change can be importance, status, and assignee, and patches, from Ubuntu (and discussed in a meeting though, updated when necessary. This other distributions). Getting a change into Ubuntu particularly because Ubuntu relies makes it an effective tool to stay as a new contributor is not as on changes that are done in other on top of bugs in a package or The most important Upstream daunting as it seems, and can be a projects. That is why contributors project, and organise the workload. for Ubuntu is Debian. Debian is the very rewarding experience. It is to Ubuntu constantly stay in touch. distribution that Ubuntu is based not only about learning something Most teams or projects use Most of the software available on, and many of the design new and exciting, but also about dedicated mailing lists to avoid too through Ubuntu is not written by decisions regarding the packaging sharing the solution, and solving a much unrelated noise. For more Ubuntu developers themselves. infrastructure are made there. problem for millions of users out immediate coordination, Most of it is written by developers Traditionally, Debian has always there. developers and contributers use of other Open Source projects, and had dedicated maintainers for Internet Relay Chat (IRC). All then integrated into Ubuntu. every single package or dedicated Open Source Development discussions are open and public. These projects are called maintenance teams. In Ubuntu happens in a distributed world “Upstreams”, because their source there are teams that have an with different goals and different Another important tool code flows into Ubuntu, where we interest in a subset of packages areas of focus. For example, there regarding communication is bug “just” integrate it. The relationship too, and naturally every developer might be the case that a particular reports. Whenever a defect is to Upstreams is critically has a special area of expertise, but Upstream might be interested in found in a package or piece of important to Ubuntu. It is not just participation (and upload rights) working on a new big feature, infrastructure, a bug report is filed code that Ubuntu gets from generally is open to everyone who while Ubuntu, because of the tight in Launchpad. All information is Upstreams, but it is also that demonstrates ability and release schedule, might be
full circle magazine #49 18 contents ^ HOWTO - INTRO TO UBUNTU DEVELOPMENT interested in shipping a solid and users, then build the package again,” not being afraid version with just an additional bug to test it. After you have tested it, to read documentation A PLEA ON BEHALF OF THE fix. That is why we make use of you can easily propose the change and ask questions, being “Distributed Development”, where to be included in the current a team player, and PODCAST PARTY code is being worked on in various Ubuntu development release. A enjoying some detective branches that are merged with developer with upload rights will work. As you heard in episode #15 of the each other after code reviews and review it for you, and then get it podcast, we're calling for opinion topics sufficient discussion. integrated into Ubuntu. Good places to ask for that section of the show. your questions are In the example mentioned When trying to find a solution, ubuntu-motu- Instead of us having a rant about above, it would make sense to ship it is usually a good idea to check [email protected] whatever strikes us, why not prompt us Ubuntu with the existing version with Upstream and see if the m and #ubuntu-motu on with a topic and watch for the mushroom of the project, add the bugfix, get problem (or a possible solution) is irc.freenode.net. You will clouds over the horizon! It's highly it into Upstream for their next known already, and, if not, do your easily find a lot of new unlikely that the three of us will agree. release, and ship that (if suitable) best to make the solution a friends and people with in the next Ubuntu release. It concerted effort. Additional steps the same passion that Or, an even more radical thought, send us would be the best possible might involve getting the change you have: making the an opinion by way of a contribution! compromise and a situation where backported to an older, still world a better place by everybody wins. supported, version of Ubuntu, and making better Open You can post comments and opinions on forwarding it to Upstream. Source software. the podcast page at To fix a bug in Ubuntu, you fullcirclemagazine.org, in our Ubuntu would first get the source code for The most important Forums section, or email the package, then work on the fix, requirements for success in [email protected]. You can document it so it is easy to Ubuntu development are having a also send us a comment by recording an understand for other developers knack for “making things work audio clip of no more than 30 seconds and sending it to the same address. Comments and audio may be edited for length. Please remember this is a family-friendly show.
It would be great to have contributors come on the show and express an opinion in person.
full circle magazine #49 19 contents ^ HHOOWW--TTOO Written by Daniel Holbach UUbbuunnttuu DDeevveellooppmmeenntt PPtt.. 22-- SSeett UUpp
here are a number of changes in the same environment create a cryptographic key with things you need to do to where those changes will actually which you will sign files you want get started developing be applied and used. to upload to Launchpad. T for Ubuntu. This article is pbuilder – a tool to do designed to get your computer set Don’t worry, though, the reproducible builds of a package in up so that you can start working Ubuntu development release wiki a clean and isolated environment. number of purposes. In our case, it with packages, and upload your page ubuntu-dev-tools (and devscripts, is important that you can sign files packages to Launchpad. Here’s (https://wiki.ubuntu.com/UsingDev a direct dependency) – a collection with your key so they can be what we’ll cover: elopmentReleases) shows a of tools that make many packaging identified as something that you variety of ways to safely use the tasks easier. worked on. If you upload a source • Installing packaging-related development release. bzr-builddeb (and bzr, a package to Launchpad, it will software. This includes: dependency) – distributed version- accept the package only if it can • Ubuntu-specific packaging control tools that make it easy for Install Basic Packaging absolutely determine who utilities many developers to collaborate uploaded the package. • Encryption software so your Software and work on the same code while work can be verified as being done keeping it trivial to merge each There are a number of tools To generate a new GPG key, run: by you other’s work. that will make your life as an • Additional encryption software apt-file provides an easy way to Ubuntu developer much easier. gpg --gen-key so you can securely transfer files find the binary package that You will encounter these tools • Creating and configuring your contains a given file. later in this guide. To install most GPG will first ask you which account on Launchpad apt-cache (part of the apt of the required tools, run this kind of key you want to generate. • Setting up your development package) provides even more command: Choosing the default (RSA and environment to help you do local information about packages on DSA) is fine. Next it will ask you builds of packages, interact with Ubuntu. sudo apt-get install gnupg about the keysize. The default other developers, and propose pbuilder ubuntu-dev-tools (currently 2048) is fine, but 4096 is your changes on Launchpad. bzr-builddeb apt-file Create your GPG key more secure. Afterwards, it will ask you if you want it to expire the This command will install the GPG stands for GNU Privacy key at some stage. It is safe to say Note: It is advisable to do following software: Guard and it implements the “0”, which means the key will never packaging work using the current OpenPGP standard which allows expire. The last questions will be development version of Ubuntu. gnupg – GNU Privacy Guard you to sign and encrypt messages about your name and email Doing so will allow you to test contains tools you will need to and files. This is useful for a address. Just pick the ones you are
full circle magazine #50 17 contents ^ HOWTO - UBUNTU DEVELOPMENT 2 - SET UP going to use for Ubuntu gpg --send-keys
full circle magazine #50 18 contents ^ HOWTO - UBUNTU DEVELOPMENT 2 - SET UP our code, but also things like that your Ubuntu developer sub 4096R/51FBE68C 2010-12- window. translations, bug reports and colleagues will be able to get to 06 information about the people who know you better. Back on the Launchpad work on Ubuntu and their team Head to website, use the Confirm button memberships. You will also use When you register a new https://launchpad.net/people/+me and Launchpad will complete the Launchpad to publish your account, Launchpad will send you /+editpgpkeys and copy the part import of your OpenPGP key. proposed fixes, and get other an email with a link you need to about your “Key fingerprint” into Ubuntu developers to review and open in your browser in order to the text box. In the case above this Find more information at sponsor them. verify your email address. If you would be 5C28 0144 FB08 91C0 https://help.launchpad.net/YourAc don’t receive it, check in your spam 2CF3 37AC 6F0B F90F 43CD E61D. count/ImportingYourPGPKey You will need to register with folder. Now click on “Import Key”. Launchpad and provide a minimal Upload your SSH key to amount of information. This will The new account help page Launchpad will use the allow you to download and upload (https://help.launchpad.net/YourAc fingerprint to check the Ubuntu Launchpad code, submit bug reports, and count/NewAccount) on Launchpad key server for your key and, if more. has more information about the successful, send you an encrypted Open process, and additional settings email asking you to confirm the https://launchpad.net/people/+me you can change. key import. Check your email /+editsshkeys in a web browser, Get a Launchpad account, and read the email that also open ~/.ssh/id_rsa.pub in a account Upload your GPG key to Launchpad sent you. If your email text editor. This is the public part Launchpad client supports OpenPGP of your SSH key, so it is safe to If you don’t already have a encryption, it will prompt you for share it with Launchpad. Copy the Launchpad account, you can easily To find out about your GPG the password you chose for the contents of the file and paste create one (at: fingerprint, run: key when GPG generated it. Enter them into the text box on the web https://launchpad.net/+login). If the password, then click the link to page that says “Add an SSH key”. you have a Launchpad account but gpg --fingerprint confirm that the key is yours. Now click “Import Public Key”. cannot remember your Launchpad
full circle magazine #50 19 contents ^ HOWTO - UBUNTU DEVELOPMENT 2 - SET UP Bazaar is the tool we use to store code changes in a logical export DEBFULLNAME="Bob way, to exchange proposed Dobbs" A PLEA ON BEHALF OF THE changes and merge them, even if export PODCAST PARTY development is done concurrently. DEBEMAIL="[email protected] To tell Bazaar who you are, simply om" As you heard in episode #15 of the podcast, run: we're calling for opinion topics for that section Now save the file, and either of the show. bzr whoami "Bob Dobbs restart your terminal or run:
full circle magazine #50 20 contents ^ HHOOWW--TTOO Written by Daniel Holbach UUbbuunnttuu DDeevveellooppmmeenntt PPtt.. 33 -- BBuugg FFiixxiinngg
f you followed the Debian already, instructions to get set up with lists small bugs Ubuntu Development, you (we call them I should be all set and ready to ‘bitesize’), and so go. on. Check it out and find your first As you can see in the image bug to work on. shiwn right, there are no surprises in the process of fixing bugs in Figuring out Ubuntu: you found a problem, you get the code, work on the fix, test what to fix it, push your changes to If you don’t Launchpad, and ask for it to be know the source reviewed and merged. In this package guide we will go through all the containing the code that has the necessary steps one-by-one. problem, but you do know the This would print out: In this case, nothing is printed, path to the affected program on meaning that tomboy is also the Finding the problem your system, you can discover the tomboy: /usr/bin/tomboy name of the binary package. An source package that you’ll need to example where the source and There are a lot of different work on. Note that the part preceding binary package names differ is ways to find things to work on. It the colon is the binary package python-vigra. While that is the might be a bug report you are Let’s say you’ve found a bug in name. It’s often the case that the binary package name, the source encountering yourself (which gives Tomboy, a note taking desktop source package and binary package is actually libvigraimpex you a good opportunity to test the application. The Tomboy package will have different names. and can be found with this fix), or a problem you noted application can be started by This is most common when a single command (and its output): elsewhere, maybe in a bug report. running /usr/bin/tomboy on the source package is used to build command line. To find the binary multiple different binary packages. apt-cache show python-vigra Harvest is where we keep track package containing this To find the source package for a | grep ^Source: of various TODO lists regarding application, use this command: particular binary package, type: Ubuntu development. It lists bugs Source: libvigraimpex that were fixed upstream or in apt-file find /usr/bin/tomboy apt-cache show tomboy | grep ^Source:
full circle magazine #51 17 contents ^ HOWTO - UBUNTU DEVELOPMENT 3 - BUG FIXING Getting the code for options and arguments such as - guess what your reasoning was There are entire books written -dry-run, -p
full circle magazine #51 18 contents ^ HOWTO - UBUNTU DEVELOPMENT 3 - BUG FIXING
With that out of the way, let’s To push it to Launchpad, as the focus on the actual changelog remote branch name, you need to entry itself: it is very important to stick to the following document: nomenclature: • where the change was done Zero Downtime • what was changed lp:~
full circle magazine #51 19 contents ^ HHOOWW--TTOO Written by Daniel Holbach UUbbuunnttuu DDeevveellooppmmeenntt PPtt.. 44 -- ddeebbiiaann//
his article will briefly changelog: * New upstream release For further information, see the explain the different files with lots of bug fixes and changelog section (Section 4.4) of feature improvements. important to the package (version) the Debian Policy Manual. distribution; urgency=urgency packaging of Ubuntu -- Jane Doe T
full circle magazine #52 19 contents ^ HOWTO - UBUNTU DEVELOPMENT 4 - debian/ Architecture: any Ubuntu should generally have the information is found in the See the GNU General Public Depends: ${shlibs:Depends} Maintainer field set to Ubuntu COPYING file in the program’s License for more details. Description: The classic . greeting, and a good example Developers
full circle magazine #52 20 contents ^ HOWTO - UBUNTU DEVELOPMENT 4 - debian/ to clean up all the build files so in the sequence. The --until, -- Also see the rules section (Section you end up with just a source Commands in the binary-indep before, --after, and --remaining 4.9) of the Debian Policy Manual. package again. sequence are passed the “-i” options can override this behavior. option to ensure they work only on Additional Files Here is a simplified version of binary independent packages, and If debian/rules contains a the rules file created by dh_make commands in the binary-arch target with a name like (which can be found in the dh- sequences are passed the “-a” override_dh_command, then when The Install File make package): option to ensure they work only on it gets to that command in the architecture dependent packages. sequence, dh will run that target The install file is used by #!/usr/bin/make -f from the rules file, rather than dh_install to install files into the # -*- makefile -*- Each debhelper command will running the actual command. The binary package. It has two # Uncomment this to turn on record when it’s successfully run in override target can then run the standard use cases: verbose mode. debian/package.debhelper.log. command with additional options, • To install files into your #export DH_VERBOSE=1 (Which dh_clean deletes.) So dh or run entirely different package that are not handled by commands instead. (Note that to the upstream build system. %: can tell which commands have dh $@ already been run, for which use this feature, you should Build- • Splitting a single large source packages, and skip running those Depend on debhelper 7.0.50 or package into multiple binary Let us go through this file in commands again. Each time dh is above.) packages. some detail. What this does is pass run, it examines the log, and finds every build target that the last logged command that is in Have a look at In the first case, the install file debian/rules is called with as an the specified sequence. It then /usr/share/doc/debhelper/example should have one line per file argument to /usr/bin/dh, which continues with the next command s/ and man dh for more examples. installed, specifying both the file itself will call all the necessary and the installation directory. For dh_* commands. example, the following install file would install the script foo in the dh runs a sequence of source package’s root directory to debhelper commands. The usr/bin, and a desktop file in the supported sequences correspond debian directory to to the targets of a debian/rules usr/share/applications: file: “build”, “clean”, “install”, “binary-arch”, “binary-indep”, and foo usr/bin debian/bar.desktop “binary”. In order to see what usr/share/applications commands are run in each target, run: When a source package is producing multiple binary dh binary-arch --no-act
full circle magazine #52 21 contents ^ HOWTO - UBUNTU DEVELOPMENT 4 - debian/ packages, dh will install the files install file section (Section 5.11) of downloaded updated package default for the package source into debian/tmp rather than the Debian New Maintainers’ hello-2.7.tar.gz format. and symlinked directly into debian/
full circle magazine #52 22 contents ^