Skip to content

Commit

Permalink
kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/
Browse files Browse the repository at this point in the history
kernel.spec is the last piece that resides outside the rpmbuild/
directory. Move all the RPM-related files to rpmbuild/ consistently.

Signed-off-by: Masahiro Yamada <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Tested-by: Nathan Chancellor <[email protected]>
  • Loading branch information
masahir0y committed Oct 3, 2023
1 parent 4074532 commit ffa46bb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ modules.order
#
# RPM spec file (make rpm-pkg)
#
/kernel.spec
/rpmbuild/

#
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ MRPROPER_FILES += include/config include/generated \
certs/signing_key.pem \
certs/x509.genkey \
vmlinux-gdb.py \
kernel.spec rpmbuild \
rpmbuild \
rust/libmacros.so

# clean - Delete most, but leave enough to build external modules
Expand Down
8 changes: 4 additions & 4 deletions scripts/Makefile.package
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ $(linux-tarballs): .tmp_HEAD FORCE
# ---------------------------------------------------------------------------

quiet_cmd_mkspec = GEN $@
cmd_mkspec = $(srctree)/scripts/package/mkspec > $@
cmd_mkspec = $(srctree)/scripts/package/mkspec $@

kernel.spec: FORCE
rpmbuild/SPECS/kernel.spec: FORCE
$(call cmd,mkspec)

PHONY += rpm-sources
Expand All @@ -88,8 +88,8 @@ srcrpm-pkg: private build-type := s
binrpm-pkg: private build-type := b

rpm-pkg srcrpm-pkg: rpm-sources
rpm-pkg srcrpm-pkg binrpm-pkg: kernel.spec
+$(strip rpmbuild -b$(build-type) kernel.spec \
rpm-pkg srcrpm-pkg binrpm-pkg: rpmbuild/SPECS/kernel.spec
+$(strip rpmbuild -b$(build-type) rpmbuild/SPECS/kernel.spec \
--define='_topdir $(abspath rpmbuild)' \
$(if $(filter a b, $(build-type)), \
--target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}' \
Expand Down
6 changes: 6 additions & 0 deletions scripts/package/mkspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
# Patched for non-x86 by Opencon (L) 2002 <[email protected]>
#

output=$1

mkdir -p "$(dirname "${output}")"

exec >"${output}"

if grep -q CONFIG_MODULES=y include/config/auto.conf; then
echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}'
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/remove-stale-files
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ rm -rf include/ksym

find . -name '*.usyms' | xargs rm -f

rm -f binkernel.spec
rm -f *.spec

0 comments on commit ffa46bb

Please sign in to comment.