From Fedora Project Wiki

(clarify /usr/libexec vs /usr/libexec/SUBDIR)
(strike use of %{_datadir} for helper scripts)
 
Line 17: Line 17:
Fedora's rpm includes a macro for libexecdir, <code>%{_libexecdir}</code>. Packagers are highly encouraged to store libexecdir files in a package-specific subdirectory of <code>%{_libexecdir}</code>, such as <code>%{_libexecdir}/%{name}</code>.
Fedora's rpm includes a macro for libexecdir, <code>%{_libexecdir}</code>. Packagers are highly encouraged to store libexecdir files in a package-specific subdirectory of <code>%{_libexecdir}</code>, such as <code>%{_libexecdir}/%{name}</code>.


If upstream's build scripts support the use of <code>%{_libexecdir}</code> then that is the most appropriate place to configure it (eg. passing <code>--libexecdir=%{libexecdir}/%{name}</code> to autotools configure).  If upstream's build scripts do not support that, <code>%{_libdir}/%{name}</code> is a valid second choice.  If the helpers that the program '''can use''' may '''only''' be arch independent then  <code>%{_datadir}/%{name}</code> may also be used but this is a distant third choice.  If you have to patch support for using one of these directories in, then you should patch in LIBEXECDIR, preferably configurable at build time (so distributions that do not have <code>/usr/libexec</code> can set LIBEXECDIR to another directory more appropriate for their distro.
If upstream's build scripts support the use of <code>%{_libexecdir}</code> then that is the most appropriate place to configure it (eg. passing <code>--libexecdir=%{libexecdir}/%{name}</code> to autotools configure).  If upstream's build scripts do not support that, <code>%{_libdir}/%{name}</code> is a valid second choice.  If you have to patch support for using one of these directories in, then you should patch in LIBEXECDIR, preferably configurable at build time (so distributions that do not have <code>/usr/libexec</code> can set LIBEXECDIR to another directory more appropriate for their distro.


[[Category:Packaging guidelines drafts]]
[[Category:Packaging guidelines drafts]]

Latest revision as of 15:19, 29 June 2011

Warning.png
This page is a draft only
It is still under construction and content may change. Do not rely on the information on this page.

Current

Libexecdir

The Filesystem Hierarchy Standard does not include any provision for libexecdir, but Fedora packages can store appropriate files there. Libexecdir (aka, /usr/libexec on Fedora systems) should be used as the directory for executable programs that are designed primarily to be run by other programs rather than by users.

Fedora's rpm includes a macro for libexecdir, %{_libexecdir}. Packagers are highly encouraged to store libexecdir files in a package-specific subdirectory of %{_libexecdir}, such as %{_libexecdir}/%{name}.


Proposed

Libexecdir

The Filesystem Hierarchy Standard does not include any provision for libexecdir, but Fedora packages may store appropriate files there. Libexecdir (aka, /usr/libexec on Fedora systems) should only be used as the directory for executable programs that are designed primarily to be run by other programs rather than by users.

Fedora's rpm includes a macro for libexecdir, %{_libexecdir}. Packagers are highly encouraged to store libexecdir files in a package-specific subdirectory of %{_libexecdir}, such as %{_libexecdir}/%{name}.

If upstream's build scripts support the use of %{_libexecdir} then that is the most appropriate place to configure it (eg. passing --libexecdir=%{libexecdir}/%{name} to autotools configure). If upstream's build scripts do not support that, %{_libdir}/%{name} is a valid second choice. If you have to patch support for using one of these directories in, then you should patch in LIBEXECDIR, preferably configurable at build time (so distributions that do not have /usr/libexec can set LIBEXECDIR to another directory more appropriate for their distro.