[collectd] 3.11.0 spec file (collection.cgi)

Staněk Luboš kolektor<span style="display: none;">.trailing-username</span>(a)<span style="display: none;">leading-domain.</span>atlas.cz
Wed Jan 24 19:17:27 CET 2007


Hi,
I do not want to provide the full spec file now because I am finishing
the email plugin part. My spec file is too much different from the
common one included into collectd.
As I am not the expert in particular RPM implementations, I will comment
only some parts. Notice that '%{}' variables and script parts may be
FC's exemptions.

I do not like the 'BuildPrereq' tag. The difference between the
'BuildRequires' and 'BuildPrereq' is that the second one has precedence
in loops and conflicts. The 'Prereq' has its meaning with packages - the
tag says that the mentioned dependency must be installed before, I think
it is meaningless with building. The building part does not install
packages and you will not build anything in either case if the
dependency is not preinstalled.
But both tags drag in the dependency for the main collectd package which
is wrong. The lm_sensors belongs to the sensors package, mysql belongs
to the mysql package. It is possible to exclude particular plugin from
build with several macros but the dependency of the main package remains.
On the other side the libstatgrab is missing.
The post, preun and postun requires also another dependencies:
----------------------
Requires(post): chkconfig
Requires(preun): chkconfig, initscripts
Requires(postun): initscripts
----------------------

Florian Forster napsal(a):
> Hi Lubos,
> 
> On Wed, Jan 24, 2007 at 12:02:03PM +0100, Stan??k Lubo?? wrote:
>> could I look at the spec file before before pulling it into the git
>> tree?
> 
> Sure, I've attached it to this mail.
> 

Thanks.

>> I build my own collectd packages for FC4/5/6. Probably I could enhance
>> the spec file too.
> 
> Go ahead. I'll pull it in the repository nontheless. I'll push it as
> soon as I'm done so you can send a patch :)
> 

I could do it but it would be only the FC variant.

>> I make my packages with collection.cgi included. This requires
>> additional files for a web server configuration and moreover new rules
>> for the SELinux enabled systems.
> 
> Webserver configuration and SELinux stuff isn't done in this specfile.
> Maybe you could build a seperate `collectd-cgi'-package which depends on
> a webserver, provides some includable apache-config-snippets and, of
> course, the `collection.cgi'..?
> 

It is inconvenient making the standalone collection.cgi's package for
me. I am doing it in one spec file. The result is two additional .rpm,
first depends on the webserver and the second for SELinux carries huge
dependencies on the SELinux stuff. The webserver is protected by the
SELinux (enforced policy) and the cgi cannot gather data from any files
without permissions.
The same applies to the email plugin with it's dependency on Perl.


> Iain: Another thing came to my attention: Why is `chkconfig --add'
> called but the `chkconfig --del'-counterpart isn't?
> 

Of course. In fact there must be three sections that handle
installation, removal and update.
----------------------
%post
/sbin/chkconfig --add %{name} || :

%preun
if [ $1 -eq 0 ]; then
    /sbin/service %{name} stop &>/dev/null || :
    /sbin/chkconfig --del %{name} || :
fi

%postun
if [ $1 -ge 1 ]; then
    /sbin/service %{name} condrestart &>/dev/null || :
fi
----------------------
Notice the 'condrestart'. It was the reason I have found that daemon
stopped slowly some time ago. As the daemon does not honor the SIGHUP,
the full stop and start has to be executed.


> I'm certain you'll figure something out :) I recently built a SLES10-
> specfile for a customer, I'll throw that in, too..
> 
> Regards,
> -octo

Best regards,
Lubos



More information about the collectd mailing list