[Rpm-maint] [rpm-software-management/rpm] How to specify a fallback package for unpackaged files? (Discussion #2907)
Daan De Meyer
notifications at github.com
Sat Feb 17 21:36:19 UTC 2024
So what I ended up doing is something like the following:
```sh
build() {
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
# https://github.com/mesonbuild/meson/pull/12835 is available.
rpmbuild \
-bb \
--build-in-place \
--define "_topdir /var/tmp" \
--define "_sourcedir rpm" \
--define "_rpmdir $PACKAGEDIR" \
--define "__check_files sh -c '$(rpm --eval %__check_files) | tee /tmp/unpackaged-files'" \
"$@" \
rpm/systemd.spec
}
if ! build; then
EXIT_STATUS=$?
if [ ! -s /tmp/unpackaged-files ]; then
exit $EXIT_STATUS
fi
# rpm will append to any existing systemd.lang so delete it explicitly so we don't get duplicate file
# warnings.
rm systemd.lang
cat /tmp/unpackaged-files >>rpm/files.systemd
build --noprep --nocheck
fi
```
Basically we run `rpmbuild` once and if it fails, we check if there are any unpackaged files. If there are unpackaged files, we append those to the files.systemd file which lists the files of the systemd package and then run `rpmbuild` again with `--noprep` and `--nocheck`.
To get the unpackaged files, we override the `__check_files` macro and have it write its output to `/tmp/unpackaged-files` in addition to writing it to the standard output.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/discussions/2907#discussioncomment-8503531
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/repo-discussions/2907/comments/8503531 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240217/adb37c9c/attachment-0001.html>
More information about the Rpm-maint
mailing list