Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #!/bin/sh |
2 | # | |
2174d292 | 3 | # Output a simple RPM spec file. |
169dd780 | 4 | # This version assumes a minimum of RPM 4.13 |
1da177e4 LT |
5 | # |
6 | # The only gothic bit here is redefining install_post to avoid | |
7 | # stripping the symbols from files in the kernel which we want | |
8 | # | |
9 | # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> | |
10 | # | |
11 | ||
c0414419 MY |
12 | set -eu |
13 | ||
ffa46bbc MY |
14 | output=$1 |
15 | ||
16 | mkdir -p "$(dirname "${output}")" | |
17 | ||
18 | exec >"${output}" | |
19 | ||
81f59a26 | 20 | if grep -q CONFIG_MODULES=y include/config/auto.conf; then |
2a291fc3 | 21 | echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' |
0b7f12f5 | 22 | else |
2a291fc3 | 23 | echo '%define with_devel 0' |
0b7f12f5 MY |
24 | fi |
25 | ||
a7c699d0 US |
26 | # debuginfo package generation uses find-debuginfo.sh under the hood, |
27 | # which only works on uncompressed modules that contain debuginfo | |
28 | if grep -q CONFIG_DEBUG_INFO=y include/config/auto.conf && | |
29 | (! grep -q CONFIG_MODULE_COMPRESS=y include/config/auto.conf) && | |
30 | (! grep -q CONFIG_DEBUG_INFO_SPLIT=y include/config/auto.conf); then | |
31 | echo '%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}' | |
32 | else | |
33 | echo '%define with_debuginfo 0' | |
34 | fi | |
35 | ||
49c803cd | 36 | cat<<EOF |
a06d9ef8 | 37 | %define ARCH ${ARCH} |
93ed5605 | 38 | %define KERNELRELEASE ${KERNELRELEASE} |
ae4c4cee | 39 | %define pkg_release $("${srctree}/scripts/build-version") |
8c5d4b64 | 40 | EOF |
49c803cd MY |
41 | |
42 | cat "${srctree}/scripts/package/kernel.spec" | |
301c1090 RA |
43 | |
44 | # collect the user's name and email address for the changelog entry | |
45 | if [ "$(command -v git)" ]; then | |
46 | name=$(git config user.name) || true | |
47 | email=$(git config user.email) || true | |
48 | fi | |
49 | ||
50 | if [ ! "${name:+set}" ]; then | |
51 | name=${KBUILD_BUILD_USER:-$(id -nu)} | |
52 | fi | |
53 | ||
54 | if [ ! "${email:+set}" ]; then | |
55 | buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)} | |
56 | builduser=${KBUILD_BUILD_USER:-$(id -nu)} | |
57 | email="${builduser}@${buildhost}" | |
58 | fi | |
59 | ||
60 | cat << EOF | |
61 | ||
62 | %changelog | |
ba6c6640 | 63 | * $(LC_ALL=C date +'%a %b %d %Y') ${name} <${email}> |
301c1090 RA |
64 | - Custom built Linux kernel. |
65 | EOF |