diff mbox series

[6/6] kbuild: introduce srcdeb-pkg target

Message ID 20210411101422.7092-7-bage@linutronix.de (mailing list archive)
State New, archived
Headers show
Series builddeb: make deb building more flexible | expand

Commit Message

Bastian Germann April 11, 2021, 10:14 a.m. UTC
From: Bastian Germann <bage@linutronix.de>

A Debian source package can be generated only in combination with building
it afterwards. Introduce a target srcdeb-pkg that generates the source
package without building it (adding dpkg-buildpackage's -S flag).

Make the former deb-pkg depend on both srcdeb-pkg and bindeb-pkg to retain
its behavior.

Signed-off-by: Bastian Germann <bage@linutronix.de>
---
 scripts/Makefile.package | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Masahiro Yamada April 17, 2021, 4:58 p.m. UTC | #1
On Sun, Apr 11, 2021 at 7:14 PM <bage@linutronix.de> wrote:
>
> From: Bastian Germann <bage@linutronix.de>
>
> A Debian source package can be generated only in combination with building
> it afterwards. Introduce a target srcdeb-pkg that generates the source
> package without building it (adding dpkg-buildpackage's -S flag).
>
> Make the former deb-pkg depend on both srcdeb-pkg and bindeb-pkg to retain
> its behavior.
>
> Signed-off-by: Bastian Germann <bage@linutronix.de>
> ---
>  scripts/Makefile.package | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/Makefile.package b/scripts/Makefile.package
> index 280f3a2fa334..78a363623c3a 100644
> --- a/scripts/Makefile.package
> +++ b/scripts/Makefile.package
> @@ -69,13 +69,16 @@ binrpm-pkg:
>                 $(UTS_MACHINE) -bb $(objtree)/binkernel.spec
>
>  PHONY += deb-pkg
> -deb-pkg:
> +deb-pkg: srcdeb-pkg bindeb-pkg


Does this work reliably with the parallel build option?


While srcdeb-pkg is cleaning the tree,
bindeb-pkg simultaneously builds objects in the tree.





> +
> +PHONY += srcdeb-pkg
> +srcdeb-pkg:
>         $(MAKE) clean
>         $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
>         $(call cmd,src_tar,$(KDEB_SOURCENAME))
>         origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\
>                 mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
> -       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -us -uc
> +       +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -S -us -uc
>
>  PHONY += bindeb-pkg
>  bindeb-pkg:
> @@ -145,6 +148,7 @@ help:
>         @echo '  rpm-pkg             - Build both source and binary RPM kernel packages'
>         @echo '  binrpm-pkg          - Build only the binary kernel RPM package'
>         @echo '  deb-pkg             - Build both source and binary deb kernel packages'
> +       @echo '  srcdeb-pkg          - Build only the source kernel deb package'
>         @echo '  bindeb-pkg          - Build only the binary kernel deb package'
>         @echo '  snap-pkg            - Build only the binary kernel snap package'
>         @echo '                        (will connect to external hosts)'
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 280f3a2fa334..78a363623c3a 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -69,13 +69,16 @@  binrpm-pkg:
 		$(UTS_MACHINE) -bb $(objtree)/binkernel.spec
 
 PHONY += deb-pkg
-deb-pkg:
+deb-pkg: srcdeb-pkg bindeb-pkg
+
+PHONY += srcdeb-pkg
+srcdeb-pkg:
 	$(MAKE) clean
 	$(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
 	$(call cmd,src_tar,$(KDEB_SOURCENAME))
 	origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\
 		mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
-	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -us -uc
+	+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -S -us -uc
 
 PHONY += bindeb-pkg
 bindeb-pkg:
@@ -145,6 +148,7 @@  help:
 	@echo '  rpm-pkg             - Build both source and binary RPM kernel packages'
 	@echo '  binrpm-pkg          - Build only the binary kernel RPM package'
 	@echo '  deb-pkg             - Build both source and binary deb kernel packages'
+	@echo '  srcdeb-pkg          - Build only the source kernel deb package'
 	@echo '  bindeb-pkg          - Build only the binary kernel deb package'
 	@echo '  snap-pkg            - Build only the binary kernel snap package'
 	@echo '                        (will connect to external hosts)'