This is a place where I've always found the documentation lacking. I pretty much only learned how this works by looking at how it is done in other packages. As with most things in Debian packaging, there are a few ways to do this. I find the simplest way is to use debian/package.install
files. Here's an example of a package I've worked on, imagination (bzr branch).
First, we need to create the package in debian/control
. There are three stanzas now. One for the source package and one for each binary package. Note that the foo-data package should be Architecture: all
. Also note that imagination Depends on imagination-common (= ${source:Version})
.
Next, we create a debian/imagination.install
file. This contains the specific files or paths which we want to end up in the imagination package. For this package we want all the architecture dependent files. The desktop file is included as it needs to say with the binary that it calls in its Exec:
line.
usr/bin/
usr/lib/
/usr/share/applications/imagination.desktop
We need to create a debian/imagination-common.install
file. This will contain all of the architecture independent files, images, translations, docs, and the like.
/usr/share/doc/
/usr/share/icons/
/usr/share/imagination/
/usr/share/locale/
man dh_install
describes what's actually going on here:
maybe you have a large package that
builds multiple binary packages. You
can use the upstream Makefile to
install it all into debian/tmp, and
then use dh_install to copy
directories and files from there into
the proper package build directories.
What it means by "the proper package build directories" is that by the end of the build process, everything that will be in the resulting foo.deb
will be found in src/debian/foo
. The files that will end up in foo-data.deb
will be found in src/debian/foo-data
. As debian/rules
is essentially just a Makefile, you can begin to imagine so other ways of getting the same result.
I'd suggest something a little different than Flimzy. Take a look at git-import-dsc
and possibly git-debimport
. They will auto-magically create separate upstream, debian, and prinstine-tar branches from at Debian source package. You could then create your own branch for your patch set. Each time a new upload to Ubuntu is made, you can just run git-import-dsc
on the new package and merge with your branch.
Even simpler would be to use bzr
if you are not wed to git
. Each Ubuntu package can also be found in a bzr
branch. bzr branch ubuntu:$PACKAGE_NAME
will grab the source branch for you. Make your changes and commit. Then when ever a new Ubuntu upload is made, you can simply run bzr merge-package ubuntu:$PACKAGE_NAME
Best Answer
You're pretty close with your example steps, but here's what I'd suggest:
apt-get source wine
andcd
into the new directorywhat-patch
; in this case, it tells us we that the wine package usesquilt
for patch managementdebian/changelog
file - you'll need to alter the version number to ensure that your PPA version is differentiated from the official version. Typically, you should increment the last version number, and add a tilde (~) followed by your custom version string (eg~jbowtie1
). Thedch -i
command can help with this too.It's usually a good idea to do a test build before doing the dput - the
pbuilder
command allows you to recreate what the PPA build system would do with your package (ie, start from a clean install, add required deps, then build).In this case you would have to set up pbuilder first (see https://wiki.ubuntu.com/PbuilderHowto), then do this before the
dput
: