diff --git a/content/docs/rpm/macros.mdx b/content/docs/rpm/macros.mdx index 684a87b6..4cc6b1ea 100644 --- a/content/docs/rpm/macros.mdx +++ b/content/docs/rpm/macros.mdx @@ -226,7 +226,7 @@ Double-expand the macro. ```rpmspec title="example.spec" %define nya foo %define meow %{expand:%%nya} - + echo %meow ``` @@ -236,7 +236,7 @@ Double-expand the macro. ``` - + ##### `%{lua:…}` πŸ› οΈ [#lua] @@ -466,6 +466,20 @@ This macro is used in [`%setup …`](#setup) for uncompressing source files. #### Environment info +##### `%?dist` [#?dist] + +Used in the `Release:` tag, expands to the dist tag, which is the builder OS shortened identifer and version. Examples: + +``` +.fc44 +.um43 +``` + +Can either be used as `%?dist` or `%dist`, The `?` prefix just means it expands to nothing if the macro is +undefined, which avoids errors when building without a dist tag. + + + ##### `%{getncpus:…}` [#getncpus] When used as `%{getncpus}` with no arguments, expand to the number of available CPU cores. @@ -497,6 +511,22 @@ concerned. It is suspected that the arguments in most cases have no effect to th +##### `%_smp_build_ncpus` [#_smp_build_ncpus] + +Expands to the output of `nproc` (the build host's thread count) + +Example use case: `%make_build GHCJOBS=%{_smp_build_ncpus}` + + + +##### `%_smp_mflags` [#_smp_mflags] + +Expands to `-j${RPM_BUILD_NCPUS}` + +Example use case: `make %{_smp_mflags}` + + + #### Output ##### `%{echo:…}` πŸ”¦ [#echo] @@ -558,7 +588,7 @@ Expand to the path to the source file. This is just a fancy macro that transform
```rpmspec title="example.spec" Source0: https://repos.fyralabs.com/um42/comps.xml - + %prep cat %{S:0} echo %{S:1} @@ -567,14 +597,14 @@ Expand to the path to the source file. This is just a fancy macro that transform
```rpmspec title="expand.spec" Source0: https://repos.fyralabs.com/um42/comps.xml - + %prep cat %{_sourcedir}/comps.xml echo %SOURCE1 ```
- + ##### `%{P:#}` [#P] @@ -623,6 +653,18 @@ Or you can just use `less` instead of `grep`. #### Miscellaneous +##### `%_lib` [#_lib] + +Expands to `lib` (on noarch or 32-bit packages) or `lib64` (on 64-bit packages) + + + +##### `%__ln_s` [#__ln_s] + +Expands to the system's `ln -s` command (should be used when symlinks are needed) + + + ##### `%nil` πŸ”° [#nil] Expand to nothing. @@ -763,7 +805,7 @@ what things the binaries are linked to, you may disable that by adding a regex t If you want to disable all automatic `Requires:`, set `AutoReq: 0`. - + ##### `%__requires_exclude_from` 🏷️ [#__requires_exclude_from] @@ -841,6 +883,8 @@ Similar to above, but takes in path to file that contains the regexes. ##### `%__brp_mangle_shebangs_exclude_from_file` 🏷️ [#__brp_mangle_shebangs_exclude_from_file] +Similar to above, but takes a path to a file containing the list of file paths to exclude. + ##### `%__brp_mangle_shebangs` 🏷️ @@ -1125,7 +1169,6 @@ Macros with the '(Terra only)' warning are part of the `anda-srpm-macros` packag /run β‡’ %{_rundir} /usr β‡’ %{_usr} /usr/bin β‡’ %{_bindir} -/usr/sbin β‡’ %{_sbindir} maybe? /usr/src β‡’ %{_usrsrc} /usr/include β‡’ %{_includedir} /usr/lib64 β‡’ %{_libdir} @@ -1257,210 +1300,3 @@ mkdir -p %{buildroot}%{_datadir}/themes - -### Per Language - -If your language / buildsystem is not listed here, go to -https://docs.fedoraproject.org/en-US/packaging-guidelines/ -and find them on the navigation rail on the left. - -#### C and C++ - -##### `%configure` [#configure] - -Expand to `./configure` with the correct flags and arguments. -If you need to execute `./configure`, in most cases you should use this macro instead. - -In some cases where `./configure` is not directly available, you may need to run -`autoreconf -fi` or `-fiv`. - - - -##### `%make_build` πŸ”° [#make_build] - -β‡’ `%__make -O -j${RPM_BUILD_NCPUS} V=1 VERBOSE=1{:sh}`, -where `%{__make}` β‡’ `/usr/bin/make`. -Further arguments to `make` can be attached. - - - -##### `%make_install` πŸ”° [#make_install] - -β‡’ `%__make install DESTDIR=%?buildroot INSTALL="%__install -p"{:sh}`. - - - -##### `%makeinstall` 🚸 [#makeinstall] - -Deprecated. Use [`%make_install`](#make_install) instead. - - - -##### `%cmake` πŸ”° [#cmake] - -Expand to `%{__cmake}` (β‡’ `/usr/bin/cmake`) with the correct flags, -such as `-B "%__cmake_builddir"{:sh}` (β‡’ `-B "redhat-linux-build"{:sh}`). - - - -##### `%cmake_build` πŸ”° [#cmake_build] - -β‡’ `%__cmake --build "%__cmake_builddir" %?_smp_mflags --verbose{:sh}`. - - - -##### `%cmake_install` πŸ”° [#cmake_install] - -β‡’ `DESTDIR="%buildroot" %__cmake --install "%__cmake_builddir"{:sh}`. - - - -##### `%meson` πŸ”° [#meson] - -β‰ˆ `%__meson setup{:sh}` with correct flags. - - - -##### `%meson_build` πŸ”° [#meson_build] - -β‡’ `%__meson compile -C "%_vpath_builddir" -j %_smp_build_ncpus %{?__meson_verbose:--verbose}{:sh}` - -β‡’ `/usr/bin/meson compile -C redhat-linux-build -j 20 --verbose{:sh}` (on my machine). - - - -##### `%meson_install` πŸ”° [#meson_install] - -β‡’ `DESTDIR=%buildroot %__meson install -C %_vpath_builddir --no-rebuild{:sh}`. -Used in `%install{:rpmspec}`. - - - -##### `%meson_test` πŸ”° [#meson_test] - -β‡’ `%__meson test -C %_vpath_builddir --no-rebuild %{!?__meson_verbose:--quiet}{:sh}`. -Used in `%check{:rpmspec}`. - - - -##### `%ninja_build` [#ninja_build] - -β‡’ `%__ninja %__ninja_common_opts{:sh}` - -β‡’ `%__ninja -v -j${RPM_BUILD_NCPUS}{:sh}`. - - - -##### `%ninja_install` [#ninja_install] - -β‡’ `DESTDIR=%buildroot %__ninja install %__ninja_common_opts{:sh}`. - - - -##### `%ninja_test` [#ninja_test] - -β‡’ `%__ninja test %__ninja_common_opts{:sh}`. - - - -##### `%build_cflags` 🏷️ [#build_cflags] - -Flags to be passed to the C compiler. - -β‡’ `%{__build_flags_lang_c} %{?_distro_extra_cflags}` - - - -##### `%_distro_extra_cflags` 🏷️ [#_distro_extra_cflags] - -For example, if the compiler is emitting errors that could be disabled with some -`-Wno-…` flags, you can define this macro with extra flags. - -This macro is not defined by default on Fedora. - - - -##### `%build_cxxflags` 🏷️ [#build_cxxflags] - -Flags to be passed to the C++ compiler. - -β‡’ `%{__build_flags_lang_cxx} %{?_distro_extra_cxxflags}` - - - -##### `%_distro_extra_cxxflags` 🏷️ [#_distro_extra_cxxflags] - -For example, if the compiler is emitting errors that could be disabled with some -`-Wno-…` flags, you can define this macro with extra flags. - -This macro is not defined by default on Fedora. - - - -#### D - -##### `%ldc_arches` [#ldc_arches] - - - -##### `%_d_optflags` [#_d_optflags] - - - -#### Java - -https://docs.fedoraproject.org/en-US/java-packaging-howto/ - -#### Nim - -This section is only applicable to Terra (because Fedora does not ship Nim). - -##### `%nim_prep` [#nim_prep] - -Set `mold` as the linker and run `nimble setup -y`. - - - -##### `%nim_build` [#nim_build] - -Same as [`%nim_c`](#nim_c). - - - -##### `%nim_c` [#nim_c] - -β‡’ `nim c -d:release -t:"%nim_tflags" -l:"%nim_lflags"{:sh}`. - - - -#### Python - -https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ - -#### Rust - -https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/ - -##### `%rustflags_debuginfo` 🏷️ [#rustflags_debuginfo] - -If `gdb` crashes in `find-debuginfo`, you might want to lower the value to `1` or even `0`. - -The default value is `2`. - -```rpmspec title="example.spec" {11} -https://github.com/terrapkg/packages/blob/2df55dad60a58ecf5f8fbe962f877f2834bdfa25/anda/devs/zed/nightly/zed-nightly.spec#L14 - -%bcond_with check - -# Exclude input files from mangling -%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ - -%global crate zed -%global app_id dev.zed.Zed-Nightly - -%global rustflags_debuginfo 0 -``` - -[expression]: ./expr - - diff --git a/content/docs/rpm/packaged-macros.mdx b/content/docs/rpm/packaged-macros.mdx new file mode 100644 index 00000000..faade867 --- /dev/null +++ b/content/docs/rpm/packaged-macros.mdx @@ -0,0 +1,324 @@ +--- +title: Macros in Fedora Packages +description: "These macros are not default in RPM, rather they are available in the Fedora package repos." +--- + +import { SearchTerra } from '@/components/mdx/searchterra'; + +## R-rpm-macros + +## blender-rpm-macros + +## moby-rpm-macros + +## pyproject-rpm-macros + +## cargo-rpm-macros + +## cmake-rpm-macros + +## cmake-rpm-macros + +## erlang-rpm-macros + +## fedora-rpm-macros + +## flatpak-rpm-macros + +## folly-rpm-macros + +## fonts-rpm-macros + +## gap-rpm-macros + +## ghc-rpm-macros + +## go-rpm-macros + +## kernel-rpm-macros + +## lua-rpm-macros + +## magicmirror-rpm-macros + +## ocaml-rpm-macros + +## python-rpm-macros + +## rpmautospec-rpm-macros + +## rocm-rpm-macros + +## sgx-rpm-macros + +## systemd-rpm-macros + +## zig-rpm-macros + +## cargo-rpm-macros + +## epel-rpm-macros + +## kde-apps-rpm-macros + +## qt6-rpm-macros + +## build2-rpm-macros + +## build-constraints-rpm-macros + +## kf5-rpm-macros + +## kf6-rpm-macros + +## postgresql-test-rpm-macros + +## qt5-rpm-macros + +## go-rpm-macros-epel + +## python-pyqt6-rpm-macros + +## postgresql17-test-rpm-macros + +## python-qt5-rpm-macros + +## romc-rpm-macros7.2 + +## the srpm ones I don't feel like listing rn + +## Other + +This is a non exhaustive list of macros that non `*-rpm-macros` packages in Fedora provide + +### `%vimfiles_root` πŸ”’πŸ”¦πŸ› οΈ [#vimfiles_root] + +Provided by the `vim-filesystem` package. +Expands to `%{_datadir}/vim/vimfiles` + + + +### `%_vpath_srcdir` [#_vpath_srcdir] + +Provided by the `redhat-rpm-config` package. +Expands to `.` + +Yes, it juse expands to `.`. It is described as "directory where CMakeLists.txt/meson.build/etc. are placed." + + + +### `%_vpath_builddir` [#_vpath_builddir] + +Provided by the `redhat-rpm-config` package. +Expands to `%{_vendor}-%{_target_os}-build` + +described as "directory (doesn't need to exist) where all generated build files will be placed" + +## Language Provided Macros + +If your language / buildsystem is not listed here, go to +https://docs.fedoraproject.org/en-US/packaging-guidelines/ +and find them on the navigation rail on the left. + +### C and C++ + +#### `%configure` [#configure] + +Expand to `./configure` with the correct flags and arguments. +If you need to execute `./configure`, in most cases you should use this macro instead. + +In some cases where `./configure` is not directly available, you may need to run +`autoreconf -fi` or `-fiv`. + +You SHOULD use this macro within the `%conf` section. + + + +#### `%make_build` πŸ”° [#make_build] + +β‡’ `%__make -O -j${RPM_BUILD_NCPUS} V=1 VERBOSE=1{:sh}`, +where `%{__make}` β‡’ `/usr/bin/make`. +Further arguments to `make` can be attached. + + + +#### `%make_install` πŸ”° [#make_install] + +β‡’ `%__make install DESTDIR=%?buildroot INSTALL="%__install -p"{:sh}`. + + + +#### `%makeinstall` 🚸 [#makeinstall] + +Deprecated. Use [`%make_install`](#make_install) instead. + + + +#### `%cmake` πŸ”° [#cmake] + +Expand to `%{__cmake}` (β‡’ `/usr/bin/cmake`) with the correct flags, +such as `-B "%__cmake_builddir"{:sh}` (β‡’ `-B "redhat-linux-build"{:sh}`). + + + +#### `%cmake_build` πŸ”° [#cmake_build] + +β‡’ `%__cmake --build "%__cmake_builddir" %?_smp_mflags --verbose{:sh}`. + + + +#### `%cmake_install` πŸ”° [#cmake_install] + +β‡’ `DESTDIR="%buildroot" %__cmake --install "%__cmake_builddir"{:sh}`. + + + +#### `%meson` πŸ”° [#meson] + +β‰ˆ `%__meson setup{:sh}` with correct flags. + + + +#### `%meson_build` πŸ”° [#meson_build] + +β‡’ `%__meson compile -C "%_vpath_builddir" -j %_smp_build_ncpus %{?__meson_verbose:--verbose}{:sh}` + +β‡’ `/usr/bin/meson compile -C redhat-linux-build -j 20 --verbose{:sh}` (on my machine). + + + +#### `%meson_install` πŸ”° [#meson_install] + +β‡’ `DESTDIR=%buildroot %__meson install -C %_vpath_builddir --no-rebuild{:sh}`. +Used in `%install{:rpmspec}`. + + + +#### `%meson_test` πŸ”° [#meson_test] + +β‡’ `%__meson test -C %_vpath_builddir --no-rebuild %{!?__meson_verbose:--quiet}{:sh}`. +Used in `%check{:rpmspec}`. + + + +#### `%ninja_build` [#ninja_build] + +β‡’ `%__ninja %__ninja_common_opts{:sh}` + +β‡’ `%__ninja -v -j${RPM_BUILD_NCPUS}{:sh}`. + + + +#### `%ninja_install` [#ninja_install] + +β‡’ `DESTDIR=%buildroot %__ninja install %__ninja_common_opts{:sh}`. + + + +#### `%ninja_test` [#ninja_test] + +β‡’ `%__ninja test %__ninja_common_opts{:sh}`. + + + +#### `%build_cflags` 🏷️ [#build_cflags] + +Flags to be passed to the C compiler. + +β‡’ `%{__build_flags_lang_c} %{?_distro_extra_cflags}` + + + +#### `%_distro_extra_cflags` 🏷️ [#_distro_extra_cflags] + +For example, if the compiler is emitting errors that could be disabled with some +`-Wno-…` flags, you can define this macro with extra flags. + +This macro is not defined by default on Fedora. + + + +#### `%build_cxxflags` 🏷️ [#build_cxxflags] + +Flags to be passed to the C++ compiler. + +β‡’ `%{__build_flags_lang_cxx} %{?_distro_extra_cxxflags}` + + + +#### `%_distro_extra_cxxflags` 🏷️ [#_distro_extra_cxxflags] + +For example, if the compiler is emitting errors that could be disabled with some +`-Wno-…` flags, you can define this macro with extra flags. + +This macro is not defined by default on Fedora. + + + +### D + +#### `%ldc_arches` [#ldc_arches] + + + +#### `%_d_optflags` [#_d_optflags] + + + +### Java + +https://docs.fedoraproject.org/en-US/java-packaging-howto/ + +### Nim + +This section is only applicable to Terra (because Fedora does not ship Nim). + +#### `%nim_prep` [#nim_prep] + +Set `mold` as the linker and run `nimble setup -y`. + + + +#### `%nim_build` [#nim_build] + +Same as [`%nim_c`](#nim_c). + + + +#### `%nim_c` [#nim_c] + +β‡’ `nim c -d:release -t:"%nim_tflags" -l:"%nim_lflags"{:sh}`. + + + +### Python + +https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/ + +### Rust + +https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/ + +#### `%rustflags_debuginfo` 🏷️ [#rustflags_debuginfo] + +If `gdb` crashes in `find-debuginfo`, you might want to lower the value to `1` or even `0`. + +The default value is `2`. + +```rpmspec title="example.spec" {11} +https://github.com/terrapkg/packages/blob/2df55dad60a58ecf5f8fbe962f877f2834bdfa25/anda/devs/zed/nightly/zed-nightly.spec#L14 + +%bcond_with check + +# Exclude input files from mangling +%global __brp_mangle_shebangs_exclude_from ^/usr/src/.*$ + +%global crate zed +%global app_id dev.zed.Zed-Nightly + +%global rustflags_debuginfo 0 +``` + +[expression]: ./expr + + diff --git a/content/docs/rpm/sections.mdx b/content/docs/rpm/sections.mdx index ac046a30..ac2fc849 100644 --- a/content/docs/rpm/sections.mdx +++ b/content/docs/rpm/sections.mdx @@ -22,11 +22,13 @@ Here is a non-exclusive (but nearly exclusive) list of preambles available: Name: pkgname Version: 1.2.3 Release: 1%?dist -Summary: Package summary (usually do not add period at the end) +Summary: Package summary (do not add period at the end) # As opposed to the guidelines given by RPM, we (and also Fedora!) strongly # recommend using SPDX identifiers. License: MIT URL: https://terra.fyralabs.com/ +Source0: Link to download the source code. If more then one link is needed, +specify with Source1:, Source2:, etc. ## terra also enforces the following preamble: @@ -44,6 +46,7 @@ AutoProv: 1 ## these fields are optional +Patch: SourceLicense: BugURL: ModularityLabel: @@ -59,6 +62,8 @@ ExclusiveOS: BuildArch: BuildArchitectures: BuildRequires: +NoSource: +NoPatch: Group: Provides: @@ -78,6 +83,11 @@ RemovePathPostFixes: BuildSystem: BuildOption: + +Icon: (Obsolete) +Buildroot: (Obsolete) +BuildPrereq: (Obsolete) +Prereq: (Obsolete) ``` @@ -154,15 +164,6 @@ If `subpkg` is given without `-n`, specify the description of the subpackage `%{ Each subpackage requires its own `%description{:rpmspec}` too. -## `%package` - -Not a step. Optional. `%package [-n] subpkg{:rpmspec}` - -Specify the preambles for a subpackage. The name of the subpackage is - -- `subpkg` if `-n` is given; and -- `%{name}-subpkg` otherwise. - ## `%mkbuilddir` Step `Executing(%mkbuilddir)`. Optional. @@ -217,12 +218,11 @@ Step `Executing(%conf)`. Optional. Since `rpm >= 4.18`. > %configure > ``` -When in doubt, you can always put `%configure{:rpmspec}` and other commands at the start of -`%build{:rpmspec}` instead. +Macros such as `%cmake` and `%meson` should also be placed in this section. ## `%build` -Step `Executing(%build)`. Optional. +Step `Executing(%build)`. If there is nothing to build, you should still declare this step in your spec. > In `%build`, the unpacked (and configured) sources are compiled to binaries. > @@ -254,14 +254,6 @@ install -Dpm755 my_binary -t %{buildroot}/usr/bin/ install -Dpm644 rand_file -t %{buildroot}/usr/share/my_software/ ``` -## `%doc` - -Step `Executing(%doc)`. **Not a section**. See [`%files{:rpmspec}`](#files). - -## `%license` - -Step `Executing(%license)`. **Not a section**. See [`%files{:rpmspec}`](#files). - ## `%check` Step `Executing(%check)`. Optional. @@ -318,13 +310,16 @@ The following is an exhaustive list of file attributes available: ```rpmspec %artifact … -# ╰─ mado: personally never seen this used -%config(…) … +# ╰─ denote files that are more like side-effects of packaging than actual content +# the user would be interested in. Such files can be easily filtered out on queries. +%caps +# ╰─ sets the given POSIX.1e draft 15 capabilities on the file +%config(…) … (can be used on it's own or with parameters) # ╰─ exhaustive list: # - config(missingok) # - config(noreplace) %dir … -# ╰─ specify a directory the package owns +# ╰─ explicitly own the directory itself but not it’s contents %doc … # ╰─ store the file into %{_docdir} %docdir @@ -345,14 +340,121 @@ The following is an exhaustive list of file attributes available: # - verify(link symlink) ← same # - verify(rdev) # - verify(mtime) -# - verify(not ...) +# - verify(not ...) (don't verify this attribute) +%missingok +# ╰─ mark file presence optional +%readme +# ╰─ Obsolete - use %doc # special: %attr(…) … %defattr(…) ``` -For more information about `%attr{:rpmspec}` and `%defattr{:rpmspec}`, see: http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html +For more information about `%attr{:rpmspec}` and `%defattr{:rpmspec}`, see: https://rpm-software-management.github.io/rpm/manual/spec.html + +## `%changelog` + +Metadata section. Optional, but required in Fedora and Terra + +Specify a change to the spec. + +Must either use `%autochangelog`, or follow this structure: + +``` +* Day Mon DD YYYY Name - version-release +- Change you made +- Another change, if there's enough to justify two lines +``` + +## Package scripts + +> Package scripts execute before and after the main operation (install/remove etc.) of the package inside a transaction. +> +> Package scripts should only be used for actions that are fundamentally package specific. +> Domain specific registries, databases, caches and such are much better handled centrally +> by file triggers. Similarly, user and group creation should be handled by rpm-sysusers, rather than scripting them. + +### `%pre` +> Executed just before unpacking the contents of the package. +> Non-zero exit prevents the installation of the containing package. + +### `%post` +> Executed just after unpacking the contents of the package. + +### `%preun` +> Executed just before removing the contents of the package. +> Non-zero exit prevents the uninstallation of the containing package. + +### `%postun` +> Executed just after removing the contents of the package. + +### `%verify` + +> Executed when a package is verified using rpm --verify. +> +> Unlike all the other scriptlet types, `%verify` never executes as a part of install/erase etc. operations. + +## Transaction scripts + +> Transaction scripts run before and after all the other package level +> operations (install/remove etc.) in a transaction. +> +> When multiple transaction scripts for a given slot are present in a transaction, +> they are executed in the order of their install/removal order within the transaction. + +### `%pretrans` +> Executed just before an install/update/reinstall transaction on the containing package starts. +> +> No files from the transaction have been installed or removed yet. That is, in a fresh +> installation to an empty system root, there are no files around and no interpreter to run, +> so the only interpreter that can be reliably used in this slot is the embedded rpm-lua(7) interpreter. +> +> Non-zero exit prevents the installation of the containing package. +> +> This is a very special and a dangerous slot, and is best avoided. + +### `%posttrans` +> Executed just after an install/update/reinstall transaction on the containing package finishes. +> +> All files from the transaction have been installed or removed at this point. + +### `%preuntrans` +> Executed just before an uninstall/updated-from transaction on the containing package starts. + +### `%postuntrans` +> Executed just after an uninstall/updated-from transaction on the containing package finishes. + +## Sub-sections + +These are optional macros that are not their own build steps, but are also not +standalone macros. + +### `%sourcelist` +> List of sources, one per line. Handled like unnumbered Source tags. For clarity, +> mixing Source tags and %sourcelist in one specfile is not recommended. + +### `%patchlist` +Like `%sourcelist`, but for patches. + +### `%package [-n]` + +Not a step. Optional. `%package [-n] subpkg{:rpmspec}` + +Specify the preambles for a subpackage. The name of the subpackage is + +- `subpkg` if `-n` is given; and +- `%{name}-subpkg` otherwise. + +### `%description [-n]` +Used to define a description for a subpackage. +Requires if `%package` is used. + +The `-n` and `` options work the same, however if not defined this will refer to the main package. + +## File Triggers + +For information on file triggers, check out the [RPM documentation](https://rpm-software-management.github.io/rpm/man/rpm-scriptlets.7#FILE_TRIGGERS). [expression]: #rpm-expression [RPM manual]: https://github.com/rpm-software-management/rpm/blob/b043604b9eb684dc761aeacf55a784632ca0ebcd/docs/manual/macros.md