Debian Codegraph @

scripts/package/mkspec

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Output a simple RPM spec file.
4 # This version assumes a minimum of RPM 4.13
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 <[email protected]>
10 #
11
12 set -eu
13
14 output=$1
15
16 mkdirscip-shell system . . mkdir. -p "$(dirnamescip-shell system . . dirname. "${output}")"
17
18 exec >"${output}"
19
20 if grepscip-shell system . . grep. -q CONFIG_MODULES=y include/config/auto.conf; then
21 echoscip-shell system . . echo. '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}'
22 else
23 echoscip-shell system . . echo. '%define with_devel 0'
24 fi
25
26 # use %{debug_package} machinery to generate -debuginfo
27 with_debuginfo_rpm=0
28 # manually generate -debuginfo package
29 with_debuginfo_manual=0
30 # debuginfo package generation uses find-debuginfo.sh under the hood,
31 # which only works on uncompressed modules that contain debuginfo
32 if grepscip-shell system . . grep. -q CONFIG_DEBUG_INFO=y include/config/auto.conf &&
33 (! grepscip-shell system . . grep. -q CONFIG_MODULE_COMPRESS=y include/config/auto.conf) &&
34 (! grepscip-shell system . . grep. -q CONFIG_DEBUG_INFO_SPLIT=y include/config/auto.conf); then
35 # If module signing is enabled (which may be required to boot with
36 # lockdown enabled), the find-debuginfo.sh machinery cannot be used
37 # because the signatures will be stripped off the modules. However, due
38 # to an rpm bug in versions prior to 4.20.0
39 #
40 # https://github.com/rpm-software-management/rpm/issues/3057
41 # https://github.com/rpm-software-management/rpm/commit/49f906998f3cf1f4152162ca61ac0869251c380f
42 #
43 # We cannot provide our own debuginfo package because it does not listen
44 # to our custom files list, failing the build due to unpackaged files.
45 # Manually generate the debug info package if using rpm 4.20.0. If not
46 # using rpm 4.20.0, avoid generating a -debuginfo package altogether,
47 # as it is not safe.
48 if grepscip-shell system . . grep. -q CONFIG_MODULE_SIG=y include/config/auto.conf; then
49 rpm_ver_str=$(rpm --version 2>/dev/nullscip-shell filesystem . . `/dev/null`.)
50 # Split the version on spaces
51 IFS=' '
52 set -- $rpm_ver_str
53 if [scip-shell system . . `[`. "${1:-}" = RPM -a "${2:-}" = version ]; then
54 IFS=.
55 set -- $3
56 rpm_ver=$(( 1000000 * $1 + 10000 * $2 + 100 * $3 + ${4:-0} ))
57 if [scip-shell system . . `[`. "$rpm_ver" -ge 4200000 ]; then
58 with_debuginfo_manual='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}'
59 fi
60 fi
61 else
62 with_debuginfo_rpm='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}'
63 fi
64 fi
65 echoscip-shell system . . echo. "%define with_debuginfo_manual $with_debuginfo_manual"
66 echoscip-shell system . . echo. "%define with_debuginfo_rpm $with_debuginfo_rpm"
67
68 catscip-shell system . . cat.<<EOF
69 %define ARCH ${ARCH}
70 %define KERNELRELEASE ${KERNELRELEASE}
71 %define pkg_release $("${srctree}/scripts/build-version")
72 EOF
73
74 catscip-shell system . . cat. "${srctree}/scripts/package/kernel.spec"
75
76 # collect the user's name and email address for the changelog entry
77 if [scip-shell system . . `[`. "$(command -v git)" ]; then
78 name=$(gitscip-shell system . . git. config user.name) || truescip-shell system . . true.
79 email=$(gitscip-shell system . . git. config user.email) || truescip-shell system . . true.
80 fi
81
82 if [scip-shell system . . `[`. ! "${name:+set}" ]; then
83 name=${KBUILD_BUILD_USER:-$(idscip-shell system . . id. -nu)}
84 fi
85
86 if [scip-shell system . . `[`. ! "${email:+set}" ]; then
87 buildhost=${KBUILD_BUILD_HOST:-$(hostnamescip-shell system . . hostname. -f 2>/dev/nullscip-shell filesystem . . `/dev/null`. || hostnamescip-shell system . . hostname.)}
88 builduser=${KBUILD_BUILD_USER:-$(idscip-shell system . . id. -nu)}
89 email="${builduser}@${buildhost}"
90 fi
91
92 catscip-shell system . . cat. << EOF
93
94 %changelog
95 * $(LC_ALL=C datescip-shell system . . date. +'%a %b %d %Y') ${name} <${email}>
96 - Custom built Linux kernel.
97 EOF