diff mbox series

[v4,2/2] kbuild: rpm-pkg: introduce a simple changelog section for kernel.spec

Message ID 20240716122505.3425582-1-aquini@redhat.com (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Rafael Aquini July 16, 2024, 12:25 p.m. UTC
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(+)

Comments

Masahiro Yamada July 17, 2024, 5:10 p.m. UTC | #1
On Tue, Jul 16, 2024 at 9:25 PM Rafael Aquini <aquini@redhat.com> wrote:
>
> 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>
> ---

Applied to linux-kbuild.
Thanks!
Rafael Aquini July 17, 2024, 8:49 p.m. UTC | #2
On Thu, Jul 18, 2024 at 02:10:13AM +0900, Masahiro Yamada wrote:
> On Tue, Jul 16, 2024 at 9:25 PM Rafael Aquini <aquini@redhat.com> wrote:
> >
> > 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>
> > ---
> 
> Applied to linux-kbuild.
> Thanks!
> 
>

Thank you.
diff mbox series

Patch

diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index ce201bfa8377..e8e01330266b 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}>
+- Custom built Linux kernel.
+EOF