[CentOS-devel] Centos 5.3 dependency check?

Mon Apr 6 11:14:26 UTC 2009
Markus Falb <markus.falb at fasel.at>

Hugo van der Kooij wrote:

> Markus Falb wrote:

>> maybe the conditional requirement is not necessary. try a: Require:
>> perl(MIME::Base64)
 
> Because RH makes a habit of including new packages into perl itself and
> using relative old ones there is a definite need to build a package with
>  an up-to-date version of this.
 
I understand that. I am irritated (only a little bit) by the fact that 
MIME-Base64 is not newer in 5.3. It shows the same version at least 
(3.07). On CPAN there is 3.07 dating from 2005. I could not find a newer 
one. But back to rpm. Maybe you can add a Version to Requirement:

Requires: perl(MIME::Base64) >= X.XX

And here is a check for centos version:

# check centos version and set macro
%{!?old_ver: %define old_ver %(if test `awk '{print $3}' /etc/redhat-
release|cut -d'.' -f2` -lt 3 ; then echo "1"; else echo "0"; fi)}

%if %{old_ver} == 1
do something
%else
do something complete different or not
%endif

(i am sure this could be done better, more elegant, etc...)

-- 
best regards,
markus