#848 Clarify the use of path macros with respect to build dependencies
Opened 2 months ago by otaylor. Modified a month ago

Packages sometimes use %{_prefix} derived macros to refer to files in build dependencies - e.g., running %{_binddir}/scons instead of scons. This is generally not useful, and prevents using the path macros to rebuild a single package in a different location (we're doing this with prefix=/app to create Flatpaks from Fedora packages.)

Proposed guideline text (see https://pagure.io/packaging-committee/pull-request/847):

Note that the macros for paths such as %{_bindir} refer to the installation location of a package. Spec files must not use these macros to locate files from build dependencies, since build dependencies may have been built with a different %{_prefix}. (This happens when packages are being rebuilt with a prefix of /app to bundle with a Flatpak.) When possible,
build dependencies should be located using mechanisms that are robust against different installation locations, such as relying on $PATH lookup, using pkg-config, or using RPM macros provided by the build dependencies. If no such mechanism is available, and it's necessary to specify an absolute path to a file in a dependency, assume that the build dependency is installed with prefix=/usr. (/usr/%{_lib} may be used to handle the difference between /usr/lib and /usr/lib64.)

See also: https://lists.fedorahosted.org/archives/list/packaging@lists.fedoraproject.org/thread/BILZSHLQ7Y2GFIP3AMYNB6FFOFTLQNGM/

I'm +1 on the base thing, will comment wording in the PR.

Metadata Update from @tibbs:
- Issue tagged with: meeting

2 months ago

We discussed this ticket at this weeks meeting (https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2019-02-14/fpc.2019-02-14-17.00.txt) :

Metadata Update from @james:
- Issue untagged with: meeting
- Issue tagged with: writeup

a month ago

Login to comment on this ticket.