public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Major Hayden <major@redhat.com>
To: linux-kbuild@vger.kernel.org, michal.lkml@markovi.net,
	yamada.masahiro@socionext.com
Cc: Major Hayden <major@redhat.com>
Subject: [PATCH] scripts/package/Makefile: Add source RPM target
Date: Tue, 19 Mar 2019 09:56:08 -0500	[thread overview]
Message-ID: <20190319145608.18636-1-major@redhat.com> (raw)

Some developers use external build systems to compile kernels and these
build systems may accept a source RPM as an input. This patch adds a
quick method for developers to build a source RPM using `make srpm-pkg`.

Signed-off-by: Major Hayden <major@redhat.com>
---
 scripts/package/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 2c6de21e5152..8329d6dfe3d8 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -47,6 +47,14 @@ tar -cz $(RCS_TAR_IGNORE) -f $(2).tar.gz \
 	--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
 rm -f $(objtree)/.scmversion
 
+# srpm-pkg
+# ---------------------------------------------------------------------------
+srpm-pkg: FORCE
+	$(MAKE) clean
+	$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
+	$(call cmd,src_tar,$(KERNELPATH),kernel.spec)
+	+rpmbuild $(RPMOPTS) -ts $(KERNELPATH).tar.gz
+
 # rpm-pkg
 # ---------------------------------------------------------------------------
 rpm-pkg: FORCE
@@ -140,6 +148,7 @@ perf-%pkg: FORCE
 help: FORCE
 	@echo '  rpm-pkg             - Build both source and binary RPM kernel packages'
 	@echo '  binrpm-pkg          - Build only the binary kernel RPM package'
+	@echo '  srpm-pkg            - Build only the source kernel RPM package'
 	@echo '  deb-pkg             - Build both source and binary deb kernel packages'
 	@echo '  bindeb-pkg          - Build only the binary kernel deb package'
 	@echo '  snap-pkg            - Build only the binary kernel snap package (will connect to external hosts)'
-- 
2.20.1

                 reply	other threads:[~2019-03-19 15:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190319145608.18636-1-major@redhat.com \
    --to=major@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox