Skip to content

Commit 301c109

Browse files
aquinimasahir0y
authored andcommitted
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: Rafael Aquini <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 64e1660 commit 301c109

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

scripts/package/mkspec

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,26 @@ cat<<EOF
3030
EOF
3131

3232
cat "${srctree}/scripts/package/kernel.spec"
33+
34+
# collect the user's name and email address for the changelog entry
35+
if [ "$(command -v git)" ]; then
36+
name=$(git config user.name) || true
37+
email=$(git config user.email) || true
38+
fi
39+
40+
if [ ! "${name:+set}" ]; then
41+
name=${KBUILD_BUILD_USER:-$(id -nu)}
42+
fi
43+
44+
if [ ! "${email:+set}" ]; then
45+
buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)}
46+
builduser=${KBUILD_BUILD_USER:-$(id -nu)}
47+
email="${builduser}@${buildhost}"
48+
fi
49+
50+
cat << EOF
51+
52+
%changelog
53+
* $(LC_ALL=C; date +'%a %b %d %Y') ${name} <${email}>
54+
- Custom built Linux kernel.
55+
EOF

0 commit comments

Comments
 (0)