Re: rpm question...



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: pgpiJXDobNpzE.pgp
Description: PGP signature

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Relevant Pages

  • [PATCH 1/2] kbuil: add deb-pkg target
    ... # To prepare kbuild for more kernel packaging formats move all packaging ... # In top-level Makefile introduce generic support for all package ... Included the old rpm target for backward ... # and builddeb scripts. ...
    (Linux-Kernel)
  • Re: Modem configuration:
    ... Rob is having trouble with the ltmodem RPM for Redhat ... installation script failed midway through because /dev/modem already ... because the RPM database thought the package was already ... package ltmodem is not installed ...
    (comp.os.linux.hardware)
  • [opensuse] a second GNOME damage after update
    ... Surprisingly this package is displayed as to be not installed although gnome-control-center and gnome-settings-daemon always worked until yesterday. ... Unfortunately YaST rejects the installation of this package because it ... Even if a new package requires a second version of an already installed package rpm should ensure that these two versions can coexist. ... I am desperately looking for a way to install "control center2". ...
    (SuSE)
  • Re: Conventions for NFS sharing of binaries
    ... Do you have distro & local packages with same name? ... mount it r/w on your "master installation machine" (with RPM management). ... If you replace a package with a different one with the same name, hmm, you ...
    (comp.os.linux.misc)
  • Re: missing X11 when configuring mplayer
    ... I found the xorg-x11-devel package in my FC3 installation. ... below at the bottom of this email for the detail of rpm -qi ...
    (Fedora)

Loading