![]() | ![]() | Building Debian Packages with darcs-buildpackage | ![]() |
---|
This chapter describes how to use darcs-buildpackage to carry out regular, every-day development activities.
FIXME: write this. Please see dbp-get manpage for info about getting and mirrors!
Before you start working on any source package with darcs-buildpackage, first check it out as described in the Section called Fetching Source from History to make sure it is in its proper location. Then, as you work, you will use darcs record to commit your changes to the Debian repository. (If you just want to build an old package, there's no need to do this.)
When you're ready to build a package, just run darcs-buildpackage to build it. The darcs-buildpackage command takes the same arguments as debuild, and passes them on to debuild, so give it your usual set. darcs-buildpackage will use your existing orig.tar.gz file for source generation, if it exists; otherwise, it will take care of automatically building it from the upstream sources if necessary.
FIXME: these examples are from arch and need to be updated for Darcs
Here's an example:
~/tree/debian$ cd +packages/rdiff-backup/rdiff-backup-0.12.5 ~/tree/debian/+packages/rdiff-backup/rdiff-backup-0.12.5$ darcs-buildpackage \ -rfakeroot -us -uc ... Building .orig from archive. * tla buildcfg upstream/rdiff-backup/0.12.5 * from import revision: jgoerzen@complete.org--debian/rdiff-backup--head--1.0--base-0 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--head--1.0--patch-1 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--head--1.0--patch-2 * making pristine copy * tree version set jgoerzen@complete.org--debian/rdiff-backup--head--1.0 * tla inventory -s "rdiff-backup-0.12.5.orig" | tar -cSpf - -T- | gzip -9 > "rdiff-backup_0.12.5.orig.tar.gz" *** Running build program Running: debuild ['-i\\+\\+pristine-trees|,,*|\\{arch\\}|\\.arch-ids', '-rfakeroot', '-us', '-uc'] ...
In this case, I had not checked out the upstream source and did not have my orig.tar.gz file handy. Therefore, darcs-buildpackage checked out the upstream sources for me, generated the tar.gz file, and then called debuild to do the rest.
If you are building for Debian, you will want to keep your orig.tar.gz around so that future source uploads use the same MD5 sum in the .dsc file.
For more details, please see the manpage for darcs-buildpackage(1).
A common scenario for a Debian developer to deal with is that of a new upstream release. The Debian patches from the most recent Debian release must be merged into the upstream one.
There have been a few tools to do that: uupdate is one. However, now that you are using Darcs, you can use its built-in pull command to make this easier.
The first thing that you will do is to import the new upstream sources into your darcs-buildpackage archive. Please see the Section called Importing Upstream Sources in the Chapter called Importing Packages for instructions.
Next, check out the latest Debian version if you don't already have it (see the Section called Fetching Source from History) and then cd into the Debian source directory.
[ Note: I anticipate writing a program to automate the following steps. ]
Now, you are ready to merge in the new upstream. Run darcs pull, giving it the path to your canonical upstream repository.
FIXME: add a sect3 demonstrating
Now, you will want to examine the merge, especially if Darcs complained of any conflicts.
You'll also want to note the new version in debian/changelog and rename your directory based on the new version. I find it easy to run a command like debchange -v 0.13.3-1, then modify the changelog as appropriate. debchange will handle the rename for you.
Finally, you will want to commit the merge. If you want to just use a simple log message, a command like this will work:
$ darcs record -m "Merged in upstream 0.13.3" FIXME: show output
The string supplied after the -m is the log message.
If you want to add a more detailed log, try this, just run darcs record and it will prompt you for one.
You can see what happened by using darcs changes -s:
$ darcs changes -s FIXME: show output
Slick -- it shows exactly which upstream patches you used.
When you have uploaded a Debian package to the archive, you should ask darcs-buildpackage to note this for you. That way, you can request this specific version later. Just run this:
$ dbp-markdeb FIXME: show output.
The reason for this is that you might make several commits during the course of hacking on a given Debian version. This command lets you note the final version, and to run it again, you must update the changelog.
Technically speaking, this creates the DEBIAN_ tag.
FIXME: this is not yet updated for Darcs
To find the versions available in your darcs-buildpackage archive, first cd to its top level and then run:
$ ls configs/*/* configs/debian/rdiff-backup: 0.12.3-1 0.12.5-1 configs/upstream/rdiff-backup: 0.12.3 0.12.5
This shows you that two Debian versions and two upstream versions of rdiff-backup are present.
To fetch the source code from the darcs-buildpackage archive, first cd into your top-level working copy. Then, using the name of the config file (see the Section called Finding Historic Versions), use the tla buildcfg command:
$ tla buildcfg debian/rdiff-backup/0.12.5-1 * from import revision: jgoerzen@complete.org--debian/rdiff-backup--head--1.0--base-0 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--head--1.0--patch-1 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--debian--1.0--base-0 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--debian--1.0--patch-1 * patching for revision: jgoerzen@complete.org--debian/rdiff-backup--debian--1.0--patch-2 * making pristine copy * tree version set jgoerzen@complete.org--debian/rdiff-backup--debian--1.0
This command will have created the directory +packages/rdiff-backup/rdiff-backup-0.12.5 to contain the sources. Generating upstream sources works the same, and puts them into a directory ending in .orig.
If you don't know what version you want but just want the latest, you can simply use a command such as tla buildcfg debian/rdiff-backup/latest.
<<< Importing Packages | Command Reference >>> |