2

rpmbuild is located at /xenv/OS/ia64/RH4.0AS_U4/x86_64/usr/bin/ and brp-compress is located at /xenv/OS/ia64/RH4.0AS_U4/x86_64/usr/lib/rpm/, but when I run:

/xenv/OS/ia64/RH4.0AS_U4/x86_64/usr/bin/rpmbuild --define '_topdir /build_location' -bb -vv package.spec

It fails as it is trying to use brp-compress (and other files) located in a place they don't exist:

/var/tmp/rpm-tmp.93613: line 31: /usr/lib/rpm/brp-compress: No such file or directory

How do I correct the location? (Note: I'm a RPM newbie)

Benjamin
  • 727
  • 1
  • 9
  • 19

1 Answers1

2

Running rpm --showrc will show you the complete configuration being used by rpm. If you search this for brp-compress you'll find:

-14: __os_install_post  
    %{_rpmconfigdir}/brp-compress 
    %{_rpmconfigdir}/brp-strip %{__strip} 
    %{_rpmconfigdir}/brp-strip-static-archive %{__strip} 
    %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} 
%{nil}

So it looks like it's looking in %{_rpmconfigdir}. Maybe try defining that value explicitly, and see how things work out.

Depending on what you're trying to do, it may also be possible to chroot into /xenv/OS/ia64/RH4.0AS_U4/x86_64/ and just run things without needing to tweak the configuration at all.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • My config is hardcoded to "/usr/lib/rpm/...". However, I have found a macro file that sets it to the correct value. The question is, how do I get rpmbuild to use the macro file I've found. Thanks! – Benjamin Mar 28 '12 at 17:47
  • You can create a `~/.rpmmacros` file in your `$HOME` directory; the format matches that of `/usr/lib/rpm/macros`. – larsks Mar 28 '12 at 17:55
  • To override, we can define `_rpmconfigdir` to some path, say,- `/xenv/i686/rpm/lib` while passing `rpmbuild` command as part of `.rpm` creation as discussed in this link [Defining variable while rpm build](https://stackoverflow.com/questions/21559477/how-to-pass-user-defined-parameters-to-rpmbuild-to-fill-variables) – Dev Anand Sadasivam Jan 23 '18 at 20:04