I am attempting to use obs_scm without any tar or recompress service. I got the build running by running %setupwith the arguments -q -n %_sourcedir/%name-%version -T -D. Now when I want to install files the buildroot is prefixed to the proper file paths for the files listed in %doc. How do I stop the buildroot path being prefixed? Or what I am missing here?
The proper file path for CHANGELOG.md is /home/abuild/rpmbuild/SOURCES/blueman-2.5.git.1750957498.0c9b506d/CHANGELOG.md
Do not use absolute paths in setup -n. The %_sourcedir expands to the absolute path while argument to the setup -n is expected to be subdirectory of the %_builddir. Building appears to work because rpm basically does
cd %_builddir
cd %buildsubdir
before starting build so you land in the “correct” directory.
[ 21s] + cd /home/abuild/rpmbuild/BUILD/blueman-2.5.git.1750957498.0c9b506-build
[ 21s] + cd /home/abuild/rpmbuild/BUILD/blueman-2.5.git.1750957498.0c9b506-build
[ 21s] + cd /home/abuild/rpmbuild/SOURCES/blueman-2.5.git.1750957498.0c9b506
But %doc macro expects filenames under %_builddir/%buildsubdir and that fails.
You apparently attempt to cheat RPM by building outside of the build directory RPM prepares. I suppose you can pull it off by linking your actual build directory into the correct build directory.
This is how the best practices suggest it should be done User Guide | How to integrate external SCM sources. But as I now have experienced this is broken and most likely why most folks on the internet suggest to just have obs generate a tar file and have rpmbuild use that .
Thanks for the explanation why it’s prefixing this path.
That’s a very good example of “generic documentation which was only tested in some limited use cases”. Sure, this example will work as long as you do not use %doc.
You still may consider filing an RPM issue because the behavior of RPM is not consistent. It really should apply the same rules everywhere or fail the %setup invocation right away if absolute paths are not allowed here.
And raising an issue for the Open Build Service makes sense as well. If _service invocation is intended to replace %setup, it should put sources in the same location as %setup would.