3

I have an RPM package with nearly 4000 files, and the installation of this takes considerable time. However, of those 4000 files, only a fixed list of 25 files change for each release.

My query:

Is it possible to build the RPM in such a way that it behaves differently during install and upgrade? This is what I intend to do.

  1. During install, all of the 4000 files are to be copied.
  2. During upgrade, only the 25 changed files get copied and not the remaining files (because they take a long time to be installed and they just overwrite the same files).
1
  • How about simply splitting the package into two. The first contains the executable and all the relatively static files and the second only the 25 or so changeable files. Make sure that the first depends on the other so that a yum install your-package pulls in both. – garethTheRed Dec 9 '14 at 12:28
2

Yes, it is possible.

Take a look at this useful wiki page from Fedora which explains that the pre and post build "scriplets" take an argument that is passed in to them when they are run as part of the RPM installation.

You can add a check to detect whether its an upgrade or a fresh install to your scriplet. The link provided contains an example of how to do this in your pre-install script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.