Skip to content

Clarify RPM packaging specification requirements - #72

Open
misaka00251 wants to merge 1 commit into
openRuyi-Project:mainfrom
misaka00251:fix-packaging-specification
Open

Clarify RPM packaging specification requirements#72
misaka00251 wants to merge 1 commit into
openRuyi-Project:mainfrom
misaka00251:fix-packaging-specification

Conversation

@misaka00251

Copy link
Copy Markdown
Member

Summary

Update the openRuyi RPM Packaging Specification and synchronize its Chinese translation.

Changes

  • Clarify mandatory and conditional Spec tags and their ordering.
  • Define URL and VCS fallback requirements.
  • Document Source numbering, RemoteAsset annotations, and SHA-256 checksums.
  • Clarify when BuildSystem is required or may be omitted.
  • Define ordering and formatting rules for patches and BuildOption.
  • Strengthen BuildRequires and runtime dependency requirements.
  • Clarify %files, package splitting, and upgrade continuity rules.
  • Update the Chinese translation to match the English specification.

Related to: openRuyi-Project/openRuyi#1227

- clarify tag ordering and conditional fields
- define Source, RemoteAsset, and BuildSystem requirements
- document dependency, patch, and subpackage rules
- sync the Chinese translation

Signed-off-by: misaka00251 <liuxin@iscas.ac.cn>
@misaka00251 misaka00251 added the Type: Documentation Issues relevant to anything documentation. label Sep 3, 2026
1. `URL` MUST point to the upstream project's official homepage; if one does not exist, it MAY point to the source code repository.

2. The `URL` tag MUST NOT dynamically construct its value using macros such as `%{name}`.
2. When the upstream project does not provide an official homepage but provides a public source repository, the Spec MUST set `URL` to a meaningful project location, normally the source repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 和 2 逻辑有一定模糊, 在相同条件描述最终指向源码仓,但是 1 是 MAY 2 是 MUST ,建议 第一条 说 如果没有,就 MUST 什么,第二条解释 第二个 must 具体主要是指 source repository.(注意中文一起改)

### Source

1. `Source` MUST specify the URI for downloading the upstream source archive (or a mathematically equivalent, reproducible archive).
1. A Spec that consumes source files or other source inputs MUST declare those inputs using RPM source declarations such as `Source`, `SourceN`, or `%sourcelist`, as appropriate. It MUST specify the URI for downloading the upstream source archive (or a mathematically equivalent, reproducible archive). But if a package that does not consume any source input MAY omit source declarations entirely. Dependency-only meta-packages are a common example.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source 的来源不一定是上游,也可以是本地输入, 本地输入是需要做简单注释来辅助维持长期维护的


5. For any network-fetched `Source`, a `#!RemoteAsset` comment MUST immediately precede the `Source` declaration. If multiple external sources exist, each MUST be individually annotated.

6. For any `Source` fetched using the HTTP or HTTPS protocol, the SHA-256 checksum of the source archive MUST be documented on the line following the `#!RemoteAsset` comment.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有歧义,表达的是行中,但是断句是 on ,the line following xxx , 还是 on the line, following..

4. For any `Source` fetched using the HTTP or HTTPS protocol, the SHA-256 checksum of the source archive MUST be documented on the line following the `#!RemoteAsset` comment.
4. If the `URL` tag value can serve as a valid prefix for the source link, `Source` MAY leverage the `%{url}` macro.

5. For any network-fetched `Source`, a `#!RemoteAsset` comment MUST immediately precede the `Source` declaration. If multiple external sources exist, each MUST be individually annotated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里少了一个 #!CreateArchive 标签的情况


### BuildRequires

1. `BuildRequires` MUST list all build-time dependencies exhaustively.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能补充一句 只有动态机制没有覆盖的依赖才需要静态补充

2. These dependencies MUST adhere to the "one dependency per line" formatting rule.

3. For standard C/C++ applications, it is generally unnecessary to explicitly specify a compiler like `gcc`.
3. When a package requires no additional build-time dependencies beyond the guaranteed basic build environment, the Spec MAY omit `BuildRequires`. For example, for standard C/C++ applications, it is generally unnecessary to explicitly specify a compiler like `gcc`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能说默认不要 gcc 之类,建议是形成一个引用清单,有个 basic build environment 什么的注释 和引用链接,目标是尽量一份 spec 能自动推导出完整相关上下文,减少约定俗成

TODO
The following example shows a valid minimal structure for a package that does not need upstream source input, a build system, build dependencies, or explicit runtime dependencies:

```specfile

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

字段顺序要考虑子包,是不是可以递归适用

### %files

The `%files` section MUST inventory all artifacts bundled into the resulting binary package, adhering to the following constraints:
Every Spec MUST contain a `%files` section for the main package. The `%files` section MUST inventory all artifacts bundled into the resulting binary package, adhering to the following constraints:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有没有只有子包的 spec,有的话这样就一定有一个空主包,是必要的吗

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for example: SPECS/stb/stb.spec

@@ -283,10 +368,12 @@ Source1: https://example.org/example-%{version}-additional.tar.gz
4. 若使用 `BuildOption`,其位置应当位于 `BuildSystem` 与 `BuildRequires` 之间。

5. `BuildOption` 的书写顺序,应当与 RPM 的构建过程保持一致,即:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

即与英语 for example 不等价

openRuyi 项目需要大量第三方软件包以构建可用、可维护的发行版。为降低包维护与审查成本、提升仓库一致性与可预测性,本规范定义 openRuyi 软件包 RPM Spec 文件 (以下简称 Spec) 的最低一致性要求与格式约定。

本规范关注的对象是 Spec 这一 目标产物 本身:我们期望交付到仓库中的 Spec 在结构、字段、组织、命名与宏使用上应呈现的形态。任何满足本规范的 Spec,均应可被一致地理解、审查与复用。
本规范关注的对象是 Spec 这一 "目标产物" 本身:我们期望交付到仓库中的 Spec 在结构、字段、组织、命名与宏使用上应呈现的形态。任何满足本规范的 Spec,均应可被一致地理解、审查与复用。

@Jingwiw Jingwiw Sep 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里规范回退了,应该是全角,其他地方还有类似相关问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Documentation Issues relevant to anything documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants