On Sun, Sep 23, 2018 at 8:46 AM Thomas Schraitle
Hi Mathias,
Am Sonntag, 23. September 2018, 10:29:41 CEST schrieb Mathias Homann:
I'm having a really strange packaging issue on Leap 15.0:
the %files se4ction of my spec file fails! here's the part of the spec file in question: %files
%defattr(-,root,root,0755) %doc $RPM_BUILD_DIR/%{_srcname}/build-linux-%{_arch}/newview/packaged/*.txt
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IMHO this looks wrong.
If you need to include documentation into your package, use relative paths. Depending on the structure of your archive, it could mean you use:
%doc newview/packaged/*.txt
Probably your archive contains more files that the above. Maybe it contains README files, Changelog, NEWS etc.? Depending on what you consider meaningful, you should add them to your %doc section too:
%doc README* CHANGELOG ...
/usr/share/applications/* /usr/share/pixmaps/* /usr/games/*
For all three lines you should use the %_datadir macro instead of /usr/share:
%_datadir/applications/* %_datadir/pixmaps/* %_datadir/games/*
Although it means the same, you should avoid hard-coded paths.
[...] On every suse version until now this had worked just fine, but on 15.0 it almost looks as if $RPM_BUILD_DIR is not defined anymore, or as if variables are not expanded anymore at that point.
I vaguely remember that $RPM_BUILD_DIR should be replaced(?) in favor of the %buildroot macro, but I may be wrong.
However, regardless of this issue, you should neither use $RPM_BUILD_DIR nor the %{buildroot} macro inside %doc. I never saw absolute paths in %doc (although it could work, as you proofed it with your previous versions). In 99% you should use the above lines. :)
The %doc and %license macros have two different behaviors. If passed an absolute path, that path is relative to %buildroot. If passed a relative path, that path is relative to the working directory set up by %(auto)setup. You should not be able to pass paths that exist outside of this that function. -- 真実はいつも一つ!/ Always, there's only one truth! -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org