So, I've been working on scratching an itch that I've had for a while;
reducing the hodgepodge of totally different build systems in Debian.
I often make local packages of software that I've patched (e.g.
evolution, oaf, xchat), and for each one I have to figure out how to
update it to a newer upstream version, figure out what kind of patch
system they're using, etc. There has to be at *least* four or five
variants of dbs out there, plus dpatch, plus even more specialized ones
Also, a lot of people have been frustrated with our current source
package system's inability to handle binary files; e.g. if you want to
add a .png to a package, you have to uuencode it. Yuck.
Enter dpkg-source v2.
It's still rough around the edges. You may encounter bugs. And most
importantly, it isn't supported by dinstall or the buildds, so you can't
*really* use it yet. What I need now is for those people who maintain
packages which have complex build system needs to look at the
dpkg-source v2 format (and implementation) and make sure it can do what
they need it to do.
I specifically looked at the evolution and gcc build systems, and tried
to make sure dpkg-source v2 could support what they do; e.g. multiple
upstream sources, separate patches, and architecture-specific patches
So, if you'd like to help me make sure we have a good next-generation
build system, then please test dpkg-source v2! It currently defaults to
building version 2 archives; you can explicitly request it to build
version 1 by setting the environment variable
DPKG_SOURCE_BUILD_VERSION=1. This default will be switched once it is
in the archive.
Without further ado:
The package name is "dpkg-source2". In the future, it should be
included in the dpkg-dev package.
And here is the README which comes with the package:
Notes on using the new dpkg-source version 2.
Colin Walters <firstname.lastname@example.org>
Sun Jul 21 13:01:58 2002
This document is intended to be temporary until I learn Docbook XML
and can write a proper manual. If it lasts longer than a month, feel
free to shoot me.
* Summary of new features in dpkg-source2
** Supports more compression/archive types (.tar.bz2, .zip)
** debian/ directory is stored as a tarball, not as a diff.
This means you can include binary files like .pngs.
** Integrated patch application into source unpacking process.
The directory debian/patches will be examined for patches to apply.
** Regular text as well as xdelta patches supported.
Note: xdelta support has not been extensively tested yet.
** Supports multiple upstream source packages.
** Can generate patches, for placement into debian/patches directory.
** Clean, extensible, class-based implementation architecture.
* Critical operations
** Unpacking a version 2 archive.
This is the same as unpacking a version 1 archive. Just:
dpkg-source -x foo_1.0-18.dsc
The type of archive will be automatically detected.
** Packing a version 2 archive.
Run "dpkg-source -b" from the source directory. To build a version 1
archive, use the '--build1' argument. Note that the source arguments
(-sa, etc) aren't supported yet.
* Important notes:
** Changes to the upstream source will NOT be preserved when building
a non-native version 2 archive. You must generate a patch, and put it
in debian/patches. See below.
* Structure of a version 2 archive
Now, a version 2 archive can basically be one of three things.
** Native packages and single upstream packages
Firstly, it can be a native or single-upstream package. These
packages are very similar to version 1 archives, except they can use
any arbitrary compression, and can have patches.
** Multiple upstream packages
These packages are more complex. When you unpackage them, they unpack
into a directory <name>-<upstreamver> as other packages do, but inside
there each upstream package will be unpacked into its own
subdirectory. For example, Evolution includes db-3.1.17 and
evolution-1.0.7. Here is what the evolution source components look
walters@space-ghost> l /src/dpkg-source2/evolution2
drwxr-sr-x 3 walters src 4096 2002-07-21 03:02 .
drwxr-sr-x 10 walters src 4096 2002-07-21 12:20 ..
-rw-r--r-- 1 walters src 17006 2002-07-18 16:41 evolution_1.0.7-2.debian.tar.bz2
-rw-r--r-- 1 walters src 792 2002-07-18 16:41 evolution_1.0.7-2.dsc
-rw-r--r-- 1 walters walters 1954117 2000-08-13 evolution:db_3.1.17.orig.tar.gz
-rw-r--r-- 1 walters walters 13852125 2002-06-16 23:45 evolution:evolution_1.0.7.orig.tar.gz
You will notice that the source packages are prefixed with
"evolution:"; this is to prevent namespace conflicts.
When you unpack evolution, the resulting layout looks like this:
walters@space-ghost> l evolution-1.0.7
drwxr-sr-x 5 walters src 82 2002-07-21 03:01 .
drwxr-sr-x 3 walters src 4096 2002-07-21 03:02 ..
lrwxr-xr-x 1 walters src 9 2002-07-21 03:01 db -> db-3.1.17
drwxr-sr-x 50 walters src 4096 2002-07-21 03:01 db-3.1.17
drwxr-sr-x 4 walters src 4096 2002-07-16 13:25 debian
lrwxr-xr-x 1 walters src 15 2002-07-21 03:01 evolution -> evolution-1.0.7
drwxr-sr-x 30 walters src 4096 2002-07-21 03:01 evolution-1.0.7
The symlinks are intended to make life easier for the debian/rules
Makefile, so it won't have to hardcode a version.
* Updating version 2 archives to a new upstream version
Updating native packages is the same as for version 1 source archives.
** Single upstream source
This case is simple. Just untar/unzip the upstream source, then untar
the old version's debian.tar.bz2 archive into it. Finally, run:
dpkg-source -p --apply-all
This will apply all the patches from debian/patches; you should
investigate any failures.
** Multiple upstream sources
This process is fairly straightforward, if a bit more tedious than the
single-upstream case. Untar/unzip the new upstream into the unpacked
directory, remove the old upstream source directory, and change the
symlink to point to the new version. And after that, run:
dpkg-source -p --apply-all
* Generating patches
So, you've tweaked the upstream source a bit; perhaps modified some
paths to make it FHS compliant. Now, you want your changes to be
permanent. That's easy. Running "dpkg-source -p --create" will
output a patch of the current unpacked source directory versus the
Debianized upstream directory. For example:
dpkg-source -p --create > debian/patches/55fix-paths.patch
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org