  We study smectic-liquid-crystal order in a cell with a heterogeneous
substrate imposing surface random positional and orientational pinnings.
Proposing a minimal random elastic model, we demonstrate that, for a thick
cell, the smectic state without a rubbed substrate is always unstable at long
scales and, for weak random pinning, is replaced by a smectic glass state. We
compute the statistics of the associated substrate-driven distortions and the
characteristic smectic domain size on the heterogeneous substrate and in the
bulk. We find that for weak disorder, the system exhibits a three-dimensional
temperature-controlled phase transition between a weakly and strongly pinned
smectic glass states akin to the Cardy-Ostlund phase transition. We explore
experimental implications of the predicted phenomenology and suggest that it
provides a plausible explanation for the experimental observations on polarized
light microscopy and x-ray scattering.
