#873 Fix formatting of Dist Tag guidelines.
Closed 5 years ago by ignatenkobrain. Opened 5 years ago by vondruch.
vondruch/packaging-committee fix-dist-tag-guidelines  into  master

@@ -2,7 +2,7 @@ 

  

  Use of the `+%{?dist}+` tag is mandatory in Fedora.

  

- You should consider this document as an addendum to the Packaging/NamingGuidelines .

+ You should consider this document as an addendum to the xref:Naming.adoc[Naming Guidelines].

  

  == Purpose of the Dist Tag

  
@@ -16,11 +16,11 @@ 

  

  Yes. It is very useful in maintaining proper ordering between Fedora releases and consistency in release tags is very helpful to the automated tools which are used to perform mass rebuilds.

  

- == Using %\{?dist}

+ == Using `+%{?dist}+`

  

  Here is the important information to know:

  

- === Possible values for %\{dist}

+ === Possible values for `+%{dist}+`

  

  When you run fedpkg commands like `+fedpkg build+`, the values for `+%{dist}+` and its helper variables are assigned according to the git branch that you are working in. You do NOT need to define these variables in your spec file. fedpkg will magically set `+%{?dist}+` for you.

  
@@ -28,12 +28,12 @@ 

  

  [cols=",",options="header",]

  |==================================================================================

- |OS |%\{?dist} tag

+ |OS |%{?dist} tag

  |RHEL 6 (all variants) |.el6

  |RHEL 7 (all variants) |.el7

- |Fedora \{\{FedoraVersionNumber |previous}} |.fc\{\{FedoraVersionNumber |previous}}

- |Fedora \{\{FedoraVersionNumber |current}} |.fc\{\{FedoraVersionNumber |current}}

- |Fedora \{\{FedoraVersionNumber |next}} |.fc\{\{FedoraVersionNumber |next}}

+ |Fedora {PREVVER} |.fc{PREVVER}

+ |Fedora {CURRENTVER} |.fc{CURRENTVER}

+ |Fedora {NEXTVER} |.fc{NEXTVER}

  |(and so on)

  |==================================================================================

  
@@ -46,7 +46,7 @@ 

  

  Note that RHEL dist tags are only defined for EPEL packages.

  

- === %\{?dist} in the Release: field

+ === %{?dist} in the Release: field

  

  The `+%{?dist}+` tag is included in the Release field as follows:

  
@@ -82,7 +82,7 @@ 

  

  `+%{rhl}+`: This variable is only defined on Red Hat Linux builds. If defined, it is set to the release number of Red Hat Linux present at build time.

  

- `+%{fc#}+`: This variable is only defined on Fedora builds. For example, on Fedora 20 builds, `+%{fc20}+` is defined to 1.

+ `+%{fc#}+`: This variable is only defined on Fedora builds. For example, on Fedora {CURRENTVER} builds, `+%{{CURRENTVER}}+` is defined to 1.

  

  `+%{el#}+`: This variable is only defined on Red Hat Enterprise Linux builds. For example, on RHEL 7 builds, `+%{el7}+` is defined to 1.

  
@@ -127,19 +127,19 @@ 

  

  Without the extra 0, if `+%{rhel}+` is undefined, the `+%if+` conditional will cease to exist, and the rpm will fail to build.

  

- === Things that you cannot use %\{?dist} for

+ === Things that you cannot use %{?dist} for

  

  * You must not override the variables for `+%{dist}+` (or any of the related variables).

  * You must not hardcode a value for `+%{dist}+` (or any of the related variables) in your spec.

- * You must not hardcode a dist tag in the spec: *BAD:* Release: 1.fc20 *GOOD:* Release: 1%\{?dist}

+ * You must not hardcode a dist tag in the spec: *BAD:* Release: 1.fc{CURRENTVER} *GOOD:* Release: 1%{?dist}

  * You cannot put any sort of "tagging" in `+%{dist}+` (or any of the related variables). `+%{dist}+` (and its related variables) exist ONLY to define the distribution that a package was built against.

  * `+%{?dist}+` must never be used in the Name or Version fields, only Release, and only as documented above.

  * `+%{fedora}+`, `+%{rhel}+`, `+%{rhl}+`, `+%{fc#}+`, `+%{el#}+` must never be used in the Name, Version, or Release fields.

  

  == Common questions

  

- Q: Why don't you just let the buildsystem (or packager) pass the value for dist to rpm, e.g. `+rpm --with dist el7+`?

+ Q: Why don't you just let the buildsystem (or packager) pass the value for dist to rpm, e.g. `+rpm --with dist el7+`? +

  A: Actually, we do. The Fedora buildsystem defines the values for dist when you run `+fedpkg+`.

  

- Q: Why is use of %\{?dist} mandatory?

+ Q: Why is use of `+%{?dist}+` mandatory? +

  A: There are very few packages which didn't use it, the primary very old reason for not using it (sharing large data packages across Fedora releases) is no longer relevant because all Fedora releases are signed with a different key, and having consistent Release: tags simplifies the automated tools which may need to increment them.

I hope I caught everything. It tries to make several versions more dynamical (not sure if it really works).

Resolves #871

this probably needs to be in

`+%{dist}+`

way. Because {dist} will expand to nothing.

this probably needs to be in
+%{dist}+

way. Because {dist} will expand to nothing.

Is it just the one specific location or is it generic remark? I still somehow missing the meaning of + ...

Backticks format text with a fixed width font.

Pluses make stuff in them verbatim - no special ASCIIDoc meaning of symbols.

If you need to use an actual plus, you can use more pluses at boundary (pluses are like violence - if it doesn't help, you just haven't used enough).

rebased onto 9fcfa39e898fcaf0018581555822fd8a220760f9

5 years ago

Per @ignatenkobrain request, I have updated the two headings.

rebased onto 64c519c

5 years ago

I've merged this with few small fixes in a45cae6

Pull-Request has been closed by ignatenkobrain

5 years ago

Actually, will this be expanded correctly: `+%{{CURRENTVER}}+`

Metadata