From 828c8b2574d3f686de10fd520dac0c58f184d2e9 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Oct 08 2022 11:41:55 +0000 Subject: [PATCH 1/4] Use 'fedpkg lint' in GNU Hello tutorial The tutorial used plain 'rpmlint' because older versions of 'fedpkg' had a bug that broke the 'lint' subcommand. The bug has been fixed in new versions, so it is better to use fedpkg for this, too. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index b6b55ed..9dc33fc 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -339,16 +339,10 @@ Testsuite summary for GNU Hello 2.10 Next you should check them for conformance with RPM design rules, by running `rpmlint` on specfile, source rpm and binary rpm. -Command `+fedpkg lint+` _should_ do this, -but as of version 1.41, -it suffers from a bug -causing it not to find the rpms created by `+fedpkg mockbuild+`. -So instead, `+rpmlint+` needs to be called directly. -Pass files to check as arguments: +Command `+fedpkg lint+` does this: -[subs="attributes+"] ---- -$ rpmlint hello.spec results_hello/2.10/1.fc{MAJOROSVER}/hello-2.10*.{x86_64,src}.rpm +$ fedpkg --release rawhide lint ---- If all is good, there should be no warnings or errors. @@ -370,6 +364,8 @@ mv THANKS THANKS.old iconv --from-code=ISO-8859-1 --to-code=UTF-8 --output=THANKS THANKS.old ---- +Run `fedpkg lint` again and observe that the warning is fixed. + == A Complete hello.spec File Here is the initial version of `hello.spec`: From 524166310f83907441315bd0a29090e6e3de1883 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Oct 08 2022 11:47:18 +0000 Subject: [PATCH 2/4] Use xref to refer to other docs pages in GNU Hello tutorial Using xref is the preferred method for Fedora Docs, so switching to use it in this page also. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index 9dc33fc..9ce35d9 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -194,7 +194,7 @@ Installed (but unpackaged) file(s) found: This is the executable binary program. `+/usr/bin+`, like many other system directories, have a -https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/#_macros_for_paths_set_and_used_by_build_systems[default rpm macro] defined. +xref:packaging-guidelines::RPMMacros.adoc#macros_installation[default rpm macro] defined. The macros should always be used when available, so the executable is listed in `+%files+` as follows: @@ -212,7 +212,7 @@ Installed (but unpackaged) file(s) found: ---- The Packaging Guidelines have dedicated section for -https://docs.fedoraproject.org/en-US/packaging-guidelines/#_manpages[Manpages]. +xref:packaging-guidelines::index.adoc#_manpages[Manpages]. Following its instructions, manpages are list as follows: [source, rpm-spec] @@ -263,7 +263,7 @@ Installed (but unpackaged) file(s) found: Since our program uses translations and internationalization, we are seeing a lot of undeclared i18n files. -The https://docs.fedoraproject.org/en-US/packaging-guidelines/#handling_locale_files[recommended method] +The xref:packaging-guidelines::index.adoc#handling_locale_files[recommended method] to declare them is: . Add the required build dependency with `+BuildRequires: gettext+`. From a036ea62a247250e6274325bf59c083eebf33dfa Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Oct 08 2022 11:47:23 +0000 Subject: [PATCH 3/4] Fix grammar mistake --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index 9ce35d9..af1c7c3 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -275,7 +275,7 @@ to declare them is: Every package must install its license, tagged with `+%license+` directive. In GNU Hello's case, as well as for many other projects, -the license file is located the source tarball's top level, +the license file is located at the source tarball's top level, and perhaps not copied to the buildroot during installation at all. Regardless, it can be installed to the standard license directory by using a relative path: From 46f5270267e06f7abc9c8a39d413d6948b3fbd39 Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Oct 08 2022 11:47:23 +0000 Subject: [PATCH 4/4] Add reading instructions to GNU Hello tutorial The tutorial has many steps where something is added to the specfile. It is quite easy to apply some change in the wrong place, or just not understand where it should go. The correct solution can be checked from the final specfile listed in the end. The reading instructions just mention that the final specfile can be used for reference if anything is unclear. --- diff --git a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc index af1c7c3..edafae6 100644 --- a/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc +++ b/modules/ROOT/pages/Packaging_Tutorial_GNU_Hello.adoc @@ -24,6 +24,12 @@ This tutorial is intended to be run on a Fedora {MAJOROSVER} system. It should, however, work also for other releases. Just replace strings like `f{MAJOROSVER}` with your release number. +The tutorial proceeds in step by step manner, +with most steps editing the package's specfile. +The final resulting specfile is listed in the end, +so in case there is any unclarity how a particular change should be applied, +you can peek there. + [#dev_env] == Installing Packager Tools