0

I tried to build binaries in RHEL6 using rpmbuild command.It throws file not found error during rpmbuild command execution. But In RHEL5 the same rpmbuild command is working fine.

RHEL5 execution result:

*Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.77266

  • umask 022
  • cd /usr/src/redhat/BUILD
  • LANG=C
  • export LANG
  • unset DISPLAY*

RHEL6 execution result:

*Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.BeMhyH

  • umask 022
  • cd //rpmbuild/BUILD
  • '[' //rpmbuild/BUILDROOT/ '!=' / ']'
  • rm -rf //rpmbuild/BUILDROOT/ ++ dirname //rpmbuild/BUILDROOT/
  • mkdir -p //rpmbuild/BUILDROOT
  • mkdir //rpmbuild/BUILDROOT/
  • LANG=C
  • export LANG
  • unset DISPLAY
  • /usr/lib/rpm/check-buildroot*

I am not able to find any %install changes between the spec files. Any one please help me to understand what am i doing wrong?

Thanks in Advance..!

2 Answers2

0

The only problem that is clear from the snippets provided is that $HOME is not defined in your rpmbuild environment. $HOME/rpmbuild is the default build root for 'rpmbuild' in RHEL6, instead of /usr/src/redhat as in RHEL5.

Things to consider:

  • Is there an '~/.rpmmacros' file that is altering the rpmbuild directives.
  • The temporary %install script will not be deleted on error-exit. Inspecting it directly might tell you more about why it failed.

Ex:

[user@host rpmbuild]$ rpmbuild -bb nano
<snip>
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.2uw1tZ (%install)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.2uw1tZ (%install)
[user@host rpmbuild]$ cat /var/tmp/rpm-tmp.2uw1tZ
#!/bin/sh

  RPM_SOURCE_DIR="/home/user/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/home/user/rpmbuild/BUILD"
...
Aaron Hanson
  • 156
  • 7
0

Older recommendations were to nuke the target buildroot as the first step of %install. To help force a separation between the %build and %install steps, newer versions of rpmbuild strictly enforce it by doing it for you for the first step, as shown in what you pasted in.

I am assuming that your %build stage is putting one or more files into the target buildroot area, which it shouldn't be doing. It should all be in the build area only.

Aaron D. Marasco
  • 6,506
  • 3
  • 26
  • 39