In my quest for more info on how to improve RPM I turned once again to debian.
dpkg has a nice little function of Provides: 
Where you put in a generic package name or so I've heard it called virtual 
package. I'm commented every part for people who aren't famillar with .deb, so
if you are.... scroll down : )

Rough example:
First look at the dump for apt-cache show for sendmail

//name of the package
Package: sendmail 

//version of the package
Version: 8.11.0.Beta1-1

// Priority of a package. This is really only used in dselect to set up default
// packages to be installed.
Priority: extra

// What section to put this under in dselect, would be groups in an rpm spec file
Section: mail

// The maintainer of the package
Maintainer: Richard A Nelson (Rick) <[EMAIL PROTECTED]>

// deps
Depends: libc6 (>= 2.1.2), libdb2 (>= 1:2.4.14-7), libopenldap1, libpam0g, 
libsasl7, libssl09, libwrap0, sfio1999, m4, awk, procmail | deliver

// This I don't like, dselect(and only dselect) will not install said package
// if these packages aren't installed. dpkg and apt really pay no attention to
// this variable.
Recommends: mail-reader, perl5 | perl

// What other packages this package will conflict with you can use the Replace:
// variable with this, which is quite nice IMHO. But I'm not covering it here.
Conflicts: mail-transport-agent, smail, postfix

// What this package provide. This is also the 'virtual package'
Provides: mail-transport-agent

// arch it was built for
Architecture: i386

// duh!
Filename: dists/unstable/main/binary-i386/mail/sendmail_8.11.0.Beta1-1.deb

// size of file
Size: 1009312

// md5 checksum
MD5sum: 018950fac1f1c65b493d7ac0e4b7c987

//
Description:
Description of sendmail

// How much space this package will take up once installed
installed-size: 2612


Now let's look at the same kind of dump for mutt, but only focus on one 
part ,the Depends:


Package: mutt
Version: 1.2-1
Priority: standard
Section: mail
Maintainer: Marco d'Itri <[EMAIL PROTECTED]>
// pay attention to the depends
Depends: libc6 (>= 2.1), libncurses5, mail-transport-agent
Recommends: mime-support
Suggests: urlview, ispell, gnupg | pgp | pgp5i
Conflicts: mutt-i
Provides: mail-reader
Replaces: mutt-i
Architecture: i386
Filename: dists/unstable/main/binary-i386/mail/mutt_1.2-1.deb
Size: 1015432
MD5sum: 04e5cf7f387aab4da285e57fe9d5cab2
Description: Text-based mailreader supporting MIME, GPG, PGP and threading.
installed-size: 2331

Ok so if you look at the dump for sendmail you'll see
Provides: mail-transport-agent

This is entered into the status file(DB) for dpkg basically saying that there
is an MTA installed.
Now look at the deps for mutt

Depends: libc6 (>= 2.1), libncurses5, mail-transport-agent
So when you go to install mutt dpkg reads the status file and finds that you
have an MTA installed that deps on that end are met cleanly.

Now what's so great about this ?

Well for the postfix show dump it'd pretty look the same and have another line
Provides: mail-transport-agent 
This way if you can be general about deps. Or here's a better way to look at it
an rpm spec file for mutt would prolly have a line something like this:
Requires: sendmail

This is nasty because you can only specify one MTA. Of course you could overide
this with --nodeps, but breaking deps a lot of times will fubar something up
completely. Anyway you get the picture.

This is the only part of the .deb control file I wanted to cover in this post 
since it's the most valuable part of dpkg that could be implemented into RPM.

There are other aspects of dpkg/deb that could(and once again should IMHO) be
implemented into rpm, but I just wanted to take a in depth look at this part
of dpkg.


-- 
Bryan Paxton

"How should I know if it works? That's what beta testers are for. I
          only coded it."
 -- Linus Torvalds.

Public key can be found at http://speedbros.org/Bryan_Paxton.asc

Reply via email to