From: Rafael Aquini <aquini@redhat.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>,
aquini@redhat.com
Subject: [PATCH v3 2/2] kbuild: rpm-pkg: introduce a simple changelog section for kernel.spec
Date: Sat, 6 Jul 2024 12:44:23 -0400 [thread overview]
Message-ID: <20240706164423.1934390-1-aquini@redhat.com> (raw)
In-Reply-To: <CAK7LNASzX29R38ApwByCO3kpiY6-L5UqHnP1Vs2WRBQM8z+kQw@mail.gmail.com>
Fix the following rpmbuild warning:
$ make srcrpm-pkg
...
RPM build warnings:
source_date_epoch_from_changelog set but %changelog is missing
Signed-off-by: Rafael Aquini <aquini@redhat.com>
---
scripts/package/mkspec | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index ce201bfa8377..e45fdb12fbc7 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -28,3 +28,26 @@ cat<<EOF
EOF
cat "${srctree}/scripts/package/kernel.spec"
+
+# collect the user's name and email address for the changelog entry
+if [ "$(command -v git)" ]; then
+ name=$(git config user.name) || true
+ email=$(git config user.email) || true
+fi
+
+if [ ! "${name:+set}" ]; then
+ name=${KBUILD_BUILD_USER:-$(id -nu)}
+fi
+
+if [ ! "${email:+set}" ]; then
+ buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)}
+ builduser=${KBUILD_BUILD_USER:-$(id -nu)}
+ email="${builduser}@${buildhost}"
+fi
+
+cat << EOF
+
+%changelog
+* $(LC_ALL=C; date +'%a %b %d %Y') ${name} <${email}> - ${KERNELRELEASE}
+- Custom built Linux kernel.
+EOF
--
2.45.1
next prev parent reply other threads:[~2024-07-06 16:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 16:38 [PATCH] kbuild: rpm-pkg: fix rpmbuild warnings for kernel.spec Rafael Aquini
2024-06-11 15:00 ` Masahiro Yamada
2024-06-11 16:03 ` Rafael Aquini
2024-06-11 16:33 ` Masahiro Yamada
2024-06-11 21:11 ` [PATCH 0/2] " Rafael Aquini
2024-06-11 21:11 ` [PATCH 1/2] kbuild: rpm-pkg: make sure to have versioned 'Obsoletes' " Rafael Aquini
2024-06-13 19:01 ` Nathan Chancellor
2024-07-04 13:58 ` Masahiro Yamada
2024-06-11 21:11 ` [PATCH 2/2] kbuild: rpm-pkg: introduce a simple changelog section " Rafael Aquini
2024-07-04 15:28 ` Rafael Aquini
2024-07-04 15:52 ` Masahiro Yamada
2024-07-04 18:16 ` Rafael Aquini
2024-07-04 19:36 ` [PATCH v2 " Rafael Aquini
2024-07-06 3:40 ` Masahiro Yamada
2024-07-06 16:44 ` Rafael Aquini [this message]
2024-07-15 16:32 ` [PATCH v3 " Masahiro Yamada
2024-07-15 21:21 ` Rafael Aquini
2024-07-16 8:40 ` Masahiro Yamada
2024-07-16 12:25 ` [PATCH v4 " Rafael Aquini
2024-07-17 17:10 ` Masahiro Yamada
2024-07-17 20:49 ` Rafael Aquini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240706164423.1934390-1-aquini@redhat.com \
--to=aquini@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.