I'm running an rpm spec file, and encountering the following error:
$ rpmbuild -ba gregorio.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.dDWqRV
+ umask 022
+ cd /home/cantanima/rpmbuild/BUILD
+ cd /home/cantanima/rpmbuild/BUILD
+ rm -rf gregorio-2.4.1
+ /usr/bin/tar -xf -
+ /usr/bin/gzip -dc /home/cantanima/rpmbuild/SOURCES/gregorio-2.4.1.tar.gz
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd gregorio-2.4.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ $'\r'
/var/tmp/rpm-tmp.dDWqRV: line 39: $'\r': command not found
error: Bad exit status from /var/tmp/rpm-tmp.dDWqRV (%prep)
The script file /var/tmp/rpm-tmp.dDWqRV
has the following lines in that area:
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'gregorio-2.4.1'
/usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
autoreconf -f -i
Line 39 is the one immediately above autoreconf -f -i
. It's a blank line, apparently marked by \r
instead of a standard Linux carriage return. If I change that one line in a text editor, the script runs fine.
As far as I can tell, this script file is automatically generated by rpmbuild
, not by the spec file, though I don't honestly know. What am I doing to cause this? I'm running Fedora 20, rpmbuild version 4.11.3.