From b094671d066bf315968a32ff630dccd60b493689 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Feb 09 2023 08:31:05 +0000 Subject: Use rpmautospec in the packaging tutorial This approach is recommended since "Rpmautospec by Default" (https://fedoraproject.org/wiki/Changes/Rpmautospec_by_Default), thus the tutorial should also use it. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index 5dcca8a..7a5d0e3 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -68,7 +68,7 @@ In our case, the file might start as follows: ---- Name: hello Version: 2.10 -Release: 1%{?dist} +Release: %autorelease Summary: Produces a familiar, friendly greeting License: GPLv3+ URL: https://www.gnu.org/software/hello/ @@ -92,12 +92,15 @@ you run it. %files %changelog -* Sat Oct 23 2021 Patricia Packager - 2.10-1 -- Initial version of the package +%autochangelog ---- The `+Version+` should mirror the upstream, while `+Release+` numbers our work within Fedora. +`+%autorelease+` is part of https://docs.pagure.org/fedora-infra.rpmautospec/index.html[rpmautospec], +which is https://fedoraproject.org/wiki/Changes/Rpmautospec_by_Default[recommended for Fedora packages]. +It ties `+Release+` to package's Git history. +As we do not have a Git repository, the default value 1 will be used. The first letter of the `+Summary+` should be uppercase to avoid `+rpmlint+` complaints. @@ -116,9 +119,9 @@ which is very useful, for instance, to find out if specific bug and security patches were included in the installed software, thanks to the diligent Fedora packagers who include this info with the relevant https://cve.mitre.org/[CVE] numbers. - -The `+%changelog+` entry should include the version string -to avoid `+rpmlint+` complaints. +`+%autochangelog+` also comes from rpmautospec +and populates the changelog from Git commit messages. +As we do not have a Git repository, the changelog will be empty. Multi-line sections like `+%changelog+` or `+%description+` start on a line under the directive, @@ -380,7 +383,7 @@ Here is the initial version of `hello.spec`: ---- Name: hello Version: 2.10 -Release: 1%{?dist} +Release: %autorelease Summary: Produces a familiar, friendly greeting License: GPLv3+ @@ -421,8 +424,7 @@ make check %license COPYING %changelog -* Sat Oct 23 2021 Patricia Packager - 2.10-1 -- Initial version of the package +%autochangelog ---- With this `.spec` file,