nrpe RPM spec file bug(s)

Lars Vogdt lars at linux-schulserver.de
Sun Jan 13 17:15:02 CET 2008


Hi

Just to add my 2 cents to this threat:

On Fri, 11 Jan 2008 15:06:56 +0100, "SCHAER Frederic"
<frederic.schaer at cea.fr> wrote:
> I have to admit I tend to agree with you about portability... but then
> the specfiles are still buggy, since they already contain the -r option
> in some places ;)
> 
>>Not really, no. The spec-file should be portable enough to work just
>>about everywhere. 


What about using rpm-macros?

I know SUSE has the macro %suse_version which is set to the current SUSE
version like 1020 (openSUSE 10.2). 
With that, you can just make something like this in your specfile:

%if 0%{?suse_version} > 1020
do_this
%else
do_that
%endif

If you don't need the "> 1020" just leave it out. If the macro is not
present, it will expand to "0" and so RPM jumps in the %else tree (if you
have one). I'm doing this already with some RPMs in the openSUSE
buildservice [1]. I don't know if other distributions like Fedora or
Mandriva have these macros defined on their real plattforms (a look into
/usr/lib/rpm/*macros* should help), but with this you can do thinks like:
%if 0%{?mandriva_version}
...
%endif
%if 0%{?fedora_version} 
...
%endif

This makes writing specfiles not really easier, but hopefully in some
future time we always just use one specfile for all... ;-) Other projects
have a directory "distribution" which contains specfiles for each version
and distribution sorted in subdirectories in it.

Regards,
Lars

[1]:
http://en.opensuse.org/Build_Service/cross_distribution_package_how_to



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace




More information about the Developers mailing list