Re: rpm question...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bruce writes:

hi

when i have an rpm, and i do a "rpm -ivh foo.rpm", what file within the rpm
is run to install/start any scripts?

There are several scripts that are optionally part of an RPM package, and get invoked as part of package installation and uninstallation.

These scripts are not actual files that are installed by the rpm. The scripts are part of the package's definition, and are saved in a database that's maintained by the rpm command. The scripts get automatically extracted into a temporary file (by the rpm command) and executed when their designated conditions are met. The installation scripts get executed in this manner when the package gets installed; the uninstallation scripts get processed when the package gets uninstalled. Other optional scripts may get defined by the package, and get executed in response to installation or uninstallation of other packages.

                                      also, are the required files within the
rpm itself, so that i could take an rpm, expand it, make changes to the
files/structure, and rebuild the rpm?

All the required files, scripts, and metadata for a package are contained within the rpm, but that's not how you go about screwing around.

This is done by going back to the original source rpm file (.src.rpm), which contains all the source code and instructions that get used to build the binary rpm files, as well as the instructions and scripts for building them, and the associated install/uninstall scripts (if any). You extract the original source rpm, make the necessary changes to its components, and rebuild the whole thing. You get a set of new RPMs, and a new source rpm package as the end result.

Before rebuilding you should bump the release number of the package, so that your modifications can be applied as an upgrade.

The instructions for building the source into binary packages come from a file in the source rpm called the 'spec' file, which is an art in of itself. Don't expect instant gratification. Prepare to invest a significant time in learning how the 'spec' file works, and how to build rpm packages. The rpm 'spec' file syntax is not exactly poetry, and is what you might expect to get after almost a decade's worth of accumulated hacks piling up on top of each other.


Attachment: pgpq9dhmok6zs.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux