Difference between revisions of "Documentation/Labs/FHSCompliantDirectoryStructure"
(Created page with 'The current install tree structure as documented on Documentation/Nightly/Developers is not compliant with the [http://www.pathname.com/fhs/|File Hierarchy Standard]. This pa…') |
|||
Line 1: | Line 1: | ||
− | The current install tree structure as documented on [[Documentation/Nightly/Developers]] is not compliant with the [ | + | The current install tree structure as documented on [[Documentation/Nightly/Developers]] is not fully compliant with the [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard]. This page aims at documentation how the structure could be updated. |
+ | == Rationale == | ||
− | + | For reasons that hopefully do not require enumeration, it is desirable for Slicer to install in a reasonable manner to a system standard prefix, e.g. <tt>/usr/local</tt> or even <tt>/usr</tt>. Ultimately, it would be very cool if distributions were able to package slicer, for which reasonable FHS compliance is a requirement. | |
− | |||
− | |||
− | + | == Proposal == | |
− | - | + | (Originally by Matthew Woehlke - April 10, 2014) |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * move <tt>/Slicer</tt><sup>[[#fn1|[1]]]</sup> to <tt>/bin/</tt> | |
+ | * move <tt>/bin/Python</tt><sup>[[#fn2|[2]]]</sup> to one<sup>[[#fn3|[3]]]</sup> of: | ||
+ | ** <tt>/lib/python-${PyVer}/site-packages</tt> | ||
+ | ** <tt>/lib/python-${PyVer}/site-packages/slicer${VerMajor}</tt> | ||
+ | ** <tt>/share/Slicer-${Ver}/</tt> | ||
+ | *** ...and move <tt>/bin/Python/SlicerWizard</tt> to <tt>/lib/python-${PyVer}/site-packages</tt> | ||
+ | * move <tt>/lib/Python/*</tt><sup>[[#fn4|[4]]]</sup> to <tt>/</tt> | ||
+ | * move <tt>/lib/TclTk/*</tt><sup>[[#fn4|[4]]]</sup> to <tt>/</tt> | ||
+ | * move <tt>/lib/QtPlugins</tt><sup>[[#fn5|[5]]]</sup> to <tt>/lib/Slicer-${Ver}/</tt> | ||
+ | * move <tt>/lib/Slicer*/<third party libs></tt><sup>[[#fn4|[4]]]</sup> to <tt>/lib/</tt> | ||
+ | * move <tt>/bin/Slicer{LauncherSettings.ini,SplashScreen.png}</tt><sup>[[#fn6|[6]]]</sup> to <tt>/share/Slicer-${Ver}/</tt> | ||
− | + | (As a side note, honoring LIB_SUFFIX also would be nice. This is common idiom in e.g. [http://www.fedoraproject.org Fedora] packaging to install libraries to <tt>lib64</tt> rather than <tt>lib</tt>, when building for architectures where that is appropriate.) | |
− | + | === Footnotes === | |
+ | # <span id="fn1"></span> The FHS (e.g. 3.1) strongly discourages adding entries to <tt>/</tt> or <tt>/usr</tt>. Anyway, this clearly should be in <tt>/bin</tt> so that it is in a reasonable <tt>PATH</tt>. On UNIX systems where <tt>PREFIX=/opt/<i><product></i></tt> (or perhaps as a CMake option), it might be okay to install a symlink in <tt>${PREFIX}</tt>. On Windows, a shortcut could be used similarly. | ||
+ | # <span id="fn2"></span> 3.4.2 forbids subdirectories in <tt>/bin</tt>. While not stated explicitly for <tt>/usr/bin</tt>, many systems now symlink <tt>/bin</tt> to <tt>/usr/bin</tt>, implicitly forwarding the prohibition. Additionally, the files contained herein are not executables but are library code that clearly belong under <tt>/lib</tt> or <tt>/share</tt>. | ||
+ | # <span id="fn3"></span> Which option is selected is left to discussion. One of the <tt>/lib</tt> choices is probably more conformant, but would make these modules accessible from a standard Python shell, which may not be desirable (except for SlicerWizard). | ||
+ | # <span id="fn4"></span> For a standard installation, all products should be installed to <tt>${PREFIX}</tt>; <tt><i><product></i>_PREFIX=${Slicer_PREFIX}/lib/<i><product></i></tt> is non-standard. | ||
+ | # <span id="fn5"></span> Convention for third party Qt plugins (e.g. see KDE) is a subdirectory (e.g. <tt>plugins</tt>) of <tt>/lib/<i><product></i></tt>. | ||
+ | # <span id="fn6"></span> These non-executable files do not belong in <tt>/bin</tt>. While the <tt>.ini</tt> could possible be placed in <tt>/etc</tt>, this requires special handling in the case that <tt>PREFIX=/usr</tt>; <tt>/share/Slicer-<i><Version></i></tt> also seems like a reasonable location and does not have this issue. | ||
− | + | Section references in the above are given for [http://refspecs.linuxfoundation.org/FHS_2.3/fhs-2.3.pdf the PDF version of FHS 2.3]. (The HTML version unfortunately does not number sections.) | |
− | |||
− | |||
− | |||
− | 2. 3. | ||
− | |||
− | 3. | ||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 20:52, 10 April 2014
Home < Documentation < Labs < FHSCompliantDirectoryStructureThe current install tree structure as documented on Documentation/Nightly/Developers is not fully compliant with the Filesystem Hierarchy Standard. This page aims at documentation how the structure could be updated.
Rationale
For reasons that hopefully do not require enumeration, it is desirable for Slicer to install in a reasonable manner to a system standard prefix, e.g. /usr/local or even /usr. Ultimately, it would be very cool if distributions were able to package slicer, for which reasonable FHS compliance is a requirement.
Proposal
(Originally by Matthew Woehlke - April 10, 2014)
- move /Slicer[1] to /bin/
- move /bin/Python[2] to one[3] of:
- /lib/python-${PyVer}/site-packages
- /lib/python-${PyVer}/site-packages/slicer${VerMajor}
- /share/Slicer-${Ver}/
- ...and move /bin/Python/SlicerWizard to /lib/python-${PyVer}/site-packages
- move /lib/Python/*[4] to /
- move /lib/TclTk/*[4] to /
- move /lib/QtPlugins[5] to /lib/Slicer-${Ver}/
- move /lib/Slicer*/<third party libs>[4] to /lib/
- move /bin/Slicer{LauncherSettings.ini,SplashScreen.png}[6] to /share/Slicer-${Ver}/
(As a side note, honoring LIB_SUFFIX also would be nice. This is common idiom in e.g. Fedora packaging to install libraries to lib64 rather than lib, when building for architectures where that is appropriate.)
Footnotes
- The FHS (e.g. 3.1) strongly discourages adding entries to / or /usr. Anyway, this clearly should be in /bin so that it is in a reasonable PATH. On UNIX systems where PREFIX=/opt/<product> (or perhaps as a CMake option), it might be okay to install a symlink in ${PREFIX}. On Windows, a shortcut could be used similarly.
- 3.4.2 forbids subdirectories in /bin. While not stated explicitly for /usr/bin, many systems now symlink /bin to /usr/bin, implicitly forwarding the prohibition. Additionally, the files contained herein are not executables but are library code that clearly belong under /lib or /share.
- Which option is selected is left to discussion. One of the /lib choices is probably more conformant, but would make these modules accessible from a standard Python shell, which may not be desirable (except for SlicerWizard).
- For a standard installation, all products should be installed to ${PREFIX}; <product>_PREFIX=${Slicer_PREFIX}/lib/<product> is non-standard.
- Convention for third party Qt plugins (e.g. see KDE) is a subdirectory (e.g. plugins) of /lib/<product>.
- These non-executable files do not belong in /bin. While the .ini could possible be placed in /etc, this requires special handling in the case that PREFIX=/usr; /share/Slicer-<Version> also seems like a reasonable location and does not have this issue.
Section references in the above are given for the PDF version of FHS 2.3. (The HTML version unfortunately does not number sections.)