aboutcode-org / aboutcode-org/scancode-toolkit

Add support for FreeBSD Ports and packages

Abierto
#1,073 6 comentarios 0 reacciones 1 asignado Reclamado por @steven-esser Ver en GitHub
new feature package scan package-formats
Lenguaje dominante
Python
Estrellas
2.6k
Forks
791
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

Ports are the packages for FreeBSD. They area built from sources and also available as pre-built binaries.

- The main site is at: https://www.freebsd.org/ports/
- The doc is at https://www.freebsd.org/doc/handbook/ports.html
- Source are in SVN at https://svnweb.freebsd.org/ports/head/
- And binaries at http://pkg.freebsd.org/

An example of a "port" would be this on the source side:
https://svnweb.freebsd.org/ports/head/sysutils/dmidecode/

The main source-side "metafile" is the Makefile:
https://svnweb.freebsd.org/ports/head/sysutils/dmidecode/Makefile?view=markup

The binaries are there (by architectures and releases):
https://pkg.freebsd.org/FreeBSD:10:amd64/release_1/All/

The index https://pkg.freebsd.org/FreeBSD:10:amd64/release_3/packagesite.txz may be of seom interest in the future and contains a packagesite.yaml which has one valid YAML doc in flowstyle per line, each being package data.

Note: the field "origin" contains a path back to the SVN ports tree
e.g. with origin="x11/xrefresh" we can go to https://svnweb.freebsd.org/ports/head/x11/xrefresh/

For dmidecode as an example package, the tarball:

https://pkg.freebsd.org/FreeBSD:10:amd64/release_1/All/dmidecode-2.12.txz

would contain this +COMPACT_MANIFEST file as a YAML file (same strcuture as each line in the packagesite.yaml above):
```
"name": "dmidecode",
"origin": "sysutils/dmidecode",
"version": "2.12",
"name": "dmidecode",
"origin": "sysutils/dmidecode",
"version": "2.12",
"arch": "freebsd:10:x86:64",
"maintainer": "anders@FreeBSD.org",
"prefix": "/usr/local",
"www": "http://www.nongnu.org/dmidecode/",
"flatsize": 188874,
"comment": "Tool for dumping DMI (SMBIOS) contents in human-readable format",
"licenselogic": "single",
"licenses": [
"GPLv2"
],
"desc": "Dmidecode is a tool or dumping a computer's DMI (some say SMBIOS) table\ncontents in a human-readable format. The output contains a description of the\nsystem's hardware components, as well as other useful pieces of information\nsuch as serial numbers and BIOS revision.\n\nWWW: http://www.nongnu.org/dmidecode/",
"categories": [
"sysutils"
]
"arch": "freebsd:10:x86:64",
"maintainer": "anders@FreeBSD.org",
"prefix": "/usr/local",
"www": "http://www.nongnu.org/dmidecode/",
"flatsize": 188874,
"comment": "Tool for dumping DMI (SMBIOS) contents in human-readable format",
"licenselogic": "single",
"licenses": [
"GPLv2"
],
"desc": "Dmidecode is a tool or dumping a computer's DMI (some say SMBIOS) table\ncontents in a human-readable format. The output contains a description of the\nsystem's hardware components, as well as other useful pieces of information\nsuch as serial numbers and BIOS revision.\n\nWWW: http://www.nongnu.org/dmidecode/",
"categories": [
"sysutils"
]
}
```

Based on this we should be able to write a package manifest parser to read/report this metadata. For now we should IMHO focus only on the +COMPACT_MANIFEST.

We may need to map the FreeBSD license "codes" to proper keys, as a bonus.

Some possible fields mapping:
- "name": "dmidecode",
- "origin": "sysutils/dmidecode", ==> can be used to infer the source URL for the package
- "version": "2.12",
- "arch": "freebsd:10:x86:64", ==> can may be used to infer the binary URL for the package such as https://pkg.freebsd.org/freebsd:10:x86:64/latest/All/dmidecode-2.12.txz
- "maintainer": "anders@FreeBSD.org", ==> a Party
- "prefix": "/usr/local", ==> useless for now
- "www": "http://www.nongnu.org/dmidecode/", ==> homepage
- "flatsize": 188874, ==> not useful
- "comment": "Tool for dumping DMI (SMBIOS) contents in human-readable format", ==> first line of description
- "licenselogic": "single", ==> these two would be the asserted
- "licenses": [
"GPLv2"
],
- "desc": "Dmidecode is a tool or dumping a computer's DMI (some say SMBIOS) table\ncontents in a human-readable format. The output contains a description of the\nsystem's hardware components, as well as other useful pieces of information\nsuch as serial numbers and BIOS revision.\n\nWWW: http://www.nongnu.org/dmidecode/", ==> rest of description
- "categories": [ ==> keywords
"sysutils"
]

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.