rpm_spec_profile/lib.rs
1//! Distribution profiles for the RPM spec analyzer.
2//!
3//! A [`Profile`] is the resolved target environment a `.spec` file is
4//! analyzed against — identity (family/vendor/dist tag), the full macro
5//! registry, rpmlib features, license/group whitelists. Layered:
6//! builtin baseline → `rpm --showrc` dump → user overrides.
7//!
8//! Sources of profile data:
9//! 1. Builtins compiled into the binary (`data/<name>.toml`, loaded via
10//! [`builtin`]). On first release only `generic` exists.
11//! 2. A `rpm --showrc` dump from the target host, parsed by [`showrc`].
12//! 3. User overrides in `.rpmspec.toml` `[profiles.<name>.*]`, deserialised
13//! via [`config_layer`] and merged on top.
14//!
15//! Entry point: [`resolve_profile`].
16
17#![forbid(unsafe_code)]
18#![warn(missing_debug_implementations)]
19// TODO(pre-1.0): document the public surface and remove this allow.
20// Currently 103 items lack `///` doc comments — chiefly per-rule
21// structs in `rules/` and per-layer config types. Tracked separately
22// from publication.
23#![allow(missing_docs)]
24
25pub mod autodetect;
26pub mod builtin;
27pub mod config_layer;
28pub mod merge;
29pub mod overrides;
30pub mod resolve;
31pub mod showrc;
32pub mod types;
33
34pub use config_layer::{
35 ListOverride, MacroOverride, ProfileEntry, ProfileIdentityOverride, ProfileSection,
36};
37pub use overrides::{CliDefine, DefineParseError, parse_define};
38pub use resolve::{ResolveError, ResolveOptions, resolve as resolve_profile};
39pub use types::{
40 ArchInfo, Family, GroupList, Identity, LayerInfo, LicenseList, MacroEntry, MacroRegistry,
41 MacroValue, Profile, Provenance, RpmlibFeatures, ValidationMode,
42};