1 #!/bin/sh 1 #!/bin/sh 2 # 2 # 3 # Output a simple RPM spec file. 3 # Output a simple RPM spec file. 4 # This version assumes a minimum of RPM 4 # This version assumes a minimum of RPM 4.13 5 # 5 # 6 # The only gothic bit here is redefining 6 # The only gothic bit here is redefining install_post to avoid 7 # stripping the symbols from files in th 7 # stripping the symbols from files in the kernel which we want 8 # 8 # 9 # Patched for non-x86 by Opencon (L) 200< 9 # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> 10 # 10 # 11 11 12 set -eu 12 set -eu 13 13 14 output=$1 14 output=$1 15 15 16 mkdir -p "$(dirname "${output}")" 16 mkdir -p "$(dirname "${output}")" 17 17 18 exec >"${output}" 18 exec >"${output}" 19 19 20 if grep -q CONFIG_MODULES=y include/config/aut 20 if grep -q CONFIG_MODULES=y include/config/auto.conf; then 21 echo '%define with_devel %{?_without_devel: 0} 21 echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' 22 else 22 else 23 echo '%define with_devel 0' 23 echo '%define with_devel 0' 24 fi 24 fi 25 25 26 cat<<EOF 26 cat<<EOF 27 %define ARCH ${ARCH} 27 %define ARCH ${ARCH} 28 %define KERNELRELEASE ${KERNELRELEASE} 28 %define KERNELRELEASE ${KERNELRELEASE} 29 %define pkg_release $("${srctree}/scripts/buil 29 %define pkg_release $("${srctree}/scripts/build-version") 30 EOF 30 EOF 31 31 32 cat "${srctree}/scripts/package/kernel.spec" 32 cat "${srctree}/scripts/package/kernel.spec" 33 33 34 # collect the user's name and email address fo 34 # collect the user's name and email address for the changelog entry 35 if [ "$(command -v git)" ]; then 35 if [ "$(command -v git)" ]; then 36 name=$(git config user.name) || true 36 name=$(git config user.name) || true 37 email=$(git config user.email) || true 37 email=$(git config user.email) || true 38 fi 38 fi 39 39 40 if [ ! "${name:+set}" ]; then 40 if [ ! "${name:+set}" ]; then 41 name=${KBUILD_BUILD_USER:-$(id -nu)} 41 name=${KBUILD_BUILD_USER:-$(id -nu)} 42 fi 42 fi 43 43 44 if [ ! "${email:+set}" ]; then 44 if [ ! "${email:+set}" ]; then 45 buildhost=${KBUILD_BUILD_HOST:-$(hostn 45 buildhost=${KBUILD_BUILD_HOST:-$(hostname -f 2>/dev/null || hostname)} 46 builduser=${KBUILD_BUILD_USER:-$(id -n 46 builduser=${KBUILD_BUILD_USER:-$(id -nu)} 47 email="${builduser}@${buildhost}" 47 email="${builduser}@${buildhost}" 48 fi 48 fi 49 49 50 cat << EOF 50 cat << EOF 51 51 52 %changelog 52 %changelog 53 * $(LC_ALL=C date +'%a %b %d %Y') ${name} <${e 53 * $(LC_ALL=C date +'%a %b %d %Y') ${name} <${email}> 54 - Custom built Linux kernel. 54 - Custom built Linux kernel. 55 EOF 55 EOF
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.