[Rpm-maint] [rpm-software-management/rpm] Dynamic Spec generation (#1485)

Michal Domonkos notifications at github.com
Fri Nov 4 14:59:10 UTC 2022


@dmnks commented on this pull request.

LGTM now, only little nitpicks, see comments.

> +layout: default
+title: rpm.org - Package Build Process
+---
+# Dynamic Spec Generation
+
+Since rpm 4.19 RPM supports parsing dynamically generated specs. This
+allows the build scripts (**%build** or **%install**) to create parts
+of the spec file. The parts are read in and parsed after **%install**
+and before **%check**. Because of this they obviously can't contain
+the build scripts but are intended to create sub packages based on the
+build results.
+
+The files need to be placed in the **%{specpartsdir}** (also available
+as **$RPM_SPECPARTS_DIR** in the build scripts) and have a
+**.specpart** postfix. The directory is created by **%setup** in the
+**buildsubdir**. Scripts must fail if it is not present. They should

This sentence sounds contradictory to what follows it, i.e. that they in fact don't have to fail if they do some kind of fallback.

> +%description
+Simple rpm demonstration.
+
+%prep
+%setup -q -T -c
+
+%build
+echo "Q: Why?\nA: Because we can!" > FAQ
+
+%install
+mkdir -p $RPM_BUILD_ROOT/usr/local/bin
+echo " " > $RPM_BUILD_ROOT/usr/local/bin/hello
+
+
+echo "%package docs" >> %{specpartsdir}/docs.specpart
+echo "Summary: Documentation for dynamic spec" >> %{specpartsdir}/docs.specpart

Nitpick, but I'd add a comment saying that a `%description` is missing here which makes the build fail (otherwise it's not that much apparent from the looks of it).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1485#pullrequestreview-1168693722
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/1485/review/1168693722 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20221104/ba9faee6/attachment.html>


More information about the Rpm-maint mailing list