From be4c5e5011c0adc04189fbb00433e7e75e13fce1 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Jan 22 2023 15:30:49 +0000 Subject: [PATCH 1/4] Fix fedpkg --release values in tutorial Most of the Packaging Tutorial: GNU Hello is written to use --release value matching user's local Fedora release. The lint and scratch build sections were specifying --release rawhide. Lint does not even work correclty, because it does not find any rpms to lint, and the scratch build part is simply confusing because it suddenly does a different thing than the rest of the tutorial. Fix by using user's local release everywhere. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index acb9abd..0eae088 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -347,8 +347,9 @@ Next you should check them for conformance with RPM design rules, by running `rpmlint` on specfile, source rpm and binary rpm. Command `+fedpkg lint+` does this: +[subs="attributes+"] ---- -$ fedpkg --release rawhide lint +$ fedpkg --release f{MAJOROSVER} lint ---- If all is good, there should be no warnings or errors. @@ -555,7 +556,7 @@ See xref:Installing_Packager_Tools.adoc#kerberos_ticket[Acquiring Kerberos Ticke [subs="attributes+"] ---- -$ fedpkg --release rawhide build --scratch --srpm results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.src.rpm +$ fedpkg --release f{MAJOROSVER} build --scratch --srpm results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.src.rpm Building hello-2.10-1.fc{MAJOROSVER}.src.rpm for f{MAJOROSVER}-candidate Created task: 92465688 Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=92465688 From 0674cf5c52a7ce32322ade6a054ea29c0477840f Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Jan 22 2023 15:30:49 +0000 Subject: [PATCH 2/4] Tutorial: Fix Texinfo dir removal instructions The instructions gave the impression that the installed Texinfo 'dir' file should be done at the very start of %install. Actually, it should be done after %make_install is called, so that the file has been copied to buildroot. Fix by clarifying the instructions. Also, the macros used as parameters to 'rm' expanded to a double slash '//'. It worked, but was unclear. Fix by removing literal '/'. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index 0eae088..7344519 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -247,14 +247,13 @@ The https://src.fedoraproject.org/rpms/texinfo[texinfo package] has rpm triggers that automatically generate the Texinfo `+dir+` file from all the texinfo pages in the system. Thus, the `+dir+` generated by GNU Hello build script must not be installed. -This is done by calling `+rm+` in `+%install+`. -However, note that files are installed in the _buildroot_ directory, -and thus the removal is done like this: +This can be done by removing it from the _buildroot_ at the end of the `+%install+` section: [source, rpm-spec] ---- %install -rm %{buildroot}/%{_infodir}/dir +%make_install +rm %{buildroot}%{_infodir}/dir ---- === Translations From 6941760fb0e6eaf55b79e8b952bfb3a5a08046e7 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Jan 22 2023 15:30:49 +0000 Subject: [PATCH 3/4] Tutorial: Use long form rpm parameters everywhere In Packaging Tutorial: GNU Hello, most calls to the rom command line tool already use the long understandable forms of arguments, such as --query instead of -q. There was a single listing remaining that used the short form -q. Fix by switching to --query. Parameter order is also changed to be more human-readable. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index 7344519..a39a6a7 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -111,7 +111,7 @@ and talk to the authors as needed. The `+%changelog+` should document the work on preparing the RPM, especially if there are security and bug patches included on top of the base upstream source. -Changelog data can be displayed by `+rpm --changelog -q PACKAGE_NAME+`, +Changelog data can be displayed by `+rpm --query --changelog PACKAGE_NAME+`, 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 From 289b318dfdf06941498813d965a30b55067acf25 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Jan 22 2023 15:30:49 +0000 Subject: [PATCH 4/4] Tutorial: Use 'fedpkg scratch-build' convenience Fedpkg has the convenience command 'fedpkg scratch-build' that does the same as 'fedpkg build --scratch'. Switch to use the convenient format, because its intent is clearer and it is also more common elsewhere in the docs. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index a39a6a7..5dcca8a 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -548,14 +548,14 @@ Even though the package is not part of Fedora distrubution yet, a xref:Using_the_Koji_Build_System.adoc#scratch_builds[scratch build] can be performed to ensure that the package builds successfully in Fedora's Koji build system, and that it builds successfully for all architectures supported by Fedora. -Such build is started by passing a source rpm package to `fedpkg build --scratch`. +Such build is started by passing a source rpm package to `fedpkg scratch-build`. Note that Koji uses Kerberos for authentication. See xref:Installing_Packager_Tools.adoc#kerberos_ticket[Acquiring Kerberos Ticket] for details. [subs="attributes+"] ---- -$ fedpkg --release f{MAJOROSVER} build --scratch --srpm results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.src.rpm +$ fedpkg --release f{MAJOROSVER} scratch-build --srpm results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10-1.fc{MAJOROSVER}.src.rpm Building hello-2.10-1.fc{MAJOROSVER}.src.rpm for f{MAJOROSVER}-candidate Created task: 92465688 Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=92465688