diff --git a/purl-types-index.json b/purl-types-index.json index d7c170fa..f330a8b7 100644 --- a/purl-types-index.json +++ b/purl-types-index.json @@ -3,6 +3,7 @@ "apk", "bitbucket", "bitnami", + "bsd", "cargo", "cocoapods", "composer", diff --git a/tests/types/bsd-test.json b/tests/types/bsd-test.json new file mode 100644 index 00000000..8e0999b2 --- /dev/null +++ b/tests/types/bsd-test.json @@ -0,0 +1,52 @@ +{ + "$schema": "https://packageurl.org/schemas/purl-test.schema-1.0.json", + "tests": [ + { + "description": "Rountrip test for PURL", + "test_group": "base", + "test_type": "roundtrip", + "input": "pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3", + "expected_output": "pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3", + "expected_failure": false, + "expected_failure_reason": null + }, + { + "description": "Build test for PURL", + "test_group": "base", + "test_type": "build", + "input": { + "type": "bsd", + "namespace": "freebsd", + "name": "emacs", + "version": "30.1_2", + "qualifiers": { + "distro": "14.3", + "epoch": 3 + }, + "subpath": null + }, + "expected_output": "pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3", + "expected_failure": false, + "expected_failure_reason": null + }, + { + "description": "Parse test for PURL", + "test_group": "base", + "test_type": "parse", + "input": "pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3", + "expected_output": { + "type": "bsd", + "namespace": "freebsd", + "name": "emacs", + "version": "30.1_2", + "qualifiers": { + "distro": "14.3", + "epoch": 3 + }, + "subpath": null + }, + "expected_failure": false, + "expected_failure_reason": null + } + ] +} \ No newline at end of file diff --git a/types-doc/bsd-definition.md b/types-doc/bsd-definition.md new file mode 100644 index 00000000..9faa7c87 --- /dev/null +++ b/types-doc/bsd-definition.md @@ -0,0 +1,49 @@ + + +# PURL Type Definition: bsd + +- **Type Name:** BSD +- **Description:** BSD Operating System variant packages, primarily focused on FreeBSD with extensibility for other BSD variants such as OpenBSD, DragonFly BSD. Note: since NetBSD's package manager is designed for cross-platform use, it should use its own dedicated PURL type. +- **Schema ID:** `https://packageurl.org/types/bsd-definition.json` + +## PURL Syntax + +The structure of a PURL for this package type is: + + pkg:bsd//@?# + +## Repository Information + +- **Use Repository:** Yes +- **Note:** The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate. + +## Namespace definition + +- **Requirement:** Required +- **Native Label:** vendor +- **Note:** `The namespace is the BSD variant name such as "freebsd", "openbsd", or "dragonflybsd". It is not case sensitive and must be lowercased.` + +## Name definition + +- **Case Sensitive:** Yes +- **Native Label:** name +- **Note:** `The name is the package name and is case sensitive.` + +## Version definition + +- **Native Label:** version +- **Note:** `The version is the version of the package.` + +## Qualifiers Definition + +| Key | Requirement | Native name | Default Value | Description | +|------|-------------|-------------|---------------|-------------| +| arch | Optional | | | The target architecture for the package. | +| distro | Optional | | | The BSD release version or distribution variant. | +| epoch | Optional | | | The package epoch number used for version comparison when normal version ordering is insufficient. | + +## Examples + +- `pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3` +- `pkg:bsd/freebsd/python311@3.11.13?distro=14.3` diff --git a/types/bsd-definition.json b/types/bsd-definition.json new file mode 100644 index 00000000..11cf2510 --- /dev/null +++ b/types/bsd-definition.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://packageurl.org/schemas/purl-type-definition.schema-1.0.json", + "$id": "https://packageurl.org/types/bsd-definition.json", + "type": "bsd", + "type_name": "BSD", + "description": "BSD Operating System variant packages, primarily focused on FreeBSD with extensibility for other BSD variants such as OpenBSD, DragonFly BSD. Note: since NetBSD's package manager is designed for cross-platform use, it should use its own dedicated PURL type.", + "repository": { + "use_repository": true, + "note": "The default repository is http://pkg.freebsd.org for FreeBSD. Other BSD variants may use different repositories as appropriate." + }, + "namespace_definition": { + "native_name": "vendor", + "is_case_sensitve": false, + "note": "The namespace is the BSD variant name such as \"freebsd\", \"openbsd\", or \"dragonflybsd\". It is not case sensitive and must be lowercased.", + "requirement": "required" + }, + "name_definition": { + "note": "The name is the package name and is case sensitive.", + "case_sensitive": true, + "native_name": "name" + }, + "version_definition": { + "native_name": "version", + "note": "The version is the version of the package." + }, + "qualifiers_definition": [ + { + "key": "arch", + "description": "The target architecture for the package." + }, + { + "key": "distro", + "description": "The BSD release version or distribution variant." + }, + { + "key": "epoch", + "description": "The package epoch number used for version comparison when normal version ordering is insufficient." + } + ], + "examples": [ + "pkg:bsd/freebsd/emacs@30.1_2?distro=14.3&epoch=3", + "pkg:bsd/freebsd/python311@3.11.13?distro=14.3" + ] +}