Search code examples
rpm-spec

Linux rpm relocate package to multiple prefixes


Let us suppose the package installs files under different folders i.e under /opt, /etc, etc. Is it possible to create relocatable package which installs files to different prefixes for each partition like /opt to /abc/opt and /etc to /abc/etc or /xyz/etc.


Solution

  • if your spec file prefix looks like this

      Prefix: /usr
      Prefix: /etc
    

    you can relocate files to different prefixes using command

    rpm ... --relocate /opt=/abc/opt --relocate /etc=/xyz/etc ...