Find the answer to your Linux question:
Results 1 to 4 of 4
Hello When I build my software with rpmbuild command, the rpms are not getting generated in the directory specified in rpmmacros file(%_rpmdir) This is what I am doing.. rpmbuild -bb ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    6

    Question rpm getting generated in diff directory


    Hello

    When I build my software with rpmbuild command, the rpms are not getting
    generated in the directory specified in rpmmacros file(%_rpmdir)

    This is what I am doing..

    rpmbuild -bb -vv --buildroot <build root path> --target=x86_64 --rcfile /tmp/rpmrc /tmp/mySpecfile.spec

    # cat /tmp/rpmrc
    macrofiles: /tmp/rpmmacros

    # cat /tmp/rpmmacros
    %_arch {$ARCH}
    %_builddir /home/manju/build/mysoftware/temp/install
    %_buildshell /bin/sh
    %_rpmdir /home/manju/build/mysoftware/dest/ix86_linux24/images/
    %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.{$ARCH}.rpm
    %_tmppath /home/manju/build/mysoftware/install/tmp

    So I expect the rpms to be present under the directory specified by %_rpmdir
    but instead they are going to /root/rpmbuild/RPMS/x86_64 directory.

    How do I address this ? Anyone has faced the same problem?

    regards,
    manju

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,425
    You forgot the "."
    and also the .rpmmacros file needs to be in your $HOME, not in /tmp
    aka: ~/.rpmmacros

    Also, judging from this:
    ..but instead they are going to /root/rpmbuild/RPMS/x86_64 directory.
    You are building as root, which is not advised and also not neccessary.

    Why?
    *DONT* try this
    Code:
    %clean
        %{__rm} -rf /
    Executed as root, it will wipe your disk.
    And the "/" is just a bad variable expansion away

    In fact, I use a dedicated and easily replaceable VM for building RPMs.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    6
    Hello Irithori

    I use the same command on another system
    which is 32bit. There is copies the files to correct directory mentioned in rpmmacros
    files.

    Btw. with --rcfile option, specifies my rpmrc file
    --rcfile FILELIST

    Each of the files in the colon separated FILELIST is read sequentially by rpm for configuration information. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/usr/lib/rpm/redhat/rpmrc:/etc/rpmrc:~/.rpmrc.

    so --rcfile /tmp/rpmrc is valid.

    Also rpmrc contents specify the name of rpmmacros file that I am using. Here also
    I can specify the absolute path of the rpmmacros file.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,425
    You are right, I didnt see --rcfile.

    Hmm, in theory --rcfile should be used.
    But maybe you have a .rpmacros file in your home, that (strangely) overrides?

    Other than that I can only think of typos or permission issues.

    You can try and copy the content of /tmp/rpmmacros into ~/.rpmmacros
    and then drop --rcfile.
    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
  •