I think something's wrong with the build process described here. When I couldn't get things working, I made a verbatim copy of the complete spec file given here, and even with the full spec file it doesn't work for me. I'm testing Fedora 22 x64, inside GNOME Boxes 3.14.2 on Ubuntu 15.04 x64.
When I run
rpmbuild -ba hello.spec I get this error:
RPM build errors: File must begin with "/": AUTHORS File must begin with "/": ChangeLog File must begin with "/": COPYING File must begin with "/": NEWS File must begin with "/": README File must begin with "/": THANKS File must begin with "/": TODO
For each file name under the
%doc section of the spec file,
rpmbuild apparently wants a path relative to
~/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64, and it wants each file written on its own line. But the "AUTHORS" and "COPYING" files are located in BUILD, and they aren't being copied from BUILD to BUILDROOT/hello-2.8-1.fc22.x86_64. Even if you try manually copying the files to BUILDROOT/hello-2.8-1.fc22.x86_64, they get erased sometime in the build process, and it ends with a file-not-found error anyway.
RPM build errors: File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/AUTHORS File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/ChangeLog File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/COPYING File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/NEWS File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/README File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/THANKS File not found: /home/terrycloth/rpmbuild/BUILDROOT/hello-2.8-1.fc22.x86_64/TODO
I don't know much about rpmbuild, obviously, or I wouldn't be working on this tutorial. The only thing I can think of that lets rpmbuild finish successfully is removing the files listed under the
%doc section of the spec file.