I had uninstalled the Red Hat provided perl-CGI RPM on my RH9 system
and installed CGI.pm 3.00 from source. To satisfy these dependencies:
# rpm -ev --repackage perl-CGI
error: Failed dependencies:
perl(CGI) is needed by (installed) lynx-2.8.5-11
perl(CGI) is needed by (installed) mrtg-2.9.17-13
perl(CGI) >= 2.89 is needed by (installed)
subversion-0.17.1-4503.0
perl(CGI) is needed by (installed) mysql-3.23.56-1.9
perl(CGI::Carp) is needed by (installed) mrtg-2.9.17-13
perl(CGI::Carp) >= 1.24 is needed by (installed)
subversion-0.17.1-4503.0
I created a perl-CGI-virtual-3.00.spec file:
Name: perl-CGI-virtual
Version: 3.00
Release: 3
Group: virtual
License: GPL
Provides: perl(CGI) perl(CGI::Carp)
Conflicts: perl-CGI
Summary: Virtual package to satisfy dependencies.
Vendor: Dan Harkless
%description
Satisfy dependencies on Red Hat's perl-CGI RPM. Note that the
"subversion" package has a dependency on "perl(CGI) >= 2.89" and
"perl(CGI::Carp) >= 1.24", yet interestingly, this virtual package
satisfies those dependencies. It would seem our 3.00 version gets
applied to all of the subfeatures we provide. That wasn't the
behavior in the old version of rpm that comes on SuSE 8.x -- there
you had to have a package with the exact name of the feature being
looked for in order to supply a version number for it. (Maybe
features with parens act differently or something...?)
%prep
# nothing to do
%build
# nothing to do
%install
# nothing to do
%clean
# nothing to do
%verifyscript
# nothing to do
%files
# no files in a virtual package
and did an 'rpmbuild -bb' and an 'rpm -ivh' on it. This satisfied the
dependencies just fine (to my surprise, in fact, as noted in the
%description text).
However, when RHSA-2003:256-01 came out today, and I used my
rh_advisory_update script
(<http://harkless.org/dan/software/#rh_advisory_update>) to
automatically 'rpm -Uvh' the appropriate updates for my system, I was
assuming that the "Conflicts: perl-CGI" line in my
perl-CGI-virtual-3.00.spec file would prevent
perl-CGI-2.81-88.3.i386.rpm from being installed, and I'd just get the
other updates.
That didn't work, however -- my CGI.pm 3.00 files were overwritten.
After this I uninstalled perl-CGI-2.81-88.3.i386.rpm, re-did the 'perl
Makefile.PL; make; make test; make install' on my CGI.rpm 3.00, and
then tried various changes to my perl-CGI-virtual-3.00.spec file to
see if I could get 'rpm -Uvh --test perl-CGI-2.81-88.3.i386.rpm' to
complain about a conflict.
I tried renaming the spec file and the Name: directive from
perl-CGI-virtual to perl-CGI (and removed the "Conflicts: perl-CGI"
line), but that didn't work. I tried matching the Group, License, and
Vendor directives to Red Hat's RPM, to see if that would get it to
recognize it as a higher-numbered version of the same package, but
still no dice.
Eventually it occurred to me that my rh_advisory_update script should
use -Fvh by default, not -Uvh, and this will generally solve my
problem (as long as I name my virtual packages
<Red_Hat_RPM_name>-virtual as I had originally been doing), but I'd
still like to know what I was doing wrong, and if there's some way to
prevent -Uvh from overwriting a higher-versioned virtual RPM with a
lower-versioned real update RPM from Red Hat.
--
Dan Harkless
usenet RemoveThis @harkless.org
http://harkless.org/dan/