On Wed, 25 Jan 2006 01:41:29 +0100 (CET), Andreas Thienemann wrote:
I'm currently trying to package ser, the sip express router.
Depending on the variables passed at compile time, the resulting binary is
either linking against mysql or postgresql.
IN order not to pull in unneeded dependencies I'd like to package it as
ser (no database support/no persistant storage), ser-mysql, ser-pgsql and
ser-common for the rest
Is there a template/example spec file somewhere detailing how one would
package such a software?
"ulogd" in Extras is similar with regard to sub-packages for database
support. But it doesn't require running %configure twice. Your description
is a bit vague (also see below). Does the software build multiple plugins
for database support? Or does it create a single executable only, which is
linked to a single chosen database library? In that case, your packages would
conflict, because you would have two executables, one linked against
mysql, the other linked against pgsql. Bad.
In case you need to %configure and "make" the source code twice, you can't
avoid compiling the code once, moving built files into a temporary
directory, then compiling the code again with a modified configuration. In
the %install section you would install the built files from the first
pass manually and install the rest as usual. In case of file name
conflicts, however, you need to find a different solution (like giving
files changed names).
Right now I'm wondering how to manage the %install phase and how
the binaries with the same name, but different dependencies installed and
listed in the %files section.
"binaries with the same name" sounds like a conflict. If you want
mutually exclusive sub-packages ser-mysql and ser-pgsql, you still
need non-conflicting file names and a mechanism like "alternatives"
to activate the desired database version after installation.