Commit 301c1090 authored by Rafael Aquini's avatar Rafael Aquini Committed by Masahiro Yamada
Browse files

kbuild: rpm-pkg: introduce a simple changelog section for kernel.spec



Fix the following rpmbuild warning:

  $ make srcrpm-pkg
  ...
  RPM build warnings:
      source_date_epoch_from_changelog set but %changelog is missing

Signed-off-by: default avatarRafael Aquini <aquini@redhat.com>
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 64e16609
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -30,3 +30,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