{
  "$schema": "https://packageurl.org/purl-schemas/purl-type-definition.schema-1.1.json",
  "$id": "https://packageurl.org/purl-types/cpan-definition.json",
  "type": "cpan",
  "type_name": "CPAN",
  "description": "Perl package distributions published on CPAN",
  "repository": {
    "use_repository": true,
    "default_repository_url": "https://www.cpan.org/"
  },
  "namespace_definition": {
    "requirement": "optional",
    "native_name": "CPAN author/publisher ID (CPANID)",
    "note": "When present, it represents the CPAN author/publisher ID (CPANID) and shall be uppercase. It is appropriate to use 'namespace' for compatibility with existing CPAN purl producers/consumers or when a workflow explicitly requires author-scoped identifiers. For new identifiers, the 'author' qualifier is the preferred way to specify the author/publisher. When 'version' is omitted, author scoping via 'namespace' may be ambiguous because a distribution can change maintainers over time."
  },
  "name_definition": {
    "requirement": "required",
    "case_sensitive": true,
    "native_name": "distribution name",
    "note": "The name is the distribution name and is case sensitive. A distribution name shall not contain the string '::'"
  },
  "version_definition": {
    "note": "The version is the distribution version",
    "requirement": "optional",
    "native_name": "version"
  },
  "qualifiers_definition": [
    {
      "key": "author",
      "requirement": "optional",
      "description": "CPAN author/publisher ID (CPANID)"
    },
    {
      "key": "distpath",
      "requirement": "optional",
      "description": "Repository-relative path (not a URL) to the distribution archive or directory, typically under 'authors/id/...'"
    },
    {
      "key": "repository_url",
      "requirement": "optional",
      "description": "CPAN/MetaCPAN/BackPAN/DarkPAN repository base URL"
    },
    {
      "key": "download_url",
      "requirement": "optional",
      "description": "URL of package or distribution"
    },
    {
      "key": "vcs_url",
      "requirement": "optional",
      "description": "extra URL for a package version control system"
    },
    {
      "key": "ext",
      "requirement": "optional",
      "description": "distribution file extension",
      "default_value": "tar.gz"
    }
  ],
  "note":"The PURL 'name' shall be the CPAN distribution name (case sensitive) and shall not contain the '::' separator (module name). The CPAN author/publisher ID (CPANID) is OPTIONAL: when needed, it should be provided using the 'author' qualifier. The PURL 'namespace' is OPTIONAL and, when present, represents the CPANID and shall be uppercase; it may be used for compatibility with existing identifiers or tooling. When PURL 'version' is omitted, author scoping (via 'author' qualifier or 'namespace') may be ambiguous because a distribution can change maintainers over time.",
  "examples": [
    "pkg:cpan/perl@5.42",
    "pkg:cpan/DBI@1.646",
    "pkg:cpan/SBOM-CycloneDX",
    "pkg:cpan/URI-PackageURL?author=GDT",
    "pkg:cpan/libwww-perl@6.76?author=OALDERS",
    "pkg:cpan/DateTime@1.55?author=DROLSKY&repository_url=backpan.perl.org",
    "pkg:cpan/Term-Gnuplot@0.90380906?distpath=authors%2Fid%2FI%2FIL%2FILYAZ%2Fmodules%2FTerm-Gnuplot-0.90380906.zip"
  ]
}
