summaryrefslogtreecommitdiffstats
path: root/Utilities/Release/files-v1.rst
blob: b7ca2fd71f55e09a369e4a3df21b42f3dbf01eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
File Table v1
*************

The set of package files distributed on ``cmake.org`` varies by CMake version.
One file, named ``cmake-<ver>-files-v1.json``, contains a table of the package
files available for a given version.  Clients may use this to find other files.

Format
------

The format is a JSON object:

.. code-block:: json

  {
    "version": {
      "major": 3, "minor": 18, "patch": 6,
      "string": "3.18.6"
    },
    "files": [
      {
        "os": ["...", "..."],
        "architecture": ["...", "..."],
        "class": "...",
        "name": "..."
      }
    ],
    "hashFiles": [
      {
        "algorithm": ["...", "..."],
        "name": "cmake-<version>-<algo>.txt",
        "signature": ["cmake-<version>-<algo>.txt.asc"]
      }
    ]
  }

The members are:

``version``
  A JSON object specifying the version of CMake with members:

  ``major``, ``minor``, ``patch``
    Integer values specifying the major, minor, and patch version components.

  ``suffix``
    A string specifying the version suffix, if any, e.g. ``rc1``.

  ``string``
    A string specifying the full version in the format
    ``<major>.<minor>.<patch>[-<suffix>]``.

``files``
  A JSON array of entries corresponding to available package files.
  Each entry is a JSON object containing members:

  ``os``
    A JSON array of strings naming the operating system for which the
    package file is built, possibly using multiple alternative spellings.
    Possible names include:

    ``source``
      Source packages.

    ``Linux``, ``linux``
      Linux packages.

    ``macOS``, ``macos``
      macOS packages.

    ``Windows``, ``windows``
      Windows packages.

  ``architecture``
    A JSON array of strings naming the architecture(s) for which the
    package file is built, possibly using multiple alternative spellings.
    Source packages have an empty list of architectures (``[]``).
    Binary packages have a non-empty list of architectures, with at least
    one name matching the output of ``uname -m`` on corresponding hosts.
    On Windows, architecture names include ``x86_64`` and ``i386``.
    On macOS, universal binary packages list all architectures,
    e.g. ``["arm64","x86_64"]``.

  ``class``
    A JSON string naming the class of package.  The value is one of:

    ``archive``
      A tarball or zip archive.
      The extension, such as ``.tar.gz`` or ``.zip``, indicates the format.
      The rest of the file name matches the top-level directory in the archive.

    ``installer``
      An interactive installer.

    ``volume``
      A disk image (``.dmg`` on macOS).

  ``name``
    A JSON string specifying the name of the package file.

  ``macOSmin``
    Optional member that is present on package files for macOS.
    The value is a JSON string specifying the minimum version of macOS
    required to run the binary, e.g. ``"10.10"``.

``hashFiles``
  A JSON array of entries corresponding to files containing cryptographic
  hashes of the package file contents.  Each entry is a JSON object
  containing members:

  ``algorithm``
    A JSON array of strings naming a cryptographic hash algorithm, possibly
    using multiple alternative spellings, e.g. ``["sha256", "SHA-256"]``.

  ``name``
    A JSON string specifying the name of the file containing hashes,
    e.g. ``"cmake-<version>-SHA-256.txt"``.

  ``signature``
    A JSON array of strings naming files containing a cryptographic
    signature of the hash file specified by ``name``, e.g.
    ``["cmake-<version>-SHA-256.txt.asc"]``.

The table and hash files are generated by `files.bash`_ from
the `files-v1.json.in`_ template and the package files themselves.

.. _`files.bash`: files.bash
.. _`files-v1.json.in`: files-v1.json.in

Queries
-------

Clients may download the `File Table v1`_ file ``cmake-<ver>-files-v1.json``
and query it to get the name(s) of specific package files adjacent to it.
Make queries as specific as possible in order to account for additional
alternative binaries in future CMake versions.

For example, one may use ``jq`` queries:

* To select a Windows binary archive supporting ``x86_64`` hosts::

    .files[] | select((.os[] | . == "windows") and
                      (.architecture[] | . == "x86_64") and
                      (.class == "archive")) | .name

* To select a Linux binary archive supporting ``x86_64`` hosts::

    .files[] | select((.os[] | . == "linux") and
                      (.architecture[] | . == "x86_64") and
                      (.class == "archive")) | .name

* To select a macOS binary archive supporting ``arm64`` hosts::

    .files[] | select((.os[] | . == "macos") and
                      (.architecture[] | . == "arm64") and
                      (.class == "archive")) | .name

* To select a SHA-256 hash file::

    .hashFiles[] | select(.algorithm[] | . == "SHA-256") | .name