Menu

#200 RFE: make CDE's install layout FHS-clean and packager-overridable (don't hardcode /usr/dt, /etc/dt, /var/dt)

pending
None
2026-06-07
2026-06-03
Trung Le
No

Summary

CDE anchors its entire on-disk layout on three hardcoded roots — /usr/dt,
/etc/dt, /var/dt — and repeats those literal paths across configure,
Makefiles, C/C++ sources, build-time-preprocessed .src/.dt/.ptype files,
and help templates. As a result a distribution cannot ship CDE in an FHS-clean
layout (binaries in /usr, config in /etc/cde, state in /var/lib/cde,
arch-independent data in /usr/share/cde). Even passing --prefix=/usr does not
help: CDE_INSTALLATION_TOP ignores --prefix, the data tree lands in
root-level dirs like /usr/app-defaults and /usr/appconfig, and several
components keep probing /usr/dt regardless of configure.

This RFE proposes making the layout fully packager-overridable while keeping the
historical /usr/dt behavior as the default — i.e. no behavior change unless a
packager opts in
. It is the result of bringing CDE up on Fedora (ppc64le) under
a strict FHS layout, and is submitted as a 4-patch series.

Motivation

  • Linux distributions require FHS compliance; root-level dirs like
    /usr/app-defaults, /usr/appconfig, /usr/backdrops are not acceptable.
  • /etc/dt and /var/dt have no override mechanism at all, so config and
    runtime state cannot be moved to /etc/cde / /var/lib/cde.
  • CDE_INSTALLATION_TOP uses ${ac_default_prefix} (always /usr/dt) instead
    of ${prefix}, so --prefix is silently ignored.

Proposed change (4 patches)

  1. configure: make CDE installation roots packager-overridable.
    Make CDE_INSTALLATION_TOP honor --prefix, and add four flags so each root
    can be rebased independently (defaults preserve today's layout):

--with-cde-data-dir=DIR (default: PREFIX) --with-cde-config-dir=DIR (default: /etc/dt) --with-cde-state-dir=DIR (default: /var/dt) --with-cde-libexec-dir=DIR (default: BINDIR)

Expose the five roots as preprocessor macros in cde_config.h via
AC_DEFINE_UNQUOTED.

  1. treewide: route hardcoded /usr/dt, /etc/dt, /var/dt paths through
    CDE_* macros.
    Replace the scattered literal paths so every layer honors the
    configure overrides: ~78 C/C++ string literals, the build-time-preprocessed
    .src files (tradcpp tokens), the ToolTalk .ptype start strings baked into
    types.xdr (fixes TT_ERR_PTYPE_START / dtinfo failing to launch), and the
    help-family .hf.in bitmap pointers (fixes the "Missing Graphics" cdelogo on
    FHS builds).

  2. build: introduce CDE_DATA_TOP and migrate the arch-independent data tree.
    Split a data namespace (CDE_DATA_TOP) from CDE_INSTALLATION_TOP
    (binaries/libs/man), and wire it through Makefiles, headers and sources so
    app-defaults, appconfig, backdrops, palettes, infolib, nls, … land
    under e.g. /usr/share/cde instead of polluting /usr. Also finishes the
    data-only directories (dtinfo InfoLibSearchPath, backdrops/palettes dirs) and
    plugs two missed -DCDE_*_TOP Makefile defines.

  3. build: autoconf-ify contrib templates + add an FHS path validator.
    Convert the contrib/ helper templates (desktop entry, init/rc scripts,
    xinetd & systemd units) to configure-substituted .in files, and add
    util/check-fhs.sh to scan a staged install tree for stray hardcoded
    /usr/dt, /etc/dt, /var/dt references so coverage regressions are caught
    mechanically.

Backward compatibility

With no --with-cde-* flags, CDE_INSTALLATION_TOP/CDE_DATA_TOP default to
${prefix} and config/state default to /etc/dt / /var/dt, preserving the
existing /usr/dt/{app-defaults,appconfig,…} layout exactly. Existing builds are
unaffected.

Example FHS layout enabled by this series (Fedora)

./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
            --with-cde-data-dir=/usr/share/cde \
            --with-cde-config-dir=/etc/cde \
            --with-cde-state-dir=/var/lib/cde \
            --with-cde-libexec-dir=/usr/libexec/cde

→ binaries in /usr/bin, libs in /usr/lib, data in /usr/share/cde, config in
/etc/cde, runtime state in /var/lib/cde — no root-level pollution.

Patches: 4-patch series attached (patches 1–4). Applies cleanly on current
master (patch -p1 at the repo root / git am).

4 Attachments

Discussion

  • Jon Trulson

    Jon Trulson - 2026-06-07

    This is a great step, though it will take some time for me to test it and it would be great if others could too.

    Also, the Chinese locale was recently added, so these might need to be rebased/tweaked to support those too though that could be done as just an additional patch.

    But I will test it as soon as I can.

     
  • Jon Trulson

    Jon Trulson - 2026-06-07
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     ## Summary
    
     CDE anchors its entire on-disk layout on three hardcoded roots — `/usr/dt`,
    
    • status: open --> pending
     

Log in to post a comment.

Auth0 Logo