Results 1 to 7 of 7

Thread: RPM auto relocate directory

  1. #1

    Default RPM auto relocate directory

    Hello,

    I create a RPM with "Prefix" in the spec file.
    When I install the RPM with the "--relocate" option, the files are good relocated .

    I want relocate the files during the installation according to tests (ex: personal directory of a user, java home), but I did not find how to do it .
    I saw that there was an environment variable RPM_INSTALL_PREFIX, but changing its value has no effect.

    Can you tell me how to do.

    Thanks,
    Fred

  2. #2
    Join Date
    Sep 2012
    Posts
    4,406

    Default Re: RPM auto relocate directory

    Quote Originally Posted by brachot View Post
    I saw that there was an environment variable RPM_INSTALL_PREFIX, but changing its value has no effect.
    It is set by RPM itself during installation for use in scriptlets.

    Can you tell me how to do.
    Not sure I understand the question. You can call rpm with different values of --relocate or --prefix if you want to install it in different places. But you already know it. Please explain what you are trying to do.

  3. #3

    Default Re: RPM auto relocate directory

    I want to make an RPM that puts files in the personal directory of a service account.
    If the account does not exist, I do not have a pb because I create the account with for his home directory the default path.
    But if the account exits, I wish that the files present in my source goes in the directory of the existing account. And I would like to take into account the fact that his personal directory is not necessarily the default path.

    I tried to change the variable RPM_INSTALL_PREFIX in the parts "% prep" and "% install" but that does not change anything.

    Thanks for your help

  4. #4
    Join Date
    Sep 2012
    Posts
    4,406

    Default Re: RPM auto relocate directory

    You explained why you want to install in different locations. You did not explain why you cannot use "rpm --relocate" for it.

  5. #5

    Default Re: RPM auto relocate directory

    I wish it could be automatic and if I install the RPM through Yast I can not pass the --relocate parameter

  6. #6
    Join Date
    Sep 2012
    Posts
    4,406

    Default Re: RPM auto relocate directory

    I am not aware of possibility to control relocation (or any other rpm option for that matter) using environment variable. Nor is it necessary for your use case - just always install in standard location and use links/alternatives/bind mounts to point to it as needed.

  7. #7

    Default Re: RPM auto relocate directory

    OK, thank you for your return

Tags for this Thread

Posting Permissions

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