Search code examples
rpmrpmbuildrpm-spec

RPM: macros for /usr/local prefix


I have not found in https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/ any details on macros that can operate with directory hieararchy under /usr/local.

Does this exist, or the best I can have in my spec file is something like this?

%files
%{_prefix}/local/etc/my_app.cfg

Solution

  • Use of /usr/local/ is discouraged by Fedora; if you're using RPMs with unique names, you'll never have to worry about conflicting with globally installed software.

    From https://docs.fedoraproject.org/en-US/packaging-guidelines :

    In addition, no Fedora package can contain files or directories or modify files under ... /usr/local as these directories are not permitted to be used by Distributions in the FHS

    So to answer your question explicitly, no there is no macro because they don't want you to use that location.