Anand
Anand

Reputation:

RPM build error

I needed some help debugging my rpm build. Any time it encounters a %files or %build or %install directive it gives me an error and I am not able to figure out what "[rpm] + $'\r'" means

  [rpm] Building the RPM based on the LBR.spec file
  [rpm] Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.2932
  [rpm] + umask 022
  [rpm] + cd /home/user.username/workspace/LBR/dist/BUILD
  [rpm] + LANG=C
  [rpm] + export LANG
  [rpm] + unset DISPLAY
  [rpm] + $'\r'
  [rpm] /var/tmp/rpm-tmp.2932: line 28:
  [rpm] : command not founderror: Bad exit status from /var/tmp/rpm-tmp.2932 (%build)
  [rpm]     Bad exit status from /var/tmp/rpm-tmp.2932 (%build)
  [rpm]
  [rpm]
  [rpm] RPM build errors:

Upvotes: 4

Views: 12872

Answers (2)

Hebron George
Hebron George

Reputation: 349

I know this is almost four years old, but for anyone else who may stumble upon this page like I did looking for a solution:

I had this same issue where a carriage return character was inserted in the rpmbuild auto generated temp script. The reason this is happening is because I had initially edited the spec file in a Windows text editor (which inserted the carriage returns) and then SCPed the files over to a CentOS box, so the carriage returns threw errors. If you remake the file on the Linux environment, it should work fine.

Good luck!

EDIT: I am very new to Linux so I didn't know there was a command called 'dos2unix' that will convert a text file appropriately for Unix based environments. :) Hope that helps anyone else who runs into this issue.

Upvotes: 6

derks
derks

Reputation: 346

Little late... but...

After the build fails, vi/open the file /var/tmp/rpm-tmp.2932 (or whatever it is for that build) and go to line 28. Whatever the command is at that line, is what is failing. From this output, it is probably "$'\r'" which is bogus and not a command or valid statement... so you probably have a typo or something.

You said it happened ion %build, %install, and %files? What is the build command you are issuing?

Upvotes: 2

Related Questions