[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Separating packages.

On Mon, 2004-04-05 at 20:16, n.v.t n.v.t wrote:
> Ok, that seems to be all clear to me, what about the rules file? How do I 
> separate packages, the example that Andreas Metzler told me to check out, 
> doesn't clear things entirely. Is this the way we should learn it, by 
> examples? So I move files into a directory then create a deb out of each 
> package? A " make " (destdir or something similar like that?) parameter, how 
> should this be done? What am I missing here?

This is perhaps the most difficult thing to understand about Debian
packaging. It's implied in several places, and it's briefly spelt out in
some other places, but in general, you are referred to "examples" which
vary as much as the packages in the Debian archive.

In basic terms, when you build a package, the files generated by the
build process are placed in debian/packagename, a directory which is
generated by the build tools (they look at the control file for the
names). The contents of that directory corresponds to the contents of
the deb package "packagename". This means that if you place a file in
debian/packagename, it will show up in the package.

So what you need to do is make sure the right files end up in the right
debian/packagename directory. Because it's a good idea to use debhelper,
you should use dh_install to move the files in place.

You said you have the following structure:

So, in the build target of the rules file, you run the makefile for each
of these (or if another makefile already does that, you may omit it, it
depends on how the upstream build system is constructed).

Now, your package probably comes with an install script that will
install the files in their correct destinations. Let's say the package
installs the icons, backgrounds and examples using a structure as
described above. Then you need to dh_install the contents of each
directory into the correct debian/packagename directory. You do this
(for example) by saying something like
        dh_install -ppackagename dir/icon dir/in/package
in the install target of the rules file. Here, dir/icon is relative to
the source directory (the directory containing debian/ and upstream's
sources). Read man dh_install for the complete details.

You can then remove the unneccessary directories from the main package
(with rm). Another way, which may be better because it reduces the
chance that you include a file which wasn't meant to be included, is to
have the package install into debian/tmp. Then you dh_install each file
and directory into the appropriate package. debian/tmp is then removed
in the clean target along with any unneccessary stuff.

You have received responses pointing out that there are many important
subtleties to be considered when making a split package. You should
consider them good advice. I'm just explaining "how to do it" because I
found this to be the most difficult thing to understand about deb
packaging (probably because it's so simple :) -- but I haven't said
anything about "why you should or shouldn't do it".

Hope this clears things out for you!

Fabian Fagerholm <fabbe@paniq.net>

Reply to: