On Mon, 29 Jan 2007 16:08:39 +0800
Thomas Goirand <[EMAIL PROTECTED]> wrote:

> I have few questions that would help me to solve things in my
> package. I have package1 and package2 being same but with different
> dependencies, so the user can choose between them.
>
> First, if my package produces many binaryies, is it ok to do symlinks
> of the postinst if they are same. Like:
>
> debian/package1.postinst would link to debian/package2.postinst

What happens then if the user chooses to install package 1 without
package 2? Note that dpkg-buildpackage will try to retain symlinks that
exist in the debian/ directory and you can easily end up with a package
containing a symlink to /home/thomas/foo which will break on any other
system, even if the user is called Thomas!

You can use symlinks in the upstream source, maybe in SVN etc., but
when you prepare a directory to build the Debian package, you must take
care that files in debian/ are actual files and that symlinks in
debian/ are correctly installed so as to symlink to the final location
under /usr/ etc.

Using environment variables could let you down (the environment is
subject to user control) - it could be more reliable to test for the
existence of an executable file /usr/bin/package1 or /usr/bin/package2
etc. Otherwise, your maintainer scripts could fail under a chroot or
similar.

> Third, as I have debian/package1.cron.d and debian/package2.cron.d
> being the same, I've renamed them debian/package1.package1.cron.d and
> debian/package2.package1.cron.d and used dh_installcron
> --name=package1 to be sure that those 2 config files are same. But
> when I look in /etc/cron.d there is no package1 cron script, even if
> it's in debian/package2/etc/cron.d/package1 when I have a look after
> a build. Any idea why?

The package1 prefix is probably being stripped - check how the cron
file is being prepared upstream. You may be better off using separate
files that call their own packages using hardcoded strings.

The other alternative is to have the cron file detect which package is
installed (maybe by testing if /usr/bin/foo1 is an executable file
etc.) so that there is only one cron file for package1 or package2 but
it knows how to handle whichever is installed.

Can the user choose to install package1 and package2 on the same system
or have you got a Conflict: setup?

--

Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgpey5cBZpm5N.pgp
Description: PGP signature

Reply via email to