Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    how to build a common RPM across


    Here is my requirement.

    I want to build a common RPM which can be installed on both RedHat and SUSE.
    On Redhat, I want files to be installed under /usr/local/mydirectory
    and on SUSE, I want files to be installed under /opt/cmcluster/mydirectory.
    I don't want to use the prefix and relocate option.

    Is there anyway I can achieve this.


  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Hi and welcome

    No, but you could write one spec file that creates multiple, os specific RPMs.

    Note that this approach has some caveats:
    - Imho, you are pretty much limited to non-compiled files: redhat and suse have different library versions, features and patch sets.
    So an ELF binary will most likely be tied to the platform it was built on. (Usually and hopefully your rpm build machine)
    - Different paths are inconsistent and not expected. This is bound to cause confusion, but at the very least more administrative work.

    I do not know your usecase in detail but it might be a better approach to consolidate the environments: Reduce to one os or at least use common paths.
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts