When runnig rpmbuild with command
rpmbuild -v -ba --sign --clean ~/rpmbuild/SPECS/myspecfile.spec
I get this output:
Enter pass phrase:
Pass phrase is good.
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6akVI6
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ $'\r'
**: command not foundwXWF: line 30:**
error: Bad exit status from /var/tmp/rpm-tmp.6akVI6 (%prep)
So I edited the temporary file /var/tmp/rpm-tmp.6akVI6, searched line 30, and found a single character there: ^M
If I execute the temporary file I get the same error, but it executes the all lines after 30, unlike the rpmbuild that breaks on that line and doesn't continue executing:
sudo sh /var/tmp/rpm-tmp.6akVI6
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ $'\r'
**: command not foundkVI6: line 30:**
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ rm -rf mysource-1.0.0
+ /usr/bin/gzip -dc /home/rpmbuilder/rpmbuild/SOURCES/mysource-1.0.0.tar.gz
+ /bin/tar -xvvf -
drwxrwxrwx 0/0 0 2014-11-04 17:10 mysource-1.0.0/
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mysource-1.0.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
If I edit the file and remove line 30 (^M) I am able to run the script with no errors:
sudo sh /var/tmp/rpm-tmp.6akVI6
+ umask 022
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/rpmbuilder/rpmbuild/BUILD
+ rm -rf mysource-1.0.0
+ /usr/bin/gzip -dc /home/rpmbuilder/rpmbuild/SOURCES/mysource-1.0.0.tar.gz
+ /bin/tar -xvvf -
drwxrwxrwx 0/0 0 2014-11-04 17:10 mysource-1.0.0/
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mysource-1.0.0
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
This suggests me that the rpmbuild is being stopped because of that single character on line 30.
Any hints why is this happening?