diff --git a/src/new/debian.rs b/src/new/debian.rs index 2f76c25..212793c 100644 --- a/src/new/debian.rs +++ b/src/new/debian.rs @@ -23,6 +23,11 @@ pub const SOURCE_FORMAT_NATIVE: &str = "3.0 (native)"; /// The three source formats pkh knows how to build. pub const KNOWN_SOURCE_FORMATS: [&str; 3] = [SOURCE_FORMAT_QUILT, SOURCE_FORMAT_NATIVE, "1.0"]; +/// Current Debian Policy version, written as the `Standards-Version` of the +/// generated `debian/control` (mandatory in the source stanza per policy). +/// Bump as policy evolves. +pub const DEBIAN_POLICY_VERSION: &str = "4.7.4"; + /// Directory and file names excluded from the orig tarball, at any depth of /// the tree. const ORIG_EXCLUDE: &[&str] = &[ @@ -197,6 +202,7 @@ fn control(opts: &NewOptions, template: &dyn Template) -> OutputFile { opts.maintainer.0, opts.maintainer.1 )); control.push_str("Rules-Requires-Root: no\n"); + control.push_str(&format!("Standards-Version: {DEBIAN_POLICY_VERSION}\n")); let mut build_depends = vec!["debhelper-compat (= 13)".to_string()]; build_depends.extend(template.build_depends(opts)); @@ -601,6 +607,10 @@ mod tests { assert_eq!(parsed.source.get("Section"), Some("utils")); assert_eq!(parsed.source.get("Priority"), Some("optional")); assert_eq!(parsed.source.get("Rules-Requires-Root"), Some("no")); + assert_eq!( + parsed.source.get("Standards-Version"), + Some(DEBIAN_POLICY_VERSION) + ); assert_eq!( parsed.source.get("Homepage"), Some("https://example.com/mytool")